Make tests and examples compatible with reduced-API configurations - #1787
Open
hanno-becker wants to merge 3 commits into
Open
Make tests and examples compatible with reduced-API configurations#1787hanno-becker wants to merge 3 commits into
hanno-becker wants to merge 3 commits into
Conversation
hanno-becker
commented
Jul 6, 2026
Contributor
Contributor
CBMC Results (ML-KEM-512)Full Results (191 proofs)
|
Contributor
CBMC Results (ML-KEM-768)Full Results (191 proofs)
|
Contributor
CBMC Results (ML-KEM-1024)
Full Results (191 proofs)
|
hanno-becker
force-pushed
the
unused_apis
branch
5 times, most recently
from
July 8, 2026 09:40
abfdabf to
8794d26
Compare
hanno-becker
marked this pull request as ready for review
July 8, 2026 12:40
hanno-becker
marked this pull request as draft
July 8, 2026 12:40
hanno-becker
force-pushed
the
unused_apis
branch
3 times, most recently
from
July 14, 2026 14:53
ef7eb6d to
bc56136
Compare
hanno-becker
force-pushed
the
unused_apis
branch
from
July 22, 2026 14:57
bc56136 to
39e8b04
Compare
hanno-becker
marked this pull request as ready for review
July 23, 2026 04:06
hanno-becker
force-pushed
the
unused_apis
branch
4 times, most recently
from
July 24, 2026 08:11
d23daba to
2d30400
Compare
mkannwischer
requested changes
Jul 24, 2026
mkannwischer
left a comment
Contributor
There was a problem hiding this comment.
Thanks @hanno-becker for implementing this feature and aligning with mlkem-native.
CI isn't quite happy yet.
hanno-becker
force-pushed
the
unused_apis
branch
2 times, most recently
from
July 25, 2026 08:21
4385b2b to
bc32bf8
Compare
hanno-becker
force-pushed
the
unused_apis
branch
2 times, most recently
from
July 27, 2026 05:58
be70cad to
a9ebd9a
Compare
Add MLK_CONFIG_NO_KEYPAIR_API, MLK_CONFIG_NO_ENCAPS_API and MLK_CONFIG_NO_DECAPS_API, and guard public and internal APIs accordingly. Generate deterministic KEM vectors so tests and examples can exercise each enabled operation independently. Adapt ACVP, Wycheproof, allocation, RNG failure and stack tests to reduced builds; stack analysis measures only enabled APIs. Cover all non-empty reduced API combinations in CI. Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
The previous encapDecap-file gate only loaded the file when all four sub-functions (encapsulation, decapsulation, encapsulationKeyCheck, decapsulationKeyCheck) were compiled in. Under encaps-only, decaps-only, keygen-encaps, and keygen-decaps configurations that skipped the entire prompt file, so ACVP reported OK while driving zero test cases through the binary. This commit intead loads the encapDecap file whenever _any_ of its sub-functions are supported, and drops unsupported test cases via a filter that mutates both the prompt and the expectedResults data consistently. This mirrors the filter_test_cases machinery introduced for the same reason in mldsa-native (PR #1140). Reduced-API runs also now emit a labelled stderr summary block after "ALL GOOD!" for both whole-prompt skips and per-test drops, so coverage gaps aren't buried in scrollback. Full-API runs stay silent. Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
The test vectors added in the last commit lead to a stack overflow on AVR for ML-KEM-1024. This commit ports the AVR setup from mldsa-native, including its increase in RAM to nearly 64K. This fixes the AVR test, and also makes future maintenance of the AVR backend across mlkem-native and mldsa-native simpler. - nix/avr: RAMEND 0x81FF -> 0xFFFF, EEPROM E2END 0x3FFF -> 0x7FFF - platform.mk: __stack=0x81FF -> __DATA_REGION_LENGTH__=0xFC00, so .data/.bss grow up from 0x0200 with the stack set at runtime - avr_wrapper.c / init7.S / exec_wrapper.py: place the argc/argv block at the top of RAM and set SP just below it, giving the largest possible stack Keeping this identical (modulo naming) to mldsa-native lets both projects share one AVR baremetal harness, so fixes port across as a prefix diff. Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
hanno-becker
force-pushed
the
unused_apis
branch
from
July 28, 2026 04:02
a9ebd9a to
faa87c7
Compare
Contributor
Author
|
@mkannwischer Thank you for your review, I believe I have addressed your feedback. Can you re-review? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.