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). |
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>
abee80e to
3c6b183
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