Add Armv8.1-M Keccak x1 backend#1277
Draft
bremoran wants to merge 7 commits into
Draft
Conversation
- Port of pq-code-package/mlkem-native#1547 Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
- Port of pq-code-package/mlkem-native#1791 Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Zephyr's k_cycle_get_32() can wrap during long NUCLEO benchmark windows, producing huge unsigned deltas in the benchmark output. Use k_cycle_get_64() for Zephyr targets. Also make ML-DSA benchmark percentile sorting and formatting robust for large uint64_t cycle values. Signed-off-by: Brendan Moran <brendan.moran@arm.com>
Run the NUCLEO-N657X0-Q Zephyr test image as XIP from ITCM and place runtime data/stacks in DTCM after the runner expands FLEXMEM to 256 KiB ITCM and 256 KiB DTCM. Force STM32N6 SystemInit() to use the ITCM vector table address for VTOR. Without this, its fallback derives VTOR from &g_pfnVectors, which moves into DTCM with Zephyr data and points VTOR at RAM data instead of the vector table. Add an early reset hook that scrubs the expanded DTCM window before Zephyr stack, BSS, and MPU setup touch it. Tested: - nix develop .#zephyr --command make run_func EXTRA_MAKEFILE=test/zephyr/platform.mk ZEPHYR_TARGET=mps3-an547 CYCLES=NO -j1 - nix develop .#zephyr --command make run_bench_components EXTRA_MAKEFILE=test/zephyr/platform.mk ZEPHYR_TARGET=nucleo-n657x0-q CYCLES=NO -j1 Signed-off-by: Brendan Moran <brendan.moran@arm.com>
Contributor
CBMC Results (ML-DSA-44)Full Results (206 proofs)
|
Contributor
CBMC Results (ML-DSA-44, REDUCE-RAM)Full Results (206 proofs)
|
Contributor
CBMC Results (ML-DSA-87, REDUCE-RAM)Full Results (206 proofs)
|
Contributor
CBMC Results (ML-DSA-65)Full Results (206 proofs)
|
Contributor
CBMC Results (ML-DSA-65, REDUCE-RAM)Full Results (206 proofs)
|
Contributor
CBMC Results (ML-DSA-87)Full Results (206 proofs)
|
Add the unmodified upstream Adomnicai Armv7-M Keccak source under armv81m_clean and the Slothy-generated M7 optimized x1 permutation under armv81m_opt, with a Makefile regeneration path. Move the Armv8.1-M FIPS202 development sources to armv81m_opt and synchronize the production backend. Route x1 state XOR/extract through the clean-source assembly helpers so the optimized permutation can keep the state in the bit-interleaved native representation. Keep the test changes focused on representation-aware Keccak x1/x4 unit coverage, including extracted-byte state dumps on x1 failures, and the static ML-DSA-87 unit-test workspace needed for Zephyr stack pressure. Signed-off-by: Brendan Moran <brendan.moran@arm.com>
Add the clean Armv81-M Keccak permutation source with the project tri-license header and provenance for the public-domain SLOTHY input. Keep the related generated/autogen/test formatting updates staged with the import. Tests: ZEPHYR_TARGET=mps3-an547 nix develop .#zephyr --command ./scripts/tests func --opt=opt Signed-off-by: Brendan Moran <brendan.moran@arm.com>
Signed-off-by: Brendan Moran <brendan.moran@arm.com>
07b9ec4 to
f875a73
Compare
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.
Add the unmodified upstream Adomnicai Armv7-M Keccak source under armv81m_clean and the Slothy-generated M7 optimized x1 permutation under armv81m_opt, with a Makefile regeneration path.
Move the Armv8.1-M FIPS202 development sources to armv81m_opt and synchronize the production backend. Route x1 state XOR/extract through the clean-source assembly helpers so the optimized permutation can keep the state in the bit-interleaved native representation.
Keep the test changes focused on representation-aware Keccak x1/x4 unit coverage, including extracted-byte state dumps on x1 failures, and the static ML-DSA-87 unit-test workspace needed for Zephyr stack pressure.