crypto: x86/chacha20 - Support partial lengths in 8-block AVX2 variant
authorMartin Willi <martin@strongswan.org>
Sun, 11 Nov 2018 09:36:27 +0000 (10:36 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 16 Nov 2018 06:11:04 +0000 (14:11 +0800)
commitc3b734dd325dadc73c2f5b4d187208730bf21df5
tree1789e2b2e03ffad68be30440b05ee1248b1d5815
parentdb8e15a24957904d10f784a9adc4ea4824ee996c
crypto: x86/chacha20 - Support partial lengths in 8-block AVX2 variant

Add a length argument to the eight block function for AVX2, so the
block function may XOR only a partial length of eight blocks.

To avoid unnecessary operations, we integrate XORing of the first four
blocks in the final lane interleaving; this also avoids some work in
the partial lengths path.

Signed-off-by: Martin Willi <martin@strongswan.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/chacha20-avx2-x86_64.S
arch/x86/crypto/chacha20_glue.c