Skip to content

ml-kem: Update to FIPS 203#47

Merged
tarcieri merged 5 commits into
RustCrypto:masterfrom
bifurcation:fips-203
Aug 16, 2024
Merged

ml-kem: Update to FIPS 203#47
tarcieri merged 5 commits into
RustCrypto:masterfrom
bifurcation:fips-203

Conversation

@bifurcation

Copy link
Copy Markdown
Contributor

Fixes #46

This PR implements the two changes noted in Appendix C of FIPS 203:

  • Domain separation in K-PKE.KeyGen
  • Reversing the order of indices in array sampling

It turns out that we had already made the latter change in order to pass the existing test vectors.

Marking as WIP right now because I don't think updated test vectors have been published, and the current code fails on the current test vectors. Should be a quick copy/paste update once the test vectors are available.

@tarcieri

Copy link
Copy Markdown
Member

At some point the documentation (README.md, Cargo.toml) should also be updated to note it's no longer the draft construction

@tarcieri

Copy link
Copy Markdown
Member

@bifurcation bifurcation marked this pull request as ready for review August 16, 2024 18:11
@bifurcation

Copy link
Copy Markdown
Contributor Author

@tarcieri - docs and test vectors updated, think this is ready for review

@bifurcation

Copy link
Copy Markdown
Contributor Author

I went a little more radical on the test vector refactor than I might have, but honestly (a) the first effort was kinda half-assed, and (b) this way if NIST updates the vectors, we can just pull JSON files and not have to copy/paste a bunch of hex strings.

@newpavlov

Copy link
Copy Markdown
Member

The JSON files are quite big (831 KB and 558 KB). I think we should either exclude them (and respective tests) from published crates (e.g. see the cmac crate), or compress them better.

@bifurcation

Copy link
Copy Markdown
Contributor Author

Good point @newpavlov, added those tests to the exclude list.

@tarcieri tarcieri merged commit 26e8c8a into RustCrypto:master Aug 16, 2024
@tarcieri tarcieri mentioned this pull request Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ml-kem: update to FIPS 203 final

3 participants