Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);