summaryrefslogtreecommitdiffstats
path: root/lib/ucs2_string.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2019-07-03 10:55:09 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2019-07-26 15:03:57 +1000
commit521cdde758bf331d4e264ef3deef5a26d5ce0b4f (patch)
treef356195f6c5753583c26d4d3512bc88508ae64ef /lib/ucs2_string.c
parent368b1bdc0a5983c8c908ce2001229e2291eac583 (diff)
downloadlinux-521cdde758bf331d4e264ef3deef5a26d5ce0b4f.tar.bz2
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 'lib/ucs2_string.c')
0 files changed, 0 insertions, 0 deletions