crypto

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package crypto wraps golang.org/x/crypto. Do not invent AEAD or KDFs.

Index

Constants

Variables

View Source
var ErrAuth = errors.New("crypto: authentication failed")

Functions

func NewKey

func NewKey() ([]byte, error)

func Open

func Open(key, blob []byte) ([]byte, error)

func OpenAAD

func OpenAAD(key, blob, aad []byte) ([]byte, error)

OpenAAD fails with ErrAuth unless aad matches what SealAAD bound.

func OpenEpoch

func OpenEpoch(key, blob, aad []byte) ([]byte, error)

OpenEpoch dispatches on the epoch marker: marked blobs must open under aad (a wrong context fails closed — no legacy retry), unmarked blobs are legacy and open nil-AAD. aad is ignored for legacy blobs.

func Seal

func Seal(key, plaintext []byte) ([]byte, error)

Seal returns nonce||ciphertext. key must be KeySize bytes. This is also the owner-key wrap: master seals the per-owner DEK.

func SealAAD

func SealAAD(key, plaintext, aad []byte) ([]byte, error)

SealAAD binds ciphertext to aad: OpenAAD with different data fails. New formats take context (org, item) as AAD; legacy blobs predate it.

func SealEpoch

func SealEpoch(key, plaintext, aad []byte) ([]byte, error)

SealEpoch is SealAAD stamped with the epoch marker. Store rows written through it are bound to aad; OpenEpoch reads both this and legacy nil-AAD blobs.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL