mirror of
https://github.com/torvalds/linux.git
synced 2024-11-19 10:31:48 +00:00
91a2abb78f
Add a NEON-accelerated implementation of Speck128-XTS and Speck64-XTS for ARM64. This is ported from the 32-bit version. It may be useful on devices with 64-bit ARM CPUs that don't have the Cryptography Extensions, so cannot do AES efficiently -- e.g. the Cortex-A53 processor on the Raspberry Pi 3. It generally works the same way as the 32-bit version, but there are some slight differences due to the different instructions, registers, and syntax available in ARM64 vs. in ARM32. For example, in the 64-bit version there are enough registers to hold the XTS tweaks for each 128-byte chunk, so they don't need to be saved on the stack. Benchmarks on a Raspberry Pi 3 running a 64-bit kernel: Algorithm Encryption Decryption --------- ---------- ---------- Speck64/128-XTS (NEON) 92.2 MB/s 92.2 MB/s Speck128/256-XTS (NEON) 75.0 MB/s 75.0 MB/s Speck128/256-XTS (generic) 47.4 MB/s 35.6 MB/s AES-128-XTS (NEON bit-sliced) 33.4 MB/s 29.6 MB/s AES-256-XTS (NEON bit-sliced) 24.6 MB/s 21.7 MB/s The code performs well on higher-end ARM64 processors as well, though such processors tend to have the Crypto Extensions which make AES preferred. For example, here are the same benchmarks run on a HiKey960 (with CPU affinity set for the A73 cores), with the Crypto Extensions implementation of AES-256-XTS added: Algorithm Encryption Decryption --------- ----------- ----------- AES-256-XTS (Crypto Extensions) 1273.3 MB/s 1274.7 MB/s Speck64/128-XTS (NEON) 359.8 MB/s 348.0 MB/s Speck128/256-XTS (NEON) 292.5 MB/s 286.1 MB/s Speck128/256-XTS (generic) 186.3 MB/s 181.8 MB/s AES-128-XTS (NEON bit-sliced) 142.0 MB/s 124.3 MB/s AES-256-XTS (NEON bit-sliced) 104.7 MB/s 91.1 MB/s Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> |
||
---|---|---|
.. | ||
.gitignore | ||
aes-ce-ccm-core.S | ||
aes-ce-ccm-glue.c | ||
aes-ce-core.S | ||
aes-ce-glue.c | ||
aes-ce-setkey.h | ||
aes-ce.S | ||
aes-cipher-core.S | ||
aes-cipher-glue.c | ||
aes-ctr-fallback.h | ||
aes-glue.c | ||
aes-modes.S | ||
aes-neon.S | ||
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-ce-core.S | ||
sha1-ce-glue.c | ||
sha2-ce-core.S | ||
sha2-ce-glue.c | ||
sha3-ce-core.S | ||
sha3-ce-glue.c | ||
sha256-core.S_shipped | ||
sha256-glue.c | ||
sha512-armv8.pl | ||
sha512-ce-core.S | ||
sha512-ce-glue.c | ||
sha512-core.S_shipped | ||
sha512-glue.c | ||
sm3-ce-core.S | ||
sm3-ce-glue.c | ||
speck-neon-core.S | ||
speck-neon-glue.c |