]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: arm/aes-neonbs-ctr - deal with non-multiples of AES block size
authorArd Biesheuvel <ardb@kernel.org>
Thu, 27 Jan 2022 11:35:43 +0000 (12:35 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 5 Feb 2022 04:10:51 +0000 (15:10 +1100)
commitb15b4aed2158655f6a73766c66302d92012c1a3d
tree4845e70ee700096733b810eaab6281dc15441e3b
parent5a7e91dda1bc1bf6a876429f3901a9af66105ad4
crypto: arm/aes-neonbs-ctr - deal with non-multiples of AES block size

Instead of falling back to C code to deal with the final bit of input
that is not a round multiple of the block size, handle this in the asm
code, permitting us to use overlapping loads and stores for performance,
and implement the 16-byte wide XOR using a single NEON instruction.

Since NEON loads and stores have a natural width of 16 bytes, we need to
handle inputs of less than 16 bytes in a special way, but this rarely
occurs in practice so it does not impact performance. All other input
sizes can be consumed directly by the NEON asm code, although it should
be noted that the core AES transform can still only process 128 bytes (8
AES blocks) at a time.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm/crypto/aes-neonbs-core.S
arch/arm/crypto/aes-neonbs-glue.c