Add configs to disable unused APIs [full CI]#1000
Add configs to disable unused APIs [full CI]#1000mkannwischer wants to merge 13 commits intomainfrom
Conversation
CBMC Results (ML-DSA-65)Full Results (184 proofs)
|
CBMC Results (ML-DSA-44)
Full Results (184 proofs)
|
CBMC Results (ML-DSA-87)Full Results (184 proofs)
|
0e7f1ba to
6b89fae
Compare
6b89fae to
69d203c
Compare
54b3c74 to
ec9c236
Compare
d868b27 to
70be886
Compare
Only one table is used for each parameter set, so add conditions to remove the unused table from non-shared builds. Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.com>
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>
d48354d to
9ac9432
Compare
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>
When building with MLD_CONFIG_REDUCE_RAM and only verifying or with MLD_CONFIG_SERIAL_FIPS202_ONLY, Keccak-f1600x2/x4 is not used and can be skipped. Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.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>
Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.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>
Match the AArch64 behavior and skip the native Keccak-f1600x4 backend when MLD_CONFIG_SERIAL_FIPS202_ONLY or MLD_CONFIG_REDUCE_RAM is set. Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
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. |
| /****************************************************************************** | ||
| * Name: MLD_CONFIG_INTERNAL_API_ONLY | ||
| * | ||
| * Description: Set this to remove all public APIs except | ||
| * crypto_sign_keypair_internal, crypto_sign_signature_internal, | ||
| * and crypto_sign_verify_internal. | ||
| * | ||
| *****************************************************************************/ | ||
| /* #define MLD_CONFIG_INTERNAL_API_ONLY */ |
There was a problem hiding this comment.
The name of this option is confusing because it overlaps with the use of "internal API" for internal functions of external linkage.
Suggestion: MLD_CONFIG_CORE_API_ONLY
| @@ -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.
Continuation of #960 by @flynd to run full CI.