const KEY_SIZE
pub const KEY_SIZE = 32Purpose
Constant KEY_SIZE, defining protocol or algorithm parameters.
#crypto/chacha20poly1305`.org/x/crypto/chacha20poly1305`: ChaCha20-Poly1305 AEAD per RFC 8439. Key is 32 bytes, Nonce is 12 bytes, Tag is 16 bytes. XU-CT-CLASS: variable-time XU-CT-USE: fixed-shape-only
const KEY_SIZEpub const KEY_SIZE = 32Constant KEY_SIZE, defining protocol or algorithm parameters.
const NONCE_SIZEpub const NONCE_SIZE = 12Constant NONCE_SIZE, defining protocol or algorithm parameters.
const TAG_SIZEpub const TAG_SIZE = 16Constant TAG_SIZE, defining protocol or algorithm parameters.
struct AEADpub struct AEAD {
}AEAD context or state structure.
This type has no public fields.
newpub fn new(key &string) AEADConstruct a new value of this type. Throws on failure; handle the error or propagate it to the caller.
key &stringAEAD — a value of this type
(&AEAD) sealpub fn (a &AEAD) seal(nonce &string, plaintext &string, additional_data &string) stringseal encrypts and authenticates plaintext with additional data using nonce. Returns ciphertext with 16-byte authentication tag appended. Throws on failure; handle the error or propagate it to the caller.
a &AEADAEAD instance used by this call (borrow).nonce &stringplaintext &stringadditional_data &stringstring — result string
(&AEAD) openpub fn (a &AEAD) open(nonce &string, ciphertext_and_tag &string, additional_data &string) stringopen authenticates and decrypts ciphertext_and_tag using nonce and additional data. Throws on failure; handle the error or propagate it to the caller.
a &AEADAEAD instance used by this call (borrow).nonce &stringciphertext_and_tag &stringadditional_data &stringstring — result string