]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: arm64/aes-neon - fix for big endian
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 11 Oct 2016 18:15:18 +0000 (19:15 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Oct 2016 03:03:45 +0000 (11:03 +0800)
commit8b246f209c3c6deb1b7ac4015bc7cd173870130c
tree5f9840591041b66c2b0ad91400b1f13345d86413
parentab1bd5e8f0065e6a2ebca5910fbb75f0872df2cd
crypto: arm64/aes-neon - fix for big endian

The AES implementation using pure NEON instructions relies on the generic
AES key schedule generation routines, which store the round keys as arrays
of 32-bit quantities stored in memory using native endianness. This means
we should refer to these round keys using 4x4 loads rather than 16x1 loads.
In addition, the ShiftRows tables are loading using a single scalar load,
which is also affected by endianness, so emit these tables in the correct
order depending on whether we are building for big endian or not.

Fixes: 21b01675bf87 ("arm64/crypto: AES-ECB/CBC/CTR/XTS using ARMv8 NEON and Crypto Extensions")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm64/crypto/aes-neon.S