Skip to main content

Module chachapoly

Module chachapoly 

Source
Expand description

ChaCha20-Poly1305 (RFC 8439), tuned for many short messages.

Byte-for-byte the same construction as the chacha20poly1305 crate; what differs is the cost shape. The Poly1305 key block is produced in the same SIMD pass as the first data blocks, and Poly1305 is scalar, so a chat message costs one keystream pass and no per-message vector setup.

Structs§

ChaCha20Poly1305
A keyed ChaCha20-Poly1305 instance. The expanded key is zeroized on drop.
Error

Constants§

KEY_LEN
NONCE_LEN
TAG_LEN

Functions§

wipe
Zeroize with word-wide volatile stores. zeroize on a byte slice issues one volatile store per byte, which costs more than the cipher on short messages.
wipe_vec
wipe over a vector’s whole allocation, spare capacity included, then empty it.