Documentation ¶
Overview ¶
Package acorn implements the ACORN-128 authenticated encryption algorithm designed by Hongjun Wu, as specified in
https://competitions.cr.yp.to/round3/acornv3.pdf
ACORN was one of the six winners of the CAESAR competition: It is the second choice for use case 1 (lightwight applications in resource-constrained evironments). If you are not operating in a resource-constrained environment, AES-GCM is probably a better choice.
ACORN is claimed to be secure provided that the following conditions are met:
The key should be generated in a secure and random way
A key, nonce pair should not be used to protect more than one message
If verification fails, the decrypted plaintext and wrong authentication tag should not be given as output
Please note that repeating a nonce may allow an attacker to trivially forge arbitrary messages. Nonces should either be chosen at random (such as with RandomNonce) or assigned sequentially in a manner guaranteed never to repeat.
Index ¶
Constants ¶
const ( KeySize = 128 / 8 NonceSize = 128 / 8 TagSize = 128 / 8 )
Variables ¶
This section is empty.
Functions ¶
func NewAEAD ¶
New returns a ACORN instance that uses the given 128-bit key. If the key is not the correct length, NewAEAD will panic.
func RandomKey ¶
func RandomKey() []uint8
RandomKey returns a securely-generated random 16-byte key.
func RandomNonce ¶
func RandomNonce() []uint8
RandomNonce returns a securely-generated random 16-byte nonce suitable for passing to Seal.
Types ¶
This section is empty.