aead

package
v0.0.0-...-a03f3f8 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AEAD

type AEAD uint16

AEAD describes iana-registered AEAD cipher. https://www.iana.org/assignments/hpke/hpke.xhtml

const (
	// AES128GCM is AES-128 block cipher in Galois Counter Mode (GCM).
	AES128GCM AEAD = 0x01
	// AES256GCM is AES-256 block cipher in Galois Counter Mode (GCM).
	AES256GCM AEAD = 0x02
	// ChaCha20Poly1305 is ChaCha20 stream cipher and Poly1305 MAC.
	ChaCha20Poly1305 AEAD = 0x03
	// EXPORT_ONLY is reserved for applications that only use the Exporter
	// interface.
	EXPORT_ONLY AEAD = 0xFFFF
)

https://www.iana.org/assignments/hpke/hpke.xhtml

func (AEAD) IsValid

func (a AEAD) IsValid() bool

IsValid checks if the given AEAD is supported.

func (AEAD) KeySize

func (a AEAD) KeySize() uint16

KeySize returns the expected key size.

func (AEAD) New

func (a AEAD) New(key []byte) (cipher.AEAD, error)

New initializes an AEAD concrete AEAD cipher with the given key.

func (AEAD) NonceSize

func (a AEAD) NonceSize() uint16

NonceSize returns the expected nonce size.

Jump to

Keyboard shortcuts

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