Skip to content

Commit f86d17e

Browse files
ebiggersherbertx
authored andcommitted
crypto: arm64/chacha - fix hchacha_block_neon() for big endian
On big endian arm64 kernels, the xchacha20-neon and xchacha12-neon self-tests fail because hchacha_block_neon() outputs little endian words but the C code expects native endianness. Fix it to output the words in native endianness (which also makes it match the arm32 version). Fixes: cc7cf99 ("crypto: arm64/chacha20 - add XChaCha20 support") Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 4b6d196 commit f86d17e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/crypto/chacha-neon-core.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ ENTRY(hchacha_block_neon)
158158
mov w3, w2
159159
bl chacha_permute
160160

161-
st1 {v0.16b}, [x1], #16
162-
st1 {v3.16b}, [x1]
161+
st1 {v0.4s}, [x1], #16
162+
st1 {v3.4s}, [x1]
163163

164164
ldp x29, x30, [sp], #16
165165
ret

0 commit comments

Comments
 (0)