mldsa: Explain packed byte counts via check-magic - #1411
Merged
Conversation
The annotation regexp required at least four digits, so annotations for smaller constants were silently ignored. Accept any number of digits; requiring an explanation stays limited to four digits and above. This revives the 16 and 44 annotations in the native headers. The 3 == 2 + 1 and 5 == 4 + 1 annotations explain nothing and are dropped. Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Defines were only remembered when the line also carried a magic constant, so MLDSA_N or a bit width could not be used in an annotation. Remember integer defines directly instead. Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Restore the concrete byte counts and connect them to the packing bit widths with check-magic annotations. The parameter set specific annotations spell out the bit width, as check-magic resolves defines by scan order rather than by preprocessor branch. Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
mkannwischer
force-pushed
the
check-magic-packed-bytes
branch
from
September 2, 2026 01:19
96454ba to
8fae229
Compare
mkannwischer
marked this pull request as ready for review
September 2, 2026 01:19
Contributor
CBMC Results (ML-DSA-65, REDUCE-RAM)
Full Results (212 proofs)
|
Contributor
CBMC Results (ML-DSA-44, REDUCE-RAM)
Full Results (212 proofs)
|
Contributor
CBMC Results (ML-DSA-87, REDUCE-RAM)
Full Results (212 proofs)
|
Contributor
CBMC Results (ML-DSA-44)
Full Results (212 proofs)
|
Contributor
CBMC Results (ML-DSA-65)
Full Results (212 proofs)
|
Contributor
CBMC Results (ML-DSA-87)
Full Results (212 proofs)
|
hanno-becker
approved these changes
Sep 2, 2026
hanno-becker
left a comment
Contributor
There was a problem hiding this comment.
Thank you @mkannwischer for getting to the bottom of this. I agree with the fixes and also tested the script locally, confirming that it does break when proposing invalid explanations for small-digit constants.
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.
No description provided.