-
Notifications
You must be signed in to change notification settings - Fork 57
Add ML-DSA Signing Implementation #596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bbug96-crkim
wants to merge
2
commits into
sigstore:main
Choose a base branch
from
bbug96-crkim:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Implement ML-DSA (FIPS 204) post-quantum cryptographic signatures for model signing, providing quantum-resistant security. This adds complete CLI integration, password-protected key encryption, and comprehensive testing infrastructure. ML-DSA (Module Lattice Digital Signature Algorithm) is a NIST- standardized post-quantum signature scheme that provides security against both classical and quantum computer attacks. This implementation supports all three security levels (ML_DSA_44, ML_DSA_65, ML_DSA_87) corresponding to NIST security levels 2, 3, and 5. The implementation addresses the need for long-term security in model signing as quantum computers become more capable. While ML-DSA signatures are larger than traditional ECDSA signatures (~3-5KB vs ~70 bytes), this is an acceptable tradeoff for quantum resistance. Core Implementation: - Add sign_ml_dsa.py module with Signer and Verifier classes - Implement AES-256-GCM encryption for private key protection - Add PBKDF2-HMAC-SHA256 key derivation (100,000 iterations) - Auto-detect encrypted vs raw private keys - Support all three ML-DSA security variants (44/65/87) CLI Integration: - Add 'sign ml-dsa' command with --password and --variant options - Add 'verify ml-dsa' command with variant support - Integrate with existing ignore-paths and hashing config Key Management: - Add ml_dsa_key_tool.py utility for key encryption/decryption - Support encrypted key format with 56-byte overhead - Provide key verification functionality Testing: - Add 7 integration tests in api_test.py covering all scenarios - Add 8 CLI tests in cli_ml_dsa_test.py - Add shell test scripts for all variants and version compatibility - Generate test keys and pre-signed test data - Achieve 100% test pass rate across all test suites Documentation: - Add ml_dsa_examples.md with 750+ line comprehensive guide - Add ml_dsa_implementation.md with technical details - Add ml_dsa_testing.md for test infrastructure - Update README.md with post-quantum cryptography section - Document password protection and security levels Files Added: - src/model_signing/_signing/sign_ml_dsa.py (391 lines) - tests/cli_ml_dsa_test.py (427 lines, 8 tests) - tests/_signing/sign_ml_dsa_test.py - scripts/ml_dsa_key_tool.py (180 lines) - scripts/tests/test-sign-verify-ml-dsa.sh (176 lines) - scripts/tests/test-verify-v1.1.0-ml-dsa.sh - docs/ml_dsa_examples.md (750+ lines) - docs/ml_dsa_implementation.md - docs/ml_dsa_testing.md - scripts/tests/keys/ml-dsa/ (test keys) - scripts/tests/v1.1.0-ml-dsa/ (test data) Files Modified: - src/model_signing/_cli.py (+161 lines) - src/model_signing/signing.py (add use_ml_dsa_signer) - src/model_signing/verifying.py (add use_ml_dsa_verifier) - tests/api_test.py (+270 lines, TestMLDSASigning class) - README.md (add post-quantum section) - scripts/tests/test-sign-verify-allversions.sh (add ML-DSA) Dependencies: - dilithium-py: ML-DSA implementation - cryptography: AES-GCM encryption Breaking Changes: None - purely additive changes Performance Impact: ML-DSA signatures are larger (2-5KB) and slower to generate/verify than ECDSA, but provide quantum resistance. Security Notes: - Private keys can be encrypted with AES-256-GCM - Key derivation uses PBKDF2 with 100,000 iterations - Signature sizes: ML_DSA_44 (~2.4KB), ML_DSA_65 (~3.3KB), ML_DSA_87 (~4.6KB) Signed-off-by: chungrae.kim <[email protected]>
Signed-off-by: chungrae.kim <[email protected]>
bbug96-crkim
commented
Jan 7, 2026
Author
bbug96-crkim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed
Author
|
@sigstore/model-transparency-codeowners |
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.
Description
This PR implements ML-DSA (Module Lattice Digital Signature Algorithm) post-quantum cryptographic signatures for model signing, providing quantum-resistant security standardized as NIST FIPS 204. Additionally, it includes documentation cleanup to fix broken links and remove redundant files.
Motivation
As quantum computing advances, traditional cryptographic signatures (like ECDSA) will become vulnerable to attacks. ML-DSA provides quantum-resistant security for long-term model integrity protection (10+ years). This implementation ensures that models signed today will remain verifiable even in a post-quantum era.
Problems Solved
Changes Made
Core Features (Commit 4caedff)
Documentation Cleanup (Commit 0023a82)
Breaking Changes
None - this is a purely additive feature. Existing ECDSA and Sigstore signing methods remain unchanged.
Performance Notes
Checklist
Added
model_signing sign ml-dsaandmodel_signing verify ml-dsacommands with password protection support.scripts/ml_dsa_key_tool.pyfor encrypting, decrypting, and verifying ML-DSA keys.use_ml_dsa_signer()anduse_ml_dsa_verifier()methods tosigning.Configandverifying.Configclasses.[pqc]extra for post-quantum cryptography support (dilithium-py).Fixed
/publications/detail/to/pubs/URL structure).ml_dsa_key_tool.pysource path resolution for correct module imports.Changed
ml_dsa_implementation.md,ml_dsa_testing.md) to streamline documentation.Documentation
docs/ml_dsa_examples.md) with 750+ lines covering all use cases.Dependencies: