linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] lib/crypto: ML-DSA verification support
@ 2025-12-03  7:28 Eric Biggers
  2025-12-03  7:28 ` [PATCH v3 1/2] lib/crypto: Add " Eric Biggers
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Eric Biggers @ 2025-12-03  7:28 UTC (permalink / raw)
  To: linux-crypto, David Howells
  Cc: Herbert Xu, Eric Biggers, Luis Chamberlain, Petr Pavlu,
	Daniel Gomez, Sami Tolvanen, Jason A . Donenfeld, Ard Biesheuvel,
	Stephan Mueller, Lukas Wunner, Ignat Korchagin, keyrings,
	linux-modules, linux-kernel

This series can also be retrieved from:

    git fetch https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git mldsa-v3

This series adds support for verifying ML-DSA signatures to lib/crypto/.
Patch 1 is the ML-DSA implementation itself.  See that for full details.
Patch 2 adds the KUnit test suite.

The initial use case for this will be kernel module signature
verification.  For more details, see David Howells' patchset
https://lore.kernel.org/linux-crypto/20251120104439.2620205-1-dhowells@redhat.com/

Changed in v3:
- Moved SHAKE128 block buffer off the stack
- Reworked use_hint() again, simplifying it further
- Added unit test for use_hint()
- Moved some of the reduction logic into invntt_and_mul_2_32() and
  simplified it slightly
- Updated Zq_mult() to not rely on signed integer overflow having
  defined behavior, though this is unnecessary in the kernel
- Formatted the documented return values into a list
- Other minor tweaks

Changed in v2:
- Reworked the KUnit test suite
- Improved commit messages and comments
- Added missing MODULE_DESCRIPTION() and MODULE_LICENSE()
- Made the return values of mldsa_verify() differentiate between an
  input being malformed and the "real" signature check failing
- Refactored w1 encoding into a helper function
- Used kfree() instead of kfree_sensitive()
- Avoided unusal C syntax by accessing the hint vector via 'u8 *'
- Reworked use_hint() to be better optimized and documented

Eric Biggers (2):
  lib/crypto: Add ML-DSA verification support
  lib/crypto: tests: Add KUnit tests for ML-DSA verification

 include/crypto/mldsa.h            |   60 +
 lib/crypto/Kconfig                |    7 +
 lib/crypto/Makefile               |    5 +
 lib/crypto/mldsa.c                |  652 ++++++++++
 lib/crypto/tests/Kconfig          |    9 +
 lib/crypto/tests/Makefile         |    1 +
 lib/crypto/tests/mldsa-testvecs.h | 1887 +++++++++++++++++++++++++++++
 lib/crypto/tests/mldsa_kunit.c    |  437 +++++++
 8 files changed, 3058 insertions(+)
 create mode 100644 include/crypto/mldsa.h
 create mode 100644 lib/crypto/mldsa.c
 create mode 100644 lib/crypto/tests/mldsa-testvecs.h
 create mode 100644 lib/crypto/tests/mldsa_kunit.c


base-commit: 3f9f0252130e7dd60d41be0802bf58f6471c691d
-- 
2.52.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-12-03 17:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-03  7:28 [PATCH v3 0/2] lib/crypto: ML-DSA verification support Eric Biggers
2025-12-03  7:28 ` [PATCH v3 1/2] lib/crypto: Add " Eric Biggers
2025-12-03  7:28 ` [PATCH v3 2/2] lib/crypto: tests: Add KUnit tests for ML-DSA verification Eric Biggers
2025-12-03  9:01 ` David Howells
2025-12-03 17:43   ` Eric Biggers
2025-12-03 10:09 ` [PATCH v3 0/2] lib/crypto: ML-DSA verification support David Howells
2025-12-03 14:19 ` Harald Freudenberger
2025-12-03 14:40 ` David Howells

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).