lkml.org 
[lkml]   [2022]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] crypto: xor - move __crypto_xor into lib/
Eric Biggers <ebiggers@kernel.org> wrote:
> From: Eric Biggers <ebiggers@google.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@google.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@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

\
 
 \ /
  Last update: 2022-07-15 10:11    [W:0.047 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site