You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Figure out which Kyber primitives ML-KEM can reuse #8
ML-KEM uses the same NTT, Keccak, CBD and polynomial encoding as Kyber, so we shouldn't write them twice. But changing shared code risks changing Kyber output.
Go through fips202, ntt, reduce, cbd, poly encoding and compression, and list which ones ML-KEM can use as they are
Add a parameter type generic over k (const generic or a trait) for the new code. I don't want a fourth copy of the _512/_768/_1024 functions
Leave the legacy code alone apart from moving things around
Done when: the golden vectors from #6 still pass and the PR has a short write-up of what's shared and what isn't.
Done in #28, merged into dev-v2. The golden vectors still pass, and the write-up of what is shared and what is not is the module documentation at the top of src/mlkem/mod.rs (summary in the PR description).
Short version: Keccak, reduce, ntt, cbd2/cbd3, poly_tobytes, Compress/Decompress for d = 1, 4, 5, 10 (and Decompress for 11) and rej_uniform are shared as they are. Not shared: poly_frombytes (no mod q reduction), the legacy d = 11 compression (off by one at 1875 and 3125, logged on #18), poly_frommsg, verify/cmov and poly_getnoise_*. Added: ParamSet, PolyVec, sample_ntt, and an exact Compress_11 for ML-KEM-1024.
Open findings from this work are on #18. Next is #9.
Activity
Zikithezikit commentedon Oct 30, 2026
Done in #28, merged into dev-v2. The golden vectors still pass, and the write-up of what is shared and what is not is the module documentation at the top of src/mlkem/mod.rs (summary in the PR description).
Short version: Keccak, reduce, ntt, cbd2/cbd3, poly_tobytes, Compress/Decompress for d = 1, 4, 5, 10 (and Decompress for 11) and rej_uniform are shared as they are. Not shared: poly_frombytes (no mod q reduction), the legacy d = 11 compression (off by one at 1875 and 3125, logged on #18), poly_frommsg, verify/cmov and poly_getnoise_*. Added: ParamSet, PolyVec, sample_ntt, and an exact Compress_11 for ML-KEM-1024.
Open findings from this work are on #18. Next is #9.