Expand description
Raw single-block / stream cipher primitives for the OxiCrypto stack.
These are deliberately low-level building blocks, distinct from the
authenticated oxicrypto-aead ciphers.
They exist for QUIC header protection (RFC 9001 §5.4), which masks packet
headers with a 5-byte sample of either an AES-ECB single-block encryption
(§5.4.3) or a ChaCha20 keystream block (§5.4.4).
| Primitive | Function | Notes |
|---|---|---|
| AES-128 single block | aes128_encrypt_block | one 16-byte ECB block |
| AES-256 single block | aes256_encrypt_block | one 16-byte ECB block |
| ChaCha20 keystream block | chacha20_keystream_block | RFC 8439 / RFC 9001 §5.4.4 |
All wrappers are #![forbid(unsafe_code)]; the underlying aes / chacha20
crates provide safe constructors (KeyInit::new, KeyIvInit::new) and
operations (BlockEncrypt::encrypt_block, StreamCipher::apply_keystream).
Constants§
- AES128_
KEY_ LEN - AES-128 key length in bytes.
- AES256_
KEY_ LEN - AES-256 key length in bytes.
- AES_
BLOCK_ LEN - AES block size in bytes.
- CHACH
A20_ KEY_ LEN - ChaCha20 key length in bytes.
- CHACH
A20_ NONCE_ LEN - ChaCha20 nonce length in bytes (IETF / RFC 8439 variant).
Functions§
- aes128_
encrypt_ block - Encrypt a single 16-byte block with AES-128 in raw ECB mode.
- aes256_
encrypt_ block - Encrypt a single 16-byte block with AES-256 in raw ECB mode.
- chacha20_
keystream_ block - Produce ChaCha20 keystream bytes for a given 32-byte key, 32-bit block counter, and 12-byte nonce (RFC 8439 / RFC 9001 §5.4.4).