Package xchacha20poly1305 creates an AEAD using hchacha, chacha, and poly1305 This allows for randomized nonces to be used in conjunction with chacha.
const ( // KeySize is the size of the key used by this AEAD, in bytes. KeySize = 32 // NonceSize is the size of the nonce used with this AEAD, in bytes. NonceSize = 24 // TagSize is the size added from poly1305 TagSize = 16 // MaxPlaintextSize is the max size that can be passed into a single call of Seal MaxPlaintextSize = (1 << 38) - 64 // MaxCiphertextSize is the max size that can be passed into a single call of Open, // this differs from plaintext size due to the tag MaxCiphertextSize = (1 << 38) - 48 )
HChaCha20 generates 32 pseudo-random bytes from a 128 bit nonce and a 256 bit secret key. It can be used as a key-derivation-function (KDF).
New returns a new xchachapoly1305 AEAD