Skip to content

Add KAT for ML-KEM#14606

Merged
alex merged 1 commit intopyca:mainfrom
trail-of-forks:dm/mlkem-768-kat
Apr 9, 2026
Merged

Add KAT for ML-KEM#14606
alex merged 1 commit intopyca:mainfrom
trail-of-forks:dm/mlkem-768-kat

Conversation

@DarkaMaul
Copy link
Copy Markdown
Contributor

As part of #14598 , this PR adds KAT for ML-KEM.\

Warning: the test vectors are heavy (36 MB) because they contain 1000 vectors, and it bumps the total size of the vectors in the repo by 30%! For comparison, ML-DSA only has 100 vectors.

At the moment in the PR, I have kept the files as-is, but I think we could trim them down to only the first hundred vectors each. WDYT?

@alex
Copy link
Copy Markdown
Member

alex commented Apr 8, 2026

Before I merge, have we confirmed these vectors are useful for us (i.e., they are usable as seed only)?

@DarkaMaul
Copy link
Copy Markdown
Contributor Author

Yes, the format is described here: MLKEM#file-format

On the 11 fields we are using:

  • d and z the two 32 bytes components that are used to construct the seed in Algorithm 16
  • pk -- expected public key
  • ct -- valid ciphertext
  • ss -- expected shared secret from valid decapsulation
  • ct_n -- invalid ciphertext from implicit rejection
  • ss_n -- expected shared secret from implicit rejection

And the four that we do not use:

  • msg -- encapsulation randomness (can't test, no deterministic encaps API)
  • seed -- AES-CTR-DRBG seed
  • sk -- full expanded secret key
  • count -- test number

@alex alex merged commit 5cd2ca9 into pyca:main Apr 9, 2026
67 checks passed
@DarkaMaul DarkaMaul deleted the dm/mlkem-768-kat branch April 9, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants