Add configs to disable unused APIs#960
Conversation
|
Thanks @flynd. We will need a way to test the configuration options in CI. |
I started looking at this, but the standard examples create a signature and then verifies it. When building without signature creation the example code needs to do something else so I'm not sure what would be appropriate here. |
We already have https://github.com/pq-code-package/mldsa-native/blob/main/examples/basic/expected_signatures.h. This could be extended also with keys, then you could implement keygen, sign, and verify separately. |
e061e08 to
abee80e
Compare
|
@mkannwischer : I've added an example that is pretty close to the actual configuration I'm using (except I omitted MLD_CONFIG_REDUCE_RAM in the example). |
abee80e to
3c6b183
Compare
When building with MLD_CONFIG_SERIAL_FIPS202_ONLY or MLD_CONFIG_REDUCE_RAM, Keccak-f1600x2/x4 is not used and can be skipped. 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>
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>
Provide both keys and signatures as example data so the verify function can be tested without having key generation and signature creation in the same build. Change-Id: I881fc38162c814787c2b13ca48c0b7fd52ff32c7 Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.com>
3c6b183 to
c399012
Compare
|
@mkannwischer: It's been a month. Is there any chance that you might have time to look at this now? Or is there something more that I should try to add to make it easier/better? |
Apologies for the long delay! We've been busy with getting everything ready for our RWC talk. |
Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
8571409 to
3e3f211
Compare
Replace the monolithic_build_verify_native example (which only tested verify-only) with a new disabled_apis example that tests four disabled API combinations (keygen-only, sign-only, verify-only, and sign+verify) across all three parameter sets (44, 65, 87). Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Same as disabled_apis but with native arithmetic and FIPS-202 backends enabled, testing four disabled API combinations across all three parameter sets. Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Also add missing monolithic_build_native entry to the top-level examples README. Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
PCT requires sign+verify internally during keygen for the pairwise consistency test, which conflicts with MLD_CONFIG_NO_SIGN_API and MLD_CONFIG_NO_VERIFY_API. Also add the new examples to the root Makefile clean targets and the --exclude-example choices lists in scripts/tests. Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
93a41ee to
3a2bd94
Compare
Add configs to disable key generation, signature creation, and/or signature verification to reduce the library size when not needing only one or two of these.
Also adds a config to disable all but the internal APIs, allowing for example to build only crypto_sign_verify_internal() and exclude everything else.
Resolves #941