From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Eric Biggers <ebiggers@kernel.org>
Subject: [PATCH 3/3] lib/crypto: mldsa: Add __must_check to mldsa_verify()
Date: Wed, 28 Oct 2026 22:45:34 -0700 [thread overview]
Message-ID: <20261029054534.68481-4-ebiggers@kernel.org> (raw)
In-Reply-To: <20261029054534.68481-1-ebiggers@kernel.org>
Signature verification status always must be checked. Add __must_check,
for consistency with e.g. the AES-GCM and ChaCha20Poly1305 functions.
No effect on current callers, who always check the return value.
Fixes: 64edccea594c ("lib/crypto: Add ML-DSA verification support")
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
include/crypto/mldsa.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/crypto/mldsa.h b/include/crypto/mldsa.h
index e0754879e7452..b156f166a1413 100644
--- a/include/crypto/mldsa.h
+++ b/include/crypto/mldsa.h
@@ -52,8 +52,9 @@ enum mldsa_alg {
* * -EKEYREJECTED if the signature is invalid but otherwise well-formed
* * -ENOMEM if out of memory so the validity of the signature is unknown
*/
-int mldsa_verify(enum mldsa_alg alg, const u8 *sig, size_t sig_len,
- const u8 *msg, size_t msg_len, const u8 *pk, size_t pk_len);
+int __must_check mldsa_verify(enum mldsa_alg alg, const u8 *sig, size_t sig_len,
+ const u8 *msg, size_t msg_len, const u8 *pk,
+ size_t pk_len);
#if IS_ENABLED(CONFIG_CRYPTO_LIB_MLDSA_KUNIT_TEST)
/* Internal function, exposed only for unit testing */
--
2.56.0
next prev parent reply other threads:[~2026-10-29 5:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 5:45 [PATCH 0/3] lib/crypto: mldsa: Address some minor nits Eric Biggers
2026-10-29 5:45 ` [PATCH 1/3] lib/crypto: mldsa: Check pk_len before doing pointer arithmetic Eric Biggers
2026-10-29 5:45 ` [PATCH 2/3] lib/crypto: mldsa: Explicitly check that 'alg' is a valid value Eric Biggers
2026-10-29 5:45 ` Eric Biggers [this message]
2026-10-29 9:44 ` [PATCH 0/3] lib/crypto: mldsa: Address some minor nits Ard Biesheuvel
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=20261029054534.68481-4-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@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