crypto: aegis128/neon - optimize tail block handling
authorArd Biesheuvel <ardb@kernel.org>
Tue, 17 Nov 2020 13:32:12 +0000 (14:32 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 27 Nov 2020 06:13:39 +0000 (17:13 +1100)
commitad00d41b47e6c86f4da61b9812b81cd4cd74be64
tree3f20acb0fb221fbb5731eeed29c55970e149d79f
parent02685906d3afa4f7c72d86cf99242e3b08078865
crypto: aegis128/neon - optimize tail block handling

Avoid copying the tail block via a stack buffer if the total size
exceeds a single AEGIS block. In this case, we can use overlapping
loads and stores and NEON permutation instructions instead, which
leads to a modest performance improvement on some cores (< 5%),
and is slightly cleaner. Note that we still need to use a stack
buffer if the entire input is smaller than 16 bytes, given that
we cannot use 16 byte NEON loads and stores safely in this case.

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-neon-inner.c