Module chacha20

Source
Expand description

Module for the ChaCha20 stream cipher algorithm.

Structs§

ChaCha20
The ChaCha20 struct represents the ChaCha20 stream cipher.

Constants§

CHACHA20_NONCE_SIZE
Size of the ChaCha20 nonce in bytes. The nonce is a 64-bit (8 bytes) value used to make each block unique.
CONSTANTS
Constants for the ChaCha20 algorithm. These four 32-bit words represent the ASCII encoding of “expand 32-byte k”, used in the state initialization of the ChaCha20 block.
STATE_WORDS
Number of 32-bit words in the ChaCha state. The ChaCha20 state consists of 16 words, each of which is 32 bits long.

Functions§

permute
Runs the ChaCha20 permutation on the provided state.
xor_bytes
XORs two 512-bit state arrays. This function modifies the first array in place.

Type Aliases§

Block
The array of words representing a ChaCha20 block.