Fix Armv8.1-M x4 xor_bytes alignment fallback - #1766
Open
bremoran wants to merge 1 commit into
Open
Conversation
| ((uintptr_t)data3 + byte_prefix)) & | ||
| 3u) != 0u) | ||
| { | ||
| return MLK_NATIVE_FUNC_FALLBACK; |
Contributor
There was a problem hiding this comment.
I don't think we can use fallback here, because the C version it not bit-interleaved?
Armv8.1-M: handle unaligned x4 xor_bytes inputs Avoid using vldrw.u32 for x4 Keccak xor_bytes inputs that are not 32-bit aligned. The aligned path still uses the existing gather-word loads, while unaligned input falls through to a predicated byte-load loop that also handles the final partial lane. Update the prologue byte loads to advance to the next lane start, then perform a single alignment check before choosing the gather-word path. Extend the x4 Keccak unit test to exercise all byte alignments for the input streams. Fixes #1759. Signed-off-by: Brendan Moran <brendan.moran@arm.com>
bremoran
force-pushed
the
issue-1759-armv81m-xor-bytes
branch
from
July 9, 2026 13:09
889857e to
ec577f6
Compare
Contributor
CBMC Results (ML-KEM-512)Full Results (191 proofs)
|
Contributor
CBMC Results (ML-KEM-1024)Full Results (191 proofs)
|
Contributor
CBMC Results (ML-KEM-768)Full Results (191 proofs)
|
Contributor
Author
|
@hanno-becker how does the fix look to you? |
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.
Fixes #1759.
Corrects the xor-bytes unaligned access