Commit 7ea0da1d authored by Herbert Xu's avatar Herbert Xu

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: default avatarHerbert Xu <herbert@gondor.apana.org.au>

Cheers,
parent fd2efd93
...@@ -70,7 +70,7 @@ static int chacha20_simd(struct blkcipher_desc *desc, struct scatterlist *dst, ...@@ -70,7 +70,7 @@ static int chacha20_simd(struct blkcipher_desc *desc, struct scatterlist *dst,
struct blkcipher_walk walk; struct blkcipher_walk walk;
int err; int err;
if (!may_use_simd()) if (nbytes <= CHACHA20_BLOCK_SIZE || !may_use_simd())
return crypto_chacha20_crypt(desc, dst, src, nbytes); return crypto_chacha20_crypt(desc, dst, src, nbytes);
state = (u32 *)roundup((uintptr_t)state_buf, CHACHA20_STATE_ALIGN); state = (u32 *)roundup((uintptr_t)state_buf, CHACHA20_STATE_ALIGN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment