Correct assertion in polyveck_add()#988
Merged
Merged
Conversation
It was previously asserting the correct range on values in u->vec in the range 0 .. <MLDSA_L, but this should be 0 .. <MLDSA_K. Since MLDSA_L <= MLDSA_K for all parameter sets, this passes proof and runtime checking, but is weak. The loop-invariant and post-condition of this function are correct, so proof of calling units is not affected. Signed-off-by: Rod Chapman <rodchap@amazon.com>
Contributor
CBMC Results (ML-DSA-65)Full Results (175 proofs)
|
Contributor
CBMC Results (ML-DSA-44)Full Results (175 proofs)
|
Contributor
CBMC Results (ML-DSA-87)Full Results (175 proofs)
|
hanno-becker
approved these changes
Mar 3, 2026
Contributor
hanno-becker
left a comment
There was a problem hiding this comment.
I agree with the fix. This was not flagged because a) It weaker than the correct version (since MLDSA_K >= MLDSA_L), hence correct; b) the assertion is not useful for the proof, but a vehicle to identify violations in debug builds.
mkannwischer
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Correct assertion in polyveck_add()
It was previously asserting the correct range on values in u->vec in the range 0 .. <MLDSA_L, but this should be 0 .. <MLDSA_K.
Since MLDSA_L <= MLDSA_K for all parameter sets, this passes proof and runtime checking, but is weak.
The loop-invariant and post-condition of this function are correct, so proof of calling units is not affected.