Skip to content

lib/crypto: ML-DSA verification support

Eric Biggers keyrings linux-crypto linux-kselftest linux-modules lkml 4 versions – Applied

Status from this message: Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-next

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 4 repliesApplied
  2. v32 patches 5 repliesSuperseded
  3. v22 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches22 repliesSuperseded

Changes in v4 from the cover letter

- Added missing MODULE_IMPORT_NS() to fix build error when building the KUnit test suite as a loadable module
- Added David's Reviewed-by and Tested-by
- Clarified a comment slightly
- Rebased onto v6.19-rc1

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/2lib/crypto: Add ML-DSA verification supportinclude/crypto/mldsa.h lib/crypto/Kconfig lib/crypto/Makefile +1 more+724 -00 replies
2/2lib/crypto: tests: Add KUnit tests for ML-DSA verificationlib/crypto/tests/Kconfig lib/crypto/tests/Makefile lib/crypto/tests/mldsa-testvecs.h +1 more+2335 -03 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchDavid Howells
1/2R-b T-b
2/2R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] lib/crypto: ML-DSA verification support

This series can also be retrieved from:

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

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/[email protected]/

Note: I'm planning to apply this to libcrypto-next for 6.20.

Changed in v4:
- Added missing MODULE_IMPORT_NS() to fix build error when building the KUnit test suite as a loadable module
- Added David's Reviewed-by and Tested-by
- Clarified a comment slightly
- Rebased onto v6.19-rc1

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    |  438 +++++++
 8 files changed, 3059 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: 8f0b4cce4481fb22653697cced8d0d04027cb1e8

Signature · 1 line
2.52.0