linux/arch/arm64
Eric Biggers 1ca1b91794 crypto: chacha20-generic - refactor to allow varying number of rounds
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>
2018-11-20 14:26:55 +08:00
..
boot ARM: SoC device tree updates for 4.20 2018-10-29 15:05:20 -07:00
configs arm64: defconfig: Enable some IPMI configs 2018-11-02 11:39:50 -07:00
crypto crypto: chacha20-generic - refactor to allow varying number of rounds 2018-11-20 14:26:55 +08:00
include Merge branch 'for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu 2018-11-01 09:27:57 -07:00
kernel arm64 2nd round of updates for 4.20: 2018-11-03 10:55:23 -07:00
kvm KVM updates for v4.20 2018-10-25 17:57:35 -07:00
lib arm64: lib: use C string functions with KASAN enabled 2018-10-26 16:25:18 -07:00
mm arm64: fix warnings without CONFIG_IOMMU_DMA 2018-11-02 19:27:22 +01:00
net bpf, arm64: save 4 bytes in prologue when ebpf insns came from cbpf 2018-05-14 19:11:45 -07:00
xen arm64: mm: Add additional parameter to uaccess_ttbr0_disable 2018-01-17 13:57:49 +01:00
Kconfig mm: remove CONFIG_HAVE_MEMBLOCK 2018-10-31 08:54:15 -07:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Kconfig.platforms ARM: SoC platform updates for 4.20 2018-10-29 15:37:33 -07:00
Makefile arm64 2nd round of updates for 4.20: 2018-11-03 10:55:23 -07:00