ML-DSA: Support (re-)generating MlDsaPrivate from seed#89
Open
mjdemilliano wants to merge 2 commits intowolfSSL:masterfrom
Open
ML-DSA: Support (re-)generating MlDsaPrivate from seed#89mjdemilliano wants to merge 2 commits intowolfSSL:masterfrom
mjdemilliano wants to merge 2 commits intowolfSSL:masterfrom
Conversation
As specified in FIPS 204, implementations can store the seed from which the key can be deterministically generated.
Member
|
@mjdemilliano is an approved contributor |
There was a problem hiding this comment.
Pull request overview
Adds support for deterministic ML-DSA private key regeneration from a persisted seed (per FIPS 204), by exposing a new seed-based keygen API through the Python bindings and validating it via tests.
Changes:
- Add
MlDsaPrivate.make_key_from_seed()API and seed-length constant. - Expose
wc_dilithium_make_key_from_seed()in the CFFI build definitions. - Add unit test covering deterministic regeneration and basic seed validation behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
wolfcrypt/ciphers.py |
Introduces MlDsaPrivate.make_key_from_seed() and a seed length constant for deterministic ML-DSA key generation. |
tests/test_mldsa.py |
Adds a test that generates keys from a seed, signs/verifies, and checks deterministic regeneration. |
scripts/build_ffi.py |
Extends the ML-DSA CFFI cdefs to include wc_dilithium_make_key_from_seed(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Move+rename constant for seed length and use it in test_mldsa - Replace assert by raising TypeError and ValueError in make_key_from_seed, and change type check to use memoryview.
dgarske
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As specified in FIPS 204, implementations can store the seed from which the key can be deterministically generated.