Package-Level Functions (total 8, in which 2 are exported)
New returns a ChaCha20-Poly1305 AEAD that uses the given 256-bit key.
NewX returns a XChaCha20-Poly1305 AEAD that uses the given 256-bit key.
XChaCha20-Poly1305 is a ChaCha20-Poly1305 variant that takes a longer nonce,
suitable to be generated randomly without risk of collisions. It should be
preferred when nonce uniqueness cannot be trivially ensured, or whenever
nonces are randomly generated.
setupState writes a ChaCha20 input matrix to state. See
https://tools.ietf.org/html/rfc7539#section-2.3.
sliceForAppend takes a slice and a requested number of bytes. It returns a
slice with the contents of the given slice followed by that many bytes and a
second slice that aliases into it and contains only the extra bytes. If the
original slice has sufficient capacity then no allocation is performed.
Package-Level Constants (total 4, all are exported)
KeySize is the size of the key used by this AEAD, in bytes.
NonceSize is the size of the nonce used with the standard variant of this
AEAD, in bytes.
Note that this is too short to be safely generated at random if the same
key is reused more than 2³² times.
NonceSizeX is the size of the nonce used with the XChaCha20-Poly1305
variant of this AEAD, in bytes.
Overhead is the size of the Poly1305 authentication tag, and the
difference between a ciphertext length and its plaintext.
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.