summaryrefslogtreecommitdiff
path: root/arch/arm64/crypto/aes-ce.S
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-09-10 16:41:15 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2018-09-21 13:24:50 +0800
commit2e5d2f33d1dbd551f14634483c7ea81e5119d689 (patch)
treeea7b3f03c3af0d1e818d588ac2a8e99c391b0826 /arch/arm64/crypto/aes-ce.S
parentdd597fb33ff0d2a158d7dd098be6dc849b7c2bcc (diff)
crypto: arm64/aes-blk - improve XTS mask handling
The Crypto Extension instantiation of the aes-modes.S collection of skciphers uses only 15 NEON registers for the round key array, whereas the pure NEON flavor uses 16 NEON registers for the AES S-box. This means we have a spare register available that we can use to hold the XTS mask vector, removing the need to reload it at every iteration of the inner loop. Since the pure NEON version does not permit this optimization, tweak the macros so we can factor out this functionality. Also, replace the literal load with a short sequence to compose the mask vector. On Cortex-A53, this results in a ~4% speedup. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/arm64/crypto/aes-ce.S')
-rw-r--r--arch/arm64/crypto/aes-ce.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm64/crypto/aes-ce.S b/arch/arm64/crypto/aes-ce.S
index 623e74ed1c67..143070510809 100644
--- a/arch/arm64/crypto/aes-ce.S
+++ b/arch/arm64/crypto/aes-ce.S
@@ -17,6 +17,11 @@
.arch armv8-a+crypto
+ xtsmask .req v16
+
+ .macro xts_reload_mask, tmp
+ .endm
+
/* preload all round keys */
.macro load_round_keys, rounds, rk
cmp \rounds, #12