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

[ML-DSA] Use all of commitment hash to sample verifiers challenge #600

Merged
merged 5 commits into from
Sep 30, 2024

Conversation

jschneider-bensch
Copy link
Collaborator

@jschneider-bensch jschneider-bensch commented Sep 26, 2024

This addresses #497, by passing in all of the commitment hash instead of just the first 32 bytes.

I've also increased the rejection sample loop bound in signing to the value prescribed by the standard. For the other rejection sampling loops described in the standard we don't put a limit, so this change also addresses #572.

I wonder about our test vectors with these changes: We can update our self-generated set (via the python spec) bit by bit along with our implementation, as we incorporate these changes. For external sources of test vectors, like the Wycheproof ones, we have vectors for the draft version and there seem to be vectors for the final standard in the same PR where we got the draft vectors (C2SP/wycheproof#112). Should we disable these tests and do changes bit by bit, or do all changes in one go, also updating the test vectors to their final version?

Update: I'm going to be addressing the changes in very short order, so I've disabled the old Wycheproof tests and filed an issue to re-enable them (updated to the standard vectors), once all changes are in: #607.

@franziskuskiefer franziskuskiefer changed the title Use all of commitment hash to sample verifiers challenge [ML-DSA} Use all of commitment hash to sample verifiers challenge Sep 27, 2024
@franziskuskiefer franziskuskiefer changed the title [ML-DSA} Use all of commitment hash to sample verifiers challenge [ML-DSA] Use all of commitment hash to sample verifiers challenge Sep 27, 2024
@jschneider-bensch jschneider-bensch marked this pull request as ready for review September 30, 2024 08:30
This was linked to issues Sep 30, 2024
Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I'm not sure I understand the comment about the other loops. As far as I can see we don't limit other loops.. And you want to keep it that way? That's fine with me, but we may reconsider adding them for the proofs (as we'll use the limit there anyway).

@jschneider-bensch
Copy link
Collaborator Author

Yeah, that's what I was trying to say. In the standards it says implementations should not bound rejection sampling loops, but if they do there are definitions for minimal numbers of attempts allowed: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.204.pdf#appendix.C

Since we do not limit the number of attempts in our rejection sampling, except for the one loop in signing, we don't need to update any further loop bounds.

@jschneider-bensch jschneider-bensch added this pull request to the merge queue Sep 30, 2024
Merged via the queue into main with commit f8a7d13 Sep 30, 2024
49 checks passed
@jschneider-bensch jschneider-bensch deleted the jonas/fips-204-sample-in-ball branch September 30, 2024 09:36
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.

Adjust loop bound for rejection sampling Change in SampleInBall()
2 participants