Expand description
ML-KEM-768 (FIPS-203) keygen / encapsulation / decapsulation as a Rust composition of the
verified native kernels in crate::ntt (NTT, base-multiply, CBD, compress, byte-encode,
4-way AVX2 matrix expansion) and crate::keccak (SHA3-256/512, SHAKE256). This is the exact
same primitive set the assets/std/crypto.lg Logos ML-KEM orchestrates and that the
logicaffeine-tests AOT gates prove bit-exact vs the FIPS-203 reference — here orchestrated in
Rust so the post-quantum channel (logicaffeine_compile::concurrency::channel) can run the
handshake. Coefficients ride the fast Word16 carrier throughout.
Constants§
- CT_
BYTES ct= K·(32·du) + 32·dv (ciphertext).- DK_
BYTES dk= dk_pke ‖ ek ‖ H(ek) ‖ z (decapsulation / secret key).- EK_
BYTES ek= K·384 + 32 (encapsulation / public key).- SS_
BYTES - Shared secret length.
Functions§
- decaps
- ML-KEM.Decaps(dk, c) → shared secret, with the Fujisaki-Okamoto implicit reject.
- encaps
- ML-KEM.Encaps(ek, m) → (ciphertext, shared secret).
mis the 32-byte message randomness. - keygen
- ML-KEM.KeyGen(d, z) → (ek, dk) where dk = dk_pke ‖ ek ‖ H(ek) ‖ z.
- mlkem_
decaps_ seq mlkemDecapsKem(dk, ct)→ shared_secret(32).- mlkem_
encaps_ seq mlkemEncapsKem(ek, m)→ ciphertext(1088) ‖ shared_secret(32).- mlkem_
keypair_ seq mlkemKeypair(d, z)→ ek(1184) ‖ dk(2400).- mlkem_
noise_ batch_ from_ int mlkemNoiseBatch(seed, base, count)→count·256raw CBD_2 Word16 coefficients (noncesbase..base+count, no NTT), the flat concatenation ofcountnoise polynomials. The fast primitive the Logosmlkem768Keygen/mlkemEncryptcall once instead ofcountscalarmlkemPrfNoises — one 4-way SHAKE256 permutation covers four PRF streams (see [noise_batch_raw]).