FROMGIT: crypto: arm/chacha20 - add XChaCha20 support
authorEric Biggers <ebiggers@google.com>
Sat, 17 Nov 2018 01:26:24 +0000 (17:26 -0800)
committerEric Biggers <ebiggers@google.com>
Wed, 5 Dec 2018 20:30:45 +0000 (12:30 -0800)
commit3d83a028bdbc9586041cb31590f1363b3189923a
treee38771dc784bd6707d4dcbc4f946a0dd3b3c6452
parent1fe9e8ba3f7b9bb062dd284b325839a427fb88a1
FROMGIT: crypto: arm/chacha20 - add XChaCha20 support

Add an XChaCha20 implementation that is hooked up to the ARM NEON
implementation of ChaCha20.  This is needed for use in the Adiantum
encryption mode; see the generic code patch,
"crypto: chacha20-generic - add XChaCha20 support", for more details.

We also update the NEON code to support HChaCha20 on one block, so we
can use that in XChaCha20 rather than calling the generic HChaCha20.
This required factoring the permutation out into its own macro.

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit d97a94309d764ed907d4281da6246f5d935166f8
 https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master)
Bug: 112008522
Test: As series, see Ic61c13b53facfd2173065be715a7ee5f3af8760b
Change-Id: I84c3a019e22598f8f8eb25e7a0fefbc79c9660c9
Signed-off-by: Eric Biggers <ebiggers@google.com>
arch/arm/crypto/Kconfig
arch/arm/crypto/chacha20-neon-core.S
arch/arm/crypto/chacha20-neon-glue.c