Armv8.1-M: Add native x1 Keccak with MVE bit-interleaving#1550
Open
Armv8.1-M: Add native x1 Keccak with MVE bit-interleaving#1550
Conversation
ced77f3 to
32b7252
Compare
ed6f7f0 to
7b867e7
Compare
Add a scalar x1 Keccak permutation to the Armv8.1-M FIPS202 backend, complementing the existing x4 MVE implementation. The assembly is derived from XKCP, with ARMv7-M optimizations by Alexandre Adomnicai (ePrint 2023/773) and further optimizations in the SLOTHY M7 paper by Abdulrahman, Kannwischer, and Lim (ePrint 2025/366). The implementation uses bit-interleaved state representation internally, with C wrapper functions handling the conversion to/from standard representation for now. Optimized xorbytes, and extractbytes (including the bitinterleaving) will be added at a later stage which will allow removing the current bitinterleaving. - Resolves #1506 Co-Authored-By: Brendan Moran <brendan.moran@arm.com> Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Signed-off-by: Brendan Moran <brendan.moran@arm.com>
Signed-off-by: Brendan Moran <brendan.moran@arm.com>
Signed-off-by: Brendan Moran <brendan.moran@arm.com>
Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
7b867e7 to
25cc52f
Compare
Contributor
CBMC Results (ML-KEM-512)
Full Results (153 proofs)
|
Contributor
CBMC Results (ML-KEM-768)
Full Results (153 proofs)
|
Contributor
CBMC Results (ML-KEM-1024)
Full Results (153 proofs)
|
Signed-off-by: Brendan Moran <brendan.moran@arm.com>
Signed-off-by: Brendan Moran <brendan.moran@arm.com>
| void mlk_keccakf1600_extract_bytes(uint64_t *state, unsigned char *data, | ||
| unsigned offset, unsigned length) | ||
| { | ||
| #if defined(MLK_USE_FIPS202_X1_EXTRACT_BYTES_NATIVE) |
Contributor
There was a problem hiding this comment.
We will need a CBMC proof for this branch
| void mlk_keccakf1600_xor_bytes(uint64_t *state, const unsigned char *data, | ||
| unsigned offset, unsigned length) | ||
| { | ||
| #if defined(MLK_USE_FIPS202_X1_XOR_BYTES_NATIVE) |
Contributor
There was a problem hiding this comment.
We will need a CBMC proof for this branch.
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 a scalar x1 Keccak-f1600 permutation to the Armv8.1-M backend, complementing the existing x4 MVE implementation.
Add MVE-accelerated x1 bit-interleaving for
xor_bytesandextract_bytes, replacing the C bit-interleaving wrappers.Fixes Armv8.1-M: Add native Keccak x1 #1506
Fixes Armv8.1-M: Add native bitinterleaving x1 #1508
Benchmarking is needed to evaluate whether xor's up to 8 bytes are faster or slower than pure scalar code.