Documentation
¶
Index ¶
- type Aead
- func NewAES128SIV() Aead
- func NewAES256SIV() Aead
- func NewAESGCM() Aead
- func NewAesGcmSiv() Aead
- func NewAscon128() Aead
- func NewAscon80pq() Aead
- func NewChaCha20Poly1305() Aead
- func NewDeoxysII128() Aead
- func NewGiftCofb() Aead
- func NewSkinnyAead() Aead
- func NewXChaCha20Poly1305() Aead
- func NewXoodyak() Aead
- type MultiAssociatedData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aead ¶
type Aead interface {
Encrypt(key, nonce, ad, plaintext []byte) ([]byte, error)
Decrypt(key, nonce, ad, ciphertextAndTag []byte) ([]byte, error)
}
func NewAES128SIV ¶
func NewAES128SIV() Aead
NewAES128SIV returns an AES-SIV AEAD instance that expects 32-byte keys. The first half of the key is used for S2V (CMAC), and the second half for CTR.
func NewAES256SIV ¶
func NewAES256SIV() Aead
NewAES256SIV returns an AES-SIV AEAD instance that expects 64-byte keys. The first half of the key is used for S2V (CMAC), and the second half for CTR.
func NewAesGcmSiv ¶
func NewAesGcmSiv() Aead
NewAesGcmSiv returns an AEAD instance implementing AES-GCM-SIV as defined in RFC 8452. Keys must be 16 or 32 bytes long, and nonces must always be 12 bytes.
func NewAscon128 ¶
func NewAscon128() Aead
NewAscon128 returns a zero-allocation AEAD cipher instance.
func NewAscon80pq ¶
func NewAscon80pq() Aead
func NewChaCha20Poly1305 ¶
func NewChaCha20Poly1305() Aead
NewChaCha20Poly1305 returns a zero-allocation AEAD cipher instance.
func NewDeoxysII128 ¶
func NewDeoxysII128() Aead
NewDeoxysII128 returns an AEAD based on Deoxys-II-256-128 (NIST LwC finalist). Keys are 32 bytes, nonces are 15 bytes, and the authentication tag is 16 bytes.
func NewGiftCofb ¶
func NewGiftCofb() Aead
NewGiftCofb returns an AEAD implementation of the GIFT-COFB algorithm.
func NewSkinnyAead ¶
func NewSkinnyAead() Aead
NewSkinnyAead returns an AEAD implementation of SKINNY-AEAD-M1.
func NewXChaCha20Poly1305 ¶
func NewXChaCha20Poly1305() Aead
NewXChaCha20Poly1305 returns a zero-allocation AEAD cipher instance.
type MultiAssociatedData ¶
type MultiAssociatedData interface {
EncryptWithAssociatedData(key, nonce []byte, ad [][]byte, plaintext []byte) ([]byte, error)
DecryptWithAssociatedData(key, nonce []byte, ad [][]byte, ciphertextAndTag []byte) ([]byte, error)
}
MultiAssociatedData exposes AES-SIV helpers that accept an arbitrary number of associated data components in addition to the optional nonce. This mirrors the SIV construction defined in RFC 5297 where the nonce is treated as the first associated string and additional components may follow.