From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
ardb@kernel.org
Subject: Re: [PATCH v3 2/3] crypto: lib - move __crypto_xor into utils
Date: Tue, 26 Jul 2022 00:09:33 +0200 [thread overview]
Message-ID: <Yt8UnWCvoe8dKihc@zx2c4.com> (raw)
In-Reply-To: <20220725183636.97326-3-ebiggers@kernel.org>
On Mon, Jul 25, 2022 at 11:36:35AM -0700, Eric Biggers 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 the utils module in lib/crypto/.
>
> 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>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
With one small question:
> --- /dev/null
> +++ b/lib/crypto/utils.c
> @@ -0,0 +1,88 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Crypto library utility functions
> + *
> + * Copyright (c) 2006 Herbert Xu <herbert@gondor.apana.org.au>
Didn't Ard basically write the crypto_xor function in its current form?
I seem to remember some pretty hardcore refactoring he did a while back.
Jason
next prev parent reply other threads:[~2022-07-25 22:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-25 18:36 [PATCH v3 0/3] crypto: lib - create utils module Eric Biggers
2022-07-25 18:36 ` [PATCH v3 1/3] crypto: lib - create utils module and move __crypto_memneq into it Eric Biggers
2022-07-25 22:10 ` Jason A. Donenfeld
2022-07-25 18:36 ` [PATCH v3 2/3] crypto: lib - move __crypto_xor into utils Eric Biggers
2022-07-25 22:09 ` Jason A. Donenfeld [this message]
2022-07-26 1:00 ` Eric Biggers
2022-07-26 13:46 ` Ard Biesheuvel
2022-08-26 4:44 ` Eric Biggers
2022-08-26 4:46 ` Herbert Xu
2022-08-26 4:48 ` Eric Biggers
2022-08-26 4:52 ` Herbert Xu
2022-08-26 5:07 ` Eric Biggers
2022-07-25 18:36 ` [PATCH v3 3/3] crypto: lib - remove __HAVE_ARCH_CRYPTO_MEMNEQ Eric Biggers
2022-07-25 22:07 ` Jason A. Donenfeld
2022-07-26 0:51 ` Eric Biggers
2022-08-19 10:59 ` [PATCH v3 0/3] crypto: lib - create utils module Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yt8UnWCvoe8dKihc@zx2c4.com \
--to=jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=ebiggers@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).