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)
commit97b70180b7f97224762b63f211305a8052d07960
treeaebcfef38a6a111998052fe206bbf288202c8b8b
parentad00d41b47e6c86f4da61b9812b81cd4cd74be64
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