mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Elliott, Robert (Servers)" <elliott@hpe.com>
To: David Howells <dhowells@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Eric Biggers <ebiggers@kernel.org>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Petr Pavlu <petr.pavlu@suse.com>,
	Daniel Gomez <da.gomez@kernel.org>,
	Sami Tolvanen <samitolvanen@google.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	Stephan Mueller <smueller@chronox.de>,
	"Lukas Wunner" <lukas@wunner.de>,
	Ignat Korchagin <ignat@cloudflare.com>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"keyrings@vger.kernel.org" <keyrings@vger.kernel.org>,
	"linux-modules@vger.kernel.org" <linux-modules@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v10 5/8] crypto: Add ML-DSA crypto_sig support
Date: Mon, 24 Nov 2025 16:58:36 +0000	[thread overview]
Message-ID: <IA4PR84MB40112676E313F24DCA0D31DFABD0A@IA4PR84MB4011.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <3374841.1763975577@warthog.procyon.org.uk>

> -----Original Message-----
> From: David Howells <dhowells@redhat.com>
> Sent: Monday, November 24, 2025 3:13 AM
> Subject: Re: [PATCH v10 5/8] crypto: Add ML-DSA crypto_sig support
...
> +++ b/crypto/mldsa.c
...
> +static unsigned int crypto_mldsa_key_size(struct crypto_sig *tfm)
> +{
> +	struct crypto_mldsa_ctx *ctx = crypto_sig_ctx(tfm);
> +
> +	switch (ctx->strength) {
> +	case MLDSA44:
> +		return MLDSA44_PUBLIC_KEY_SIZE;
> +	case MLDSA65:
> +		return MLDSA65_PUBLIC_KEY_SIZE;
> +	case MLDSA87:
> +		return MLDSA87_PUBLIC_KEY_SIZE;
> +	default:
> +		WARN_ON_ONCE(1);
> +		return 0;
> +	}
> +}
...
> +static unsigned int crypto_mldsa_max_size(struct crypto_sig *tfm)
> +{
> +	struct crypto_mldsa_ctx *ctx = crypto_sig_ctx(tfm);
> +
> +	switch (ctx->strength) {
> +	case MLDSA44:
> +		return MLDSA44_SIGNATURE_SIZE;
> +	case MLDSA65:
> +		return MLDSA65_SIGNATURE_SIZE;
> +	case MLDSA87:
> +		return MLDSA87_SIGNATURE_SIZE;
> +	default:
> +		WARN_ON_ONCE(1);
> +		return 0;
> +	}

In case there's any way userspace can trigger those, I'd rather
not have any WARN stack dumps.


  parent reply	other threads:[~2025-11-24 16:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 10:44 [PATCH v10 0/8] lib/crypto: Add ML-DSA signing [WIP] David Howells
2025-11-20 10:44 ` [PATCH v10 1/8] lib/crypto: Add ML-DSA verification support David Howells
2025-11-20 10:44 ` [PATCH v10 2/8] lib/crypto: tests: Add KUnit tests for ML-DSA David Howells
2025-11-20 10:44 ` [PATCH v10 3/8] lib/crypto: tests: Add ML-DSA-65 test cases David Howells
2025-11-20 10:44 ` [PATCH v10 4/8] lib/crypto: tests: Add ML-DSA-87 " David Howells
2025-11-20 10:44 ` [PATCH v10 5/8] crypto: Add ML-DSA crypto_sig support David Howells
2025-11-20 10:44 ` [PATCH v10 6/8] pkcs7: Allow the signing algo to calculate the digest itself David Howells
2025-11-20 10:44 ` [PATCH v10 7/8] pkcs7, x509: Add ML-DSA support David Howells
2025-11-20 10:44 ` [PATCH v10 8/8] modsign: Enable ML-DSA module signing David Howells
2025-11-24  9:12 ` [PATCH v10 5/8] crypto: Add ML-DSA crypto_sig support David Howells
2025-11-24 16:49   ` Eric Biggers
2025-11-24 16:58   ` Elliott, Robert (Servers) [this message]
2025-11-24 17:24   ` David Howells
2025-11-24 18:06     ` Jason A. Donenfeld
2025-11-24 19:54     ` David Howells
2025-11-24 20:10       ` Jason A. Donenfeld
2025-11-24 20:27         ` Eric Biggers
2025-11-24 20:43         ` David Howells

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=IA4PR84MB40112676E313F24DCA0D31DFABD0A@IA4PR84MB4011.NAMPRD84.PROD.OUTLOOK.COM \
    --to=elliott@hpe.com \
    --cc=Jason@zx2c4.com \
    --cc=ardb@kernel.org \
    --cc=da.gomez@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=ebiggers@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=ignat@cloudflare.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mcgrof@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=samitolvanen@google.com \
    --cc=smueller@chronox.de \
    /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

all inboxes | Powered by JetHome®