mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
1ca1b91794
In preparation for adding XChaCha12 support, rename/refactor chacha20-generic to support different numbers of rounds. The justification for needing XChaCha12 support is explained in more detail in the patch "crypto: chacha - add XChaCha12 support". The only difference between ChaCha{8,12,20} are the number of rounds itself; all other parts of the algorithm are the same. Therefore, remove the "20" from all definitions, structures, functions, files, etc. that will be shared by all ChaCha versions. Also make ->setkey() store the round count in the chacha_ctx (previously chacha20_ctx). The generic code then passes the round count through to chacha_block(). There will be a ->setkey() function for each explicitly allowed round count; the encrypt/decrypt functions will be the same. I decided not to do it the opposite way (same ->setkey() function for all round counts, with different encrypt/decrypt functions) because that would have required more boilerplate code in architecture-specific implementations of ChaCha and XChaCha. Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Martin Willi <martin@strongswan.org> 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 | ||
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 | ||
sm4-ce-core.S | ||
sm4-ce-glue.c |