Expand description
A pure Rust implementation of the ChaCha20-Poly1305 AEAD from RFC 7539.
An Authenticated Encryption with Associated Data (AEAD) mode encrypts data and generates an authentication tag, or decrypts data and verifies an authentication tag, as a single operation. The tag can also validate additional authenticated data (AAD) which is not included in the cyphertext, for instance a plaintext header.
The ChaCha20-Poly1305 AEAD uses a 256-bit (32-byte) key, and a 96-bit (12-byte) nonce. For each key, a given nonce should be used only once, otherwise the encryption and authentication can be broken. One way to prevent reuse is for the nonce to contain a sequence number.
The amount of data that can be encrypted in a single call is 2^32 - 1 blocks of 64 bytes, slightly less than 256 GiB.
Structs§
- ChaCha20
Poly1305 Stream Decryptor - ChaCha20Poly1203 Stream Decryptor
- ChaCha20
Poly1305 Stream Encryptor - ChaCha20Poly1203 Stream Encryptor
Functions§
- chacha20_
poly1305_ aad_ decrypt - ChaCha20Policy Decrypt with AAD
- chacha20_
poly1305_ aad_ encrypt - ChaCha20Policy Encrypt with AAD
- chacha20_
poly1305_ decrypt - ChaCha20Policy Decrypt
- chacha20_
poly1305_ encrypt - ChaCha20Policy Encrypt
- selftest
- Runs the self-test for ChaCha20, Poly1305