Unit-test: add consistency tests for mld_poly_uniform*_x1/x4#855
Open
Unit-test: add consistency tests for mld_poly_uniform*_x1/x4#855
Conversation
3a853f7 to
a975d7a
Compare
mkannwischer
requested changes
Jan 8, 2026
Contributor
mkannwischer
left a comment
There was a problem hiding this comment.
Thanks @willieyz. I have a couple of suggestions.
2866476 to
6a5614d
Compare
mkannwischer
requested changes
Jan 8, 2026
Contributor
mkannwischer
left a comment
There was a problem hiding this comment.
Almost good. Thanks @willieyz!
6a5614d to
341a4ed
Compare
mkannwischer
approved these changes
Jan 9, 2026
Contributor
mkannwischer
left a comment
There was a problem hiding this comment.
Thanks @willieyz for the changes. I'm happy with it now.
@hanno-becker, could you please take a look if you are fine with the MLD_UNIT_TEST approach?
909f339 to
ef40b2a
Compare
In mldsa-native, there are three functions that have both scalar and 4-way batched variants: - mld_poly_uniform_gamma1 / mld_poly_uniform_gamma1_4x - mld_poly_uniform_eta / mld_poly_uniform_eta_4x - mld_poly_uniform / mld_poly_uniform_4x For each of the above pairs, this commit implements consistency test functions in test_unit.c that compare the outputs of the scalar and 4-way batched variants. For mld_poly_uniform_eta and mld_poly_uniform_eta_4x, the two variants are not defined under the same compilation conditions in poly_kl.h. To enable testing both variants, this commit introduces a new macro: MLD_UNIT_TEST which is made available in test_unit.c to override the conditional compilation and allow both implementations to be exercised in the unit tests. Signed-off-by: willieyz <willie.zhao@chelpis.com>
29dad99 to
1207f97
Compare
Contributor
CBMC Results (ML-DSA-44)Full Results (173 proofs)
|
Contributor
CBMC Results (ML-DSA-65)
Full Results (173 proofs)
|
Contributor
CBMC Results (ML-DSA-87)
Full Results (173 proofs)
|
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.
This PR adds consistency tests to test_unit.c to verify that the scalar and 4-way batched implementations produce identical results.
In mldsa-native, there are three functions that provide both scalar and 4-way batched variants:
For each of the above pairs, this PR implements consistency test functions in test_unit.c that compare the outputs of the scalar and 4-way batched variants.
For mld_poly_uniform_eta and mld_poly_uniform_eta_4x, the two variants are not defined under the same compilation conditions in poly_kl.h. To enable testing both variants, this PR introduces a new macro,
MLD_UNIT_TEST, which is made available intest_unit.cto override the conditional compilation and allow both implementations to be exercised in the unit tests.