crypto: x86/aegis128 - take advantage of block-aligned len
authorEric Biggers <ebiggers@google.com>
Thu, 17 Oct 2024 00:00:49 +0000 (17:00 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 28 Oct 2024 10:33:10 +0000 (18:33 +0800)
commita0927a03e7be83d7f2b63ce8ee4579b42f87924b
treeada8788842867408091f1b492057cc44faa32ed4
parent933e8974312e348c017c07591bec56677bdfc3dc
crypto: x86/aegis128 - take advantage of block-aligned len

Update a caller of aegis128_aesni_ad() to round down the length to a
block boundary.  After that, aegis128_aesni_ad(), aegis128_aesni_enc(),
and aegis128_aesni_dec() are only passed whole blocks.  Update the
assembly code to take advantage of that, which eliminates some unneeded
instructions.  For aegis128_aesni_enc() and aegis128_aesni_dec(), the
length is also always nonzero, so stop checking for zero length.

Reviewed-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aegis128-aesni-asm.S
arch/x86/crypto/aegis128-aesni-glue.c