[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YtEgzHuuMts0YBCz@gondor.apana.org.au>
Date: Fri, 15 Jul 2022 16:09:48 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Eric Biggers <ebiggers@...nel.org>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
Jason@...c4.com
Subject: Re: [PATCH] crypto: xor - move __crypto_xor into lib/
Eric Biggers <ebiggers@...nel.org> wrote:
> From: Eric Biggers <ebiggers@...gle.com>
>
> 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.
>
> Signed-off-by: Eric Biggers <ebiggers@...gle.com>
> ---
> crypto/Kconfig | 1 +
> crypto/algapi.c | 71 --------------------------------------
> lib/Kconfig | 3 ++
> lib/Makefile | 1 +
> lib/crypto/Kconfig | 3 +-
> lib/xor.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++
> 6 files changed, 91 insertions(+), 73 deletions(-)
> create mode 100644 lib/xor.c
Now that there are two of these things (xor and memneq), please
aggregate them into a module (either as separate files linked
together or as a single file) and turn it into a tristate.
They should also be moved into lib/crypto together with their
main users as lib is way too crowded as it is.
We could then revisit that simd variable and move it in too.
Thanks,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists