feat: add ML-KEM/ML-DSA raw-public and raw-seed export/import#943
Merged
feat: add ML-KEM/ML-DSA raw-public and raw-seed export/import#943
Conversation
… support - Add initPqcRaw() to KeyObjectHandle Nitro spec and C++ implementation for importing ML-KEM/ML-DSA keys from raw bytes or seeds - Extend C++ exportKey() to handle PQC raw public key and seed export - Wire TypeScript subtle.exportKey() for raw-public and raw-seed formats - Wire TypeScript mlkemImportKey()/mldsaImportKey() for raw and raw-seed - Add comprehensive tests: size validation, roundtrip encapsulate/ decapsulate, re-export consistency, unwrapKey with AES-KW - Update implementation-coverage.md: ML-KEM-512/768/1024 raw-public, raw-seed, and unwrapKey all marked as implemented
Add .claude/rules/git-safety.xml with blocking rules: - Never use --no-verify on commit or push - Never commit to main - Run clang-format and prettier before committing Update .claude/commands/commit.md to include code quality checks (clang-format, prettier, tsc) and 120s timeout.
Extract pqcImportKeyObject() to deduplicate key import logic shared by mldsaImportKey and mlkemImportKey. Fix two test failures: ML-DSA-44 invalid format test now uses 'jwk' (truly unsupported) instead of 'raw' (now valid), and ML-KEM unwrapKey test uses AES-GCM instead of AES-KW (ML-KEM SPKI is not 8-byte aligned per RFC 3394). Add ML-DSA raw-public and raw-seed export/import tests with sign/verify roundtrips. Add protective comments at raw-seed normalization pass-through points.
Contributor
🤖 End-to-End Test Results - iOSStatus: ✅ Passed 📸 Final Test ScreenshotScreenshot automatically captured from End-to-End tests and will expire in 30 days This comment is automatically updated on each test run. |
Contributor
🤖 End-to-End Test Results - AndroidStatus: ✅ Passed 📸 Final Test ScreenshotScreenshot automatically captured from End-to-End tests and will expire in 30 days This comment is automatically updated on each test run. |
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.


Summary
Add raw key export/import support for ML-KEM and ML-DSA post-quantum algorithms, plus unwrapKey support for ML-KEM keys.
Changes
raw-publicexport/import for ML-KEM and ML-DSA public keys (raw encapsulation/verification key bytes)raw-seedexport/import for ML-KEM and ML-DSA private keys (seed-based serialization)unwrapKeysupport for ML-KEM public keys (tested with AES-GCM wrap)initPqcRaw()Nitro bridge method — native C++ key import usingEVP_PKEY_ML_KEM_*/EVP_PKEY_ML_DSA_*NIDs with OpenSSL 3.5+ gatingpqcImportKeyObject()helper — deduplicates key import logic shared bymldsaImportKeyandmlkemImportKey['verify']for public and['sign']for private (was allowing both for any format).claude/rules/git-safety.xmland updated commit commandTesting