Skip to content

Commit

Permalink
crypto: arm64/chacha - fix hchacha_block_neon() for big endian
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Biggers authored and Herbert Xu committed Feb 28, 2019
1 parent 4b6d196 commit f86d17e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm64/crypto/chacha-neon-core.S
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ ENTRY(hchacha_block_neon)
mov w3, w2
bl chacha_permute

st1 {v0.16b}, [x1], #16
st1 {v3.16b}, [x1]
st1 {v0.4s}, [x1], #16
st1 {v3.4s}, [x1]

ldp x29, x30, [sp], #16
ret
Expand Down

0 comments on commit f86d17e

Please sign in to comment.