public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Daniel Palmer <daniel@0x0f.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
	Jason@zx2c4.com, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org, Daniel Palmer <daniel@thingy.jp>
Subject: Re: [PATCH] lib/crypto: blake2s: Disable self test if CONFIG_CRYPTO isn't enabled
Date: Sun, 20 Apr 2025 12:56:57 -0700	[thread overview]
Message-ID: <20250420195657.GA291714@sol.localdomain> (raw)
In-Reply-To: <20250418145945.GA1890@quark.localdomain>

On Fri, Apr 18, 2025 at 07:59:45AM -0700, Eric Biggers wrote:
> On Fri, Apr 18, 2025 at 09:02:16PM +0900, Daniel Palmer wrote:
> > From: Daniel Palmer <daniel@thingy.jp>
> > 
> > Currently CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is used to remove
> > the self test code. CONFIG_CRYPTO_MANAGER_DISABLE_TESTS depends on
> > CONFIG_CRYPTO so its impossible to disable the self test without
> > enabling CONFIG_CRYPTO.
> > 
> > If you don't want CONFIG_CRYPTO you probably don't want self tests
> > so remove the self tests in that case too.
> > 
> > Fixes: 66d7fb94e4ff ("crypto: blake2s - generic C library implementation and selftest")
> > 
> > Signed-off-by: Daniel Palmer <daniel@thingy.jp>
> > ---
> >  lib/crypto/blake2s.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Acked-by: Eric Biggers <ebiggers@kernel.org>
> 
> This is okay as a quick fix, but really the lib/crypto/ tests should be
> refactored into KUnit tests that aren't dependent on CRYPTO.  FWIW, I recently
> fixed this for the CRC functions: lib/tests/crc_kunit.c.
> 

My series "[PATCH 0/9] Clean up the crypto testing options"
(https://lore.kernel.org/r/20250419161543.139344-1-ebiggers@kernel.org/) also
fixes this by replacing CRYPTO_MANAGER_DISABLE_TESTS with a non-negated option.
(But we should still disentangle the library tests from CRYPTO at some point.)

- Eric

      reply	other threads:[~2025-04-20 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18 12:02 [PATCH] lib/crypto: blake2s: Disable self test if CONFIG_CRYPTO isn't enabled Daniel Palmer
2025-04-18 14:59 ` Eric Biggers
2025-04-20 19:56   ` Eric Biggers [this message]

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=20250420195657.GA291714@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=daniel@0x0f.com \
    --cc=daniel@thingy.jp \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --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