Re: [PATCH] crypto: xor - move __crypto_xor into lib/

From: Jason A. Donenfeld
Date: Mon Jul 11 2022 - 11:02:23 EST


Hi Eric,

On Sat, Jul 09, 2022 at 02:54:53PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@xxxxxxxxxx>
>
> CRYPTO_LIB_CHACHA depends on CRYPTO for __crypto_xor, defined in
> crypto/algapi.c. This is a layering violation because the dependencies
> should only go in the other direction (crypto/ => lib/crypto/). Also
> the correct dependency would be CRYPTO_ALGAPI, not CRYPTO. Fix this by
> moving __crypto_xor into lib/xor.c, alongside lib/memneq.c where
> __crypto_memneq was recently moved.
>
> Note that CRYPTO_LIB_CHACHA_GENERIC selected XOR_BLOCKS, which is
> unrelated and unnecessary. It was perhaps thought that XOR_BLOCKS was
> needed for __crypto_xor, but that's not the case.

Oh thank goodness. Excellent! Indeed untangling this knot will be a
large improvement.

Reviewed-by: Jason A. Donenfeld <Jason@xxxxxxxxx>

Jason