summaryrefslogtreecommitdiff
path: root/crypto/aegis.h
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-10-17 21:37:59 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2018-11-09 17:36:48 +0800
commit7ca2159d683b6082b3d177cb3ea4bb340b567718 (patch)
treebf2884abbff5b34e5fc80743f49b343cf2c75ac1 /crypto/aegis.h
parentd38d79bff98d8551b374f9783fd13ef8dc44927b (diff)
downloadlinux-crypto-7ca2159d683b6082b3d177cb3ea4bb340b567718.tar.gz
linux-crypto-7ca2159d683b6082b3d177cb3ea4bb340b567718.zip
crypto: arm/aes - add some hardening against cache-timing attacks
Make the ARM scalar AES implementation closer to constant-time by disabling interrupts and prefetching the tables into L1 cache. This is feasible because due to ARM's "free" rotations, the main tables are only 1024 bytes instead of the usual 4096 used by most AES implementations. On ARM Cortex-A7, the speed loss is only about 5%. The resulting code is still over twice as fast as aes_ti.c. Responsiveness is potentially a concern, but interrupts are only disabled for a single AES block. Note that even after these changes, the implementation still isn't necessarily guaranteed to be constant-time; see https://cr.yp.to/antiforgery/cachetiming-20050414.pdf for a discussion of the many difficulties involved in writing truly constant-time AES software. But it's valuable to make such attacks more difficult. Much of this patch is based on patches suggested by Ard Biesheuvel. Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/aegis.h')
0 files changed, 0 insertions, 0 deletions