Armv8.1-M: Add clean x4 Keccak code and SLOTHY Makefile#1527
Open
mkannwischer wants to merge 2 commits into
Open
Armv8.1-M: Add clean x4 Keccak code and SLOTHY Makefile#1527mkannwischer wants to merge 2 commits into
mkannwischer wants to merge 2 commits into
Conversation
c1dfb78 to
bb4c3a4
Compare
Contributor
CBMC Results (ML-KEM-768)Full Results (187 proofs)
|
Contributor
CBMC Results (ML-KEM-512)Full Results (187 proofs)
|
Contributor
CBMC Results (ML-KEM-1024)Full Results (187 proofs)
|
Add the clean (non-optimized) Keccak x4 assembly and Makefile to enable regeneration of the SLOTHY-optimized assembly. Extend autogen --slothy to support new function, and also add --slothy armv81m and --slothy aarch64 group options. Update CI to only run aarch64 SLOTHY targets. Optimization of Armv8.1-M assembly is not currently tested in CI, but has been tested locally. Update SLOTHY to version 0.1.10 as the code requires disabling the address offset fixup which is not supported for Armv8.1-M in the older versionf of SLOTHY. Co-Authored-By: Brendan Moran <brendan.moran@arm.com> Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
bb4c3a4 to
d0a737c
Compare
mkannwischer
commented
Apr 2, 2026
| .global MLK_ASM_NAMESPACE(keccak_f1600_x4_mve_asm) | ||
| MLK_ASM_FN_SYMBOL(keccak_f1600_x4_mve_asm) | ||
|
|
||
| push {r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,lr} |
Contributor
Author
There was a problem hiding this comment.
This actually got changed in #1558 - we should align that once it gets merged.
The x4 MVE Keccak permutation no longer needs to preserve r3 or r12 across the function body, so remove them from the saved core register set in the prologue and epilogue. Update the ABI stack metadata in the symbolic/source assembly and generated mlkem copy to reflect the reduced 228-byte frame. This aligns the x4 implementation with the stack usage expected by #1558. Signed-off-by: Brendan Moran <brendan.moran@arm.com>
| stdenvNoCC.mkDerivation rec { | ||
| pname = "slothy-cli"; | ||
| version = "915c224166207ce07b31152194305c3b6687d09b"; | ||
| version = "0.1.10"; |
Contributor
There was a problem hiding this comment.
Is this still the right version to update to?
Contributor
Author
There was a problem hiding this comment.
No. we should take 0.2.2
Comment on lines
4163
to
+4184
| @@ -4175,6 +4177,11 @@ def _main(): | |||
| "keccak_f1600_x4_v8a_scalar_hybrid_asm", | |||
| "keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm", | |||
| ] | |||
| slothy_armv81m_targets = [ | |||
| "keccak_f1600_x4_mve", | |||
| ] | |||
| slothy_all_targets = slothy_aarch64_targets + slothy_armv81m_targets | |||
| slothy_choices = slothy_all_targets + ["aarch64", "armv81m"] | |||
Contributor
There was a problem hiding this comment.
Can we explicitly prefix the targets with the architecture? E.g. --slothy aarch64/* mve/*?
hanno-becker
requested changes
Jun 14, 2026
hanno-becker
left a comment
Contributor
There was a problem hiding this comment.
We need a CI job which re-runs SLOTHY on the MVE kernel and then runs the baremetal tests.
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 clean (non-optimized) Keccak x4 assembly and Makefile to enable regeneration of the SLOTHY-optimized assembly.
Extend autogen --slothy to support new function, and also add --slothy armv81m and --slothy aarch64 group options. Update CI to only run aarch64 SLOTHY targets.
Optimization of Armv8.1-M assembly is not currently tested in CI, but has been tested locally.
Update SLOTHY to version 0.1.10 as the code requires disabling the address offset fixup which is not supported for Armv8.1-M in the older versionf of SLOTHY.