Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect seeding value in ML KEM intermediate files. #12

Open
Ant1-Provot opened this issue Sep 2, 2024 · 4 comments
Open

Incorrect seeding value in ML KEM intermediate files. #12

Ant1-Provot opened this issue Sep 2, 2024 · 4 comments

Comments

@Ant1-Provot
Copy link

Hello !

The seeding values (𝜌, 𝜎) are incorrect. Based on the FIPS 203 - Algo 13 - Line 1, they are supposed to be the concatenation of d and k (resulting in 33 bytes ), then hashed through SHA3-512.

The current (𝜌, 𝜎) are the result of only the hashing of d, without any concatenation with k.

@Aurum-Vale
Copy link

Aurum-Vale commented Sep 16, 2024

Hi, the current main branch is still based on the FIPS-203 draft, hence the differences you observed.
The encaps and decaps test vectors should still be correct, but the intermediate, unlucky and monte carlo tests are now incorrect.

In particular, the unlucky test vectors needs to be bruteforced again, but it will take three times as long: domain separation influences the shake stream, which is where the bruteforce happens. I am currently trying to bruteforce those myself to at least get the test vectors.

I will submit a PR if I manage to get them, although it would then need additional review so it doesn't only count on my own ML-KEM implementation to verify the new test vectors.

@Aurum-Vale
Copy link

Edited my previous post with the most important word missing from the first sentence.

I've regenerated monte carlo vectors and I found an unlucky sample for k = 4, I'm still bruteforcing for the others but it shouldn't take long. I'll also look into regenerating the intermediate vectors.

@Ant1-Provot
Copy link
Author

Ant1-Provot commented Sep 17, 2024

Okay thanks then !
I'll also test your vectors against my implem if you submit a new PR.
Have a good day.

@Aurum-Vale
Copy link

Hey, I submitted a PR with the vectors I found if you want to test them, I didn't include the "intermediate" vectors however. #13

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

No branches or pull requests

2 participants