Add configs to disable unused APIs [full CI]#1000
Add configs to disable unused APIs [full CI]#1000mkannwischer wants to merge 11 commits intomainfrom
Conversation
CBMC Results (ML-DSA-65)
Full Results (186 proofs)
|
CBMC Results (ML-DSA-44)Full Results (186 proofs)
|
CBMC Results (ML-DSA-87)
Full Results (186 proofs)
|
0e7f1ba to
6b89fae
Compare
6b89fae to
69d203c
Compare
54b3c74 to
ec9c236
Compare
d868b27 to
70be886
Compare
9ac9432 to
dff98f0
Compare
|
@hanno-becker : Any chance this can be approved soon? It's been almost 2 months since the first version of these changes and due to the size I need to do a lot of updates when rebasing onto other changes on main. |
examples/multilevel_build_native/mldsa_native/mldsa_native_config.h
Outdated
Show resolved
Hide resolved
examples/disabled_apis/main.c
Outdated
| @@ -0,0 +1,91 @@ | |||
| /* | |||
There was a problem hiding this comment.
Hmm... why is this a custom example rather than a custom config?
Right now, if I take out-of-the-box mldsa-native and just set MLD_CONFIG_NO_SIGN_API, a plain make fails.
Also, with the current approach we don't exercise a monobuild with reduced config, which would be useful to catch unused functions.
I would prefer custom configurations rather than a custom example here, and adjusting all existing tests and examples to only run those tests which make sense in the chosen configuration. This means make test works out of the box for any valid config, plus we extend coverage to monobuild and multilevel build.
This is currently a blocker to me.
hanno-becker
left a comment
There was a problem hiding this comment.
Apologies for the long silence, and thank you very much for all the work on this, @flynd @mkannwischer!
I support the change in principle, but the build + test story needs more work:
- A plain
make testshould work with any valid config -- right now, it doesn't. The existing tests and examples need adjusting to only exercise the API that is enabled in the config. - Testing the reduced configurations through examples introduces test gaps; e.g., we don't exercise them in monobuilds.
ISTM that we should test this through config variations rather than new examples; this would force/solve both issues above.
3be30c0 to
7449c47
Compare
7449c47 to
aff3b9f
Compare
I had a look at the tests and this looks like a big change since the pattern of creating key, signing, and then verifying the signature will no longer work. As I'm not at all familiar with these tests, I don't know how to contribute such a change. Do either of you have the time to help out with this? If not, could you give some clear hints on how the tests should be modified and maybe I can try to figure it out. I did notice though that there were two commits in the stack that could be merged separately so they are now moved to PRs #1029 and #1032. |
I agree that this would be a major change. Every test and example would have to be changed to use known keys and signatures (and then compare the computed values against the known ones). ACVP would have to be entirely reworked because only parts of the tests would be executed. The KAT tests would be impossible. @hanno-becker, would it be a compromise to get the monobuild tests to work with the new flags, but skip the tests that would require major rework for now and keep the examples instead? In a follow up we can address the skipped tests and eventually remove the examples if they are no longer needed. I think that would be more manageable, address the concern that Unfortunately, I won't have time to help out beyond reviews in the next few weeks. |
This failure is likely unrelated to the changes. It's flaky also in other branches. Going to fix it. |
|
I will take a look and get back to you. |
aff3b9f to
2cdf48a
Compare
8488c55 to
5cb62b8
Compare
|
@flynd @mkannwischer I am having a stab at adjusting the tests. Needs a bit more care for CT but I hope to have it done by the end of the weekend. |
5cb62b8 to
96228a7
Compare
8bac7e8 to
bb5eafc
Compare
bb5eafc to
6109d2d
Compare
Make it possible to exclude key generation when not needed, together with all internal functions not needed for signature creation or verification. Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.com>
Make it possible to exclude signature creation when not needed, together with all internal functions not needed for key generation or signature verification. Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.com>
Make it possible to exclude signature verification when not needed, together with all internal functions not needed for key generation or signature creation. Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.com>
Make it possible to exclude code only used for signature creation or verification. Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.com>
Make it possible to exclude code only used for key generation or verification. Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.com>
Make it possible to exclude code only used for key generation or signature creation. Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.com>
Make it possible to exclude the wrapper APIs if not needed and build only the internal API functions. Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.com>
… APIs The PCT implementation internally calls crypto_sign_signature() and crypto_sign_verify(), so it is incompatible with MLD_CONFIG_NO_SIGN_API and MLD_CONFIG_NO_VERIFY_API. Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Add examples testing four disabled API combinations (keygen-only, sign-only, verify-only, sign+verify) across all three parameter sets. disabled_apis_native additionally enables native arithmetic and FIPS-202 backends. Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Previously, all config variations ran sequentially in a single job, making it hard to identify which variation failed without inspecting the full CI log. This commit splits them into grouped parallel jobs (pct, reduce-ram, custom-hooks, native-cap, asm-fips202, nblocks, reduced-api) so failures are visible from the job summary. Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
6109d2d to
d5ee592
Compare
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
d5ee592 to
84d583b
Compare
Continuation of #960 by @flynd to run full CI.