Crate chacha20_poly1305_stream

Crate chacha20_poly1305_stream 

Source
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§

ChaCha20Poly1305StreamDecryptor
ChaCha20Poly1203 Stream Decryptor
ChaCha20Poly1305StreamEncryptor
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