mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-17 23:36:49 +07:00
913a3aa07d
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> |
||
---|---|---|
.. | ||
.gitignore | ||
aes-ce-core.S | ||
aes-ce-glue.c | ||
aes-cipher-core.S | ||
aes-cipher-glue.c | ||
aes-neonbs-core.S | ||
aes-neonbs-glue.c | ||
chacha20-neon-core.S | ||
chacha20-neon-glue.c | ||
crc32-ce-core.S | ||
crc32-ce-glue.c | ||
crct10dif-ce-core.S | ||
crct10dif-ce-glue.c | ||
ghash-ce-core.S | ||
ghash-ce-glue.c | ||
Kconfig | ||
Makefile | ||
sha1_glue.c | ||
sha1_neon_glue.c | ||
sha1-armv4-large.S | ||
sha1-armv7-neon.S | ||
sha1-ce-core.S | ||
sha1-ce-glue.c | ||
sha1.h | ||
sha2-ce-core.S | ||
sha2-ce-glue.c | ||
sha256_glue.c | ||
sha256_glue.h | ||
sha256_neon_glue.c | ||
sha256-armv4.pl | ||
sha256-core.S_shipped | ||
sha512-armv4.pl | ||
sha512-core.S_shipped | ||
sha512-glue.c | ||
sha512-neon-glue.c | ||
sha512.h |