package eax

import "github.com/ProtonMail/go-crypto/eax"

Package eax provides an implementation of the EAX (encrypt-authenticate-translate) mode of operation, as described in Bellare, Rogaway, and Wagner "THE EAX MODE OF OPERATION: A TWO-PASS AUTHENTICATED-ENCRYPTION SCHEME OPTIMIZED FOR SIMPLICITY AND EFFICIENCY." In FSE'04, volume 3017 of LNCS, 2004

Index

Functions

func NewEAX

func NewEAX(block cipher.Block) (cipher.AEAD, error)

NewEAX returns an EAX instance with AES-{KEYLENGTH} and default nonce and tag lengths. Supports {128, 192, 256}- bit key length.

func NewEAXWithNonceAndTagSize

func NewEAXWithNonceAndTagSize(
	block cipher.Block, nonceSize, tagSize int) (cipher.AEAD, error)

NewEAXWithNonceAndTagSize returns an EAX instance with AES-{keyLength} and given nonce and tag lengths in bytes. Panics on zero nonceSize and exceedingly long tags.

It is recommended to use at least 12 bytes as tag length (see, for instance, NIST SP 800-38D).

Only to be used for compatibility with existing cryptosystems with non-standard parameters. For all other cases, prefer NewEAX.

Source Files

eax.go eax_test_vectors.go random_vectors.go

Version
v1.3.0 (latest)
Published
May 22, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
2 days ago

Tools for package owners.