-
Notifications
You must be signed in to change notification settings - Fork 34
Unit-test: add consistency tests for mld_poly_uniform*_x1/x4 #855
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
base: main
Are you sure you want to change the base?
Conversation
3a853f7 to
a975d7a
Compare
mkannwischer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @willieyz. I have a couple of suggestions.
2866476 to
6a5614d
Compare
mkannwischer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost good. Thanks @willieyz!
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 <[email protected]>
6a5614d to
341a4ed
Compare
mkannwischer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
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.