]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: arm64/aes-blk - improve XTS mask handling
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 10 Sep 2018 14:41:15 +0000 (16:41 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Sep 2018 05:24:50 +0000 (13:24 +0800)
commit8eeb39bd516f2f44bc1725fdb59302e8921d1950
treeea7b3f03c3af0d1e818d588ac2a8e99c391b0826
parent831b284ce6af8b082fed430e32ecb6eb9311092a
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>
arch/arm64/crypto/aes-ce.S
arch/arm64/crypto/aes-modes.S
arch/arm64/crypto/aes-neon.S