]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: arm64/gcm - move authentication tag check to SIMD domain
authorArd Biesheuvel <ardb@kernel.org>
Tue, 10 Nov 2020 09:10:42 +0000 (10:10 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 20 Nov 2020 03:45:32 +0000 (14:45 +1100)
commit6aa12968b3989be12b90ee844447f0b06f3df240
treeae5d8b21d02aab542d2040e79e69b9cb7ecf0301
parent79f3e3ea1387c6421d922bac9e694c818c52c728
crypto: arm64/gcm - move authentication tag check to SIMD domain

Instead of copying the calculated authentication tag to memory and
calling crypto_memneq() to verify it, use vector bytewise compare and
min across vector instructions to decide whether the tag is valid. This
is more efficient, and given that the tag is only transiently held in a
NEON register, it is also safer, given that calculated tags for failed
decryptions should be withheld.

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