summaryrefslogtreecommitdiff
path: root/crypto/twofish_common.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2019-07-03 11:55:09 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-07-26 08:03:57 +0300
commit521cdde758bf331d4e264ef3deef5a26d5ce0b4f (patch)
treef356195f6c5753583c26d4d3512bc88508ae64ef /crypto/twofish_common.c
parent368b1bdc0a5983c8c908ce2001229e2291eac583 (diff)
downloadlinux-521cdde758bf331d4e264ef3deef5a26d5ce0b4f.tar.xz
crypto: aegis - avoid prerotated AES tables
The generic AES code provides four sets of lookup tables, where each set consists of four tables containing the same 32-bit values, but rotated by 0, 8, 16 and 24 bits, respectively. This makes sense for CISC architectures such as x86 which support memory operands, but for other architectures, the rotates are quite cheap, and using all four tables needlessly thrashes the D-cache, and actually hurts rather than helps performance. Since x86 already has its own implementation of AEGIS based on AES-NI instructions, let's tweak the generic implementation towards other architectures, and avoid the prerotated tables, and perform the rotations inline. On ARM Cortex-A53, this results in a ~8% speedup. Acked-by: Ondrej Mosnacek <omosnace@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/twofish_common.c')
0 files changed, 0 insertions, 0 deletions