]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: aegis128/neon - move final tag check to SIMD domain
authorArd Biesheuvel <ardb@kernel.org>
Tue, 17 Nov 2020 13:32:13 +0000 (14:32 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 27 Nov 2020 06:13:40 +0000 (17:13 +1100)
commit216a850f06766435d5f02d9f0da9ff7ffbded30a
treeaebcfef38a6a111998052fe206bbf288202c8b8b
parent592ee1193a4229ce3c6cd284aad4fdcfec338cf3
crypto: aegis128/neon - move final tag check to SIMD domain

Instead of calculating the tag and returning it to the caller on
decryption, use a SIMD compare and min across vector to perform
the comparison. This is slightly more efficient, and removes the
need on the caller's part to wipe the tag from memory if the
decryption failed.

While at it, switch to unsigned int when passing cryptlen and
assoclen - we don't support input sizes where it matters anyway.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Ondrej Mosnacek <omosnacek@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/aegis128-core.c
crypto/aegis128-neon-inner.c
crypto/aegis128-neon.c