Versions in this module Expand all Collapse all v1 v1.0.0 Aug 19, 2022 Changes in this version + const DefaultKeyLabel + const DefaultRecordSize + const KeySize + const NonceSize + const TagSize + var ErrInvalidDH = fmt.Errorf("dh sequence is invalid") + var ErrInvalidKeySize = fmt.Errorf("invalid static key length") + var ErrInvalidPadding = fmt.Errorf("invalid padding") + var ErrInvalidSaltSize = fmt.Errorf("invaild salt size") + var ErrKeyIDTooLong = fmt.Errorf("keyID too long") + var ErrPaddingToRecord = fmt.Errorf("unable to pad to record size") + var ErrTooSmallRecordSize = fmt.Errorf("record size too small") + var ErrTruncated = fmt.Errorf("content truncated") + func NewGCM(key []byte) (cipher.AEAD, error) + type Engine struct + func NewEngine(keyLookupFunc KeyLookupFunc, options ...EngineOption) *Engine + func (e *Engine) Decrypt(content, target []byte, params OperationalParams) ([]byte, error) + func (e *Engine) Encrypt(content, target []byte, params OperationalParams) ([]byte, error) + type EngineOption interface + func WithAuthSecret(authSecret []byte) EngineOption + func WithKeyLabel(keyLabel string) EngineOption + type KeyLookupFunc func(keyID []byte) *ecdsa.PrivateKey + func SingleKey(key *ecdsa.PrivateKey) KeyLookupFunc + type OperationalParams struct + DH []byte + KeyID []byte + Pad uint32 + RecordSize uint32 + Salt []byte + StaticKey []byte + Version Version + type Version string + const AES128GCM + const AESGCM + const AESGCM128 + func (v Version) PaddingSize() int + func (v Version) String() string