Expand description
Noise-IKpsk2 post-quantum hybrid handshake and AEAD session crypto for the yip data plane, built
on the snow Noise Protocol Framework. Establishing a Session requires
completing an IKpsk2 Handshake; the session then seals/opens inner frames
with explicit per-frame nonces and a sliding anti-replay window.
snow drives the Noise handshake only. Once the handshake completes, the two
secret transport keys are extracted via snow’s dangerously_get_raw_split()
(the same HKDF-derived bytes snow’s own split() uses internally) and handed
to ring’s asm ChaCha20-Poly1305 for the data-plane hot path, keyed with the
Noise nonce convention (4 zero bytes ++ 8-byte little-endian counter). This is
byte-identical to snow’s own transport state but faster.
Structs§
- ChaCha20
Poly1305 Cipher - ChaCha20-Poly1305 AEAD cipher supporting zero-copy in-place encryption and decryption directly within pre-allocated network packet buffers (such as AF_XDP UMEM chunks).
- Handshake
- An in-progress Noise-IKpsk2 post-quantum hybrid handshake.
- Keypair
- An X25519 static keypair (32-byte private and public halves).
- PqCiphertext
- An ML-KEM-512 encapsulated ciphertext.
- PqDecaps
Key - An ML-KEM-512 private decapsulation key wrapped in zeroizing memory.
- PqEncaps
Key - An ML-KEM-512 public encapsulation key.
- Replay
Window - A wide sliding replay window over a monotonic
u64counter using a circular word ring. - Sealed
- A sealed frame: the AEAD ciphertext plus the explicit nonce it was sealed
under. The caller carries
counteron the wire so the peer canopen. - Session
- An established AEAD session. Seals outgoing frames under a monotonic counter and opens incoming frames out of order, rejecting replays.
Enums§
- Crypto
Error - Errors from the crypto layer.
- Replay
Profile - Sizing profile for the sliding replay window bitmap.
Constants§
- PQ_
CIPHERTEXT_ LEN - ML-KEM-512 ciphertext length in bytes (FIPS 203).
- PQ_
ENCAPS_ KEY_ LEN - ML-KEM-512 encapsulation key length in bytes (FIPS 203).
- PQ_
SHARED_ SECRET_ LEN - ML-KEM-512 shared secret length in bytes (FIPS 203).
- REPLAY_
WINDOW_ BITS - Number of past counters the replay window tracks behind the latest in HighThroughput mode.
- REPLAY_
WINDOW_ BITS_ HIGH_ THROUGHPUT - HighThroughput profile replay window parameters (16 KB bitmap).
- REPLAY_
WINDOW_ BITS_ STANDARD - Standard profile replay window parameters (1 KB bitmap).
- REPLAY_
WORDS - REPLAY_
WORDS_ HIGH_ THROUGHPUT - REPLAY_
WORDS_ STANDARD
Functions§
- generate_
keypair - Generate a fresh X25519 static keypair.
- generate_
pq_ keypair - Generate a fresh ML-KEM-512 keypair.
- pq_
decapsulate - Decapsulate
ctusingdk, recovering the 32-byte shared secret wrapped in zeroizing memory. - pq_
encapsulate - Encapsulate a shared secret toward
ek, producing(ciphertext, shared_secret).