summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-06-20 13:19:17 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2016-06-23 18:13:58 +0800
commit7ea0da1d75e0d03f9ec484d2038e3caf06024b17 (patch)
treec06c61555e5a6b5af77fa119dbd727e2d14d955f /arch
parentfd2efd93b6fcd981263477298cf1544b46683378 (diff)
downloadlinux-exynos-7ea0da1d75e0d03f9ec484d2038e3caf06024b17.tar.gz
linux-exynos-7ea0da1d75e0d03f9ec484d2038e3caf06024b17.tar.bz2
linux-exynos-7ea0da1d75e0d03f9ec484d2038e3caf06024b17.zip
crypto: chacha20-simd - Use generic code for small requests
On 16-byte requests the optimised version is actually slower than the generic code, so we should simply use that instead. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Cheers,
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/crypto/chacha20_glue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/crypto/chacha20_glue.c b/arch/x86/crypto/chacha20_glue.c
index 2d5c2e0bd939..f910d1d449f0 100644
--- a/arch/x86/crypto/chacha20_glue.c
+++ b/arch/x86/crypto/chacha20_glue.c
@@ -70,7 +70,7 @@ static int chacha20_simd(struct blkcipher_desc *desc, struct scatterlist *dst,
struct blkcipher_walk walk;
int err;
- if (!may_use_simd())
+ if (nbytes <= CHACHA20_BLOCK_SIZE || !may_use_simd())
return crypto_chacha20_crypt(desc, dst, src, nbytes);
state = (u32 *)roundup((uintptr_t)state_buf, CHACHA20_STATE_ALIGN);