Migrate composite algorithms to draft-19 sigs / draft-15 KEM - #23
Merged
Merged
Conversation
Bring the composite ML-DSA and ML-KEM algorithms into interoperability
with the IETF Hackathon "latest": draft-ietf-lamps-pq-composite-sigs-19
and draft-ietf-lamps-pq-composite-kem-15. This moves off the old
draft-03-era construction and experimental Entrust OID arc.
Algorithms & OIDs
- Production IANA OID arc 1.3.6.1.5.5.7.6.37-.66: 18 composite
signatures and 12 composite KEMs.
- New algorithms: MLDSA65-ECDSA-P256, MLDSA87-RSA3072-PSS,
MLDSA87-RSA4096-PSS, MLDSA87-ECDSA-P521 (sigs); MLKEM768-ECDH-P256,
MLKEM1024-RSA3072, MLKEM1024-ECDH-P521 (KEM).
- New P-521 curve support (DSA + KEM). Removed the superseded
HashMlDsa*Composite variants (draft-19 has a single, always-prehashed
set).
Constructions
- Signature: M' = Prefix("CompositeAlgorithmSignatures2025") || Label ||
len(ctx) || ctx || PH(M), with the per-algorithm COMPSIG-* label used
as the ML-DSA context; SHAKE256/64 pre-hash for MLDSA87-Ed448.
- KEM combiner: SHA3-256(mlkemSS || tradSS || tradCT || tradPK || Label),
uniform SHA3-256 with per-algorithm labels.
Serialization (draft-19/-15 raw concatenation, replacing SEQUENCE)
- Public key: pqPK || tradPK; signature: mldsaSig || tradSig;
KEM ciphertext: mlkemCT || tradCT; split on the fixed PQ length.
- Private key (PKCS#8): pqSeed || tradSK, with mldsaSeed(32) /
mlkemSeed(64 = d||z) seed-based keygen and component-appropriate
tradSK encodings (RSA PKCS#1, Ed/X raw, EC RFC-5915 ECPrivateKey).
The KEM combiner's tradPK is recomputed from the secret key on decap.
Verification (against the IETF Hackathon reference implementations, R5)
- Signatures: 18 composite + 3 pure reference self-signed certs verify;
18 reference private keys sign and verify against their anchors.
- KEM: encapsulate to all 12 reference public keys; 12 reference private
keys decapsulate _ciphertext.bin to exactly the reference _ss.bin.
- KEM combiner matches the draft-15 Appendix E test vector byte-for-byte.
- 158 unit tests pass; cargo clippy --all-targets clean. Regenerated the
R5 hackathon artifacts.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: ag_megha <megha@seventhsense.ai>
Validate the composite implementation against GREEN R5 artifacts submitted by five independent third parties (Bouncy Castle, Entrust, Crypto4A, CryptoNext, leancrypto) — not our own submission and not only the reference implementation. `test_r5_cross_provider_interop` per provider: - verifies every composite signature self-signed cert (`*_ta.der`); - loads every composite signature private key, signs, and verifies the signature against that provider's trust-anchor public key; - loads every composite KEM private key, decapsulates that provider's `*_ciphertext.bin`, and asserts the shared secret equals its `*_ss.bin`. Coverage: 75 signature checks (18 each for bc/entrust/crypto4a/cryptonext + 3 leancrypto) and 48 KEM decapsulation checks (12 each for the four full providers), all passing with zero failures. Corpus committed under test/data/r5_interop/providers/. 159 tests pass; clippy clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: ag_megha <megha@seventhsense.ai>
Signed-off-by: ag_megha <megha@seventhsense.ai>
megha-seventhsense
force-pushed
the
pq-composite-sigs19-kem15
branch
from
August 25, 2026 06:37
6c1f709 to
ce446a2
Compare
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
Migrates QuantCrypt's composite algorithms to the IETF Hackathon "latest" —
draft-ietf-lamps-pq-composite-sigs-19anddraft-ietf-lamps-pq-composite-kem-15— moving off the old draft‑03‑era construction and the experimental Entrust OID arc (2.16.840.1.114027.80.*) to the production IANA arc (1.3.6.1.5.5.7.6.37–.66). Every composite algorithm is verified byte‑for‑byte against the hackathon reference implementations.What changed
Algorithms & OIDs
1.3.6.1.5.5.7.6.37–.54(18 composite signatures) and.55–.66(12 composite KEMs).MLDSA65-ECDSA-P256,MLDSA87-RSA3072-PSS,MLDSA87-RSA4096-PSS,MLDSA87-ECDSA-P521(sigs);MLKEM768-ECDH-P256,MLKEM1024-RSA3072,MLKEM1024-ECDH-P521(KEM).HashMlDsa*Compositevariants — draft‑19 has a single, always pre‑hashed set.Cryptographic constructions
M' = Prefix("CompositeAlgorithmSignatures2025") || Label || len(ctx) || ctx || PH(M), with the per‑algorithmCOMPSIG-*label used as the ML‑DSA context. Correct per‑algorithm pre‑hash, incl. SHAKE256/64 forMLDSA87-Ed448.SHA3-256(mlkemSS || tradSS || tradCT || tradPK || Label)— uniform SHA3‑256 with per‑algorithm labels.Serialization (draft‑19/‑15 raw concatenation, replacing the old
SEQUENCEencodings)pqPK || tradPK, signaturemldsaSig || tradSig, KEM ciphertextmlkemCT || tradCT— split on the fixed PQ component length.pqSeed || tradSK: seed‑based keygen (mldsaSeed32 B,mlkemSeed64 B =d‖z) and component‑appropriatetradSKencodings (RSA PKCS#1, Ed/X raw, EC RFC‑5915ECPrivateKey). The combiner'stradPKis recomputed from the secret key on decap (draft‑15 keys don't store it).Verification
All checks pass against the IETF Hackathon R5 reference implementations (
composite-sigs-ref-impl,composite-kem-ref-impl), added undertest/data/r5_interop/:test_r5_composite_sig_interoptest_r5_composite_sig_privkey_interoptest_r5_composite_kem_interoptest_r5_composite_kem_privkey_interop_ciphertext.binto exactly the reference_ss.bintest_kem_combiner_vector_mlkem768_p256cargo clippy --all-targetsclean.artifacts/r5_certs/.Notes
HashMlDsa*CompositeDsaAlgorithmvariants were removed (superseded by draft‑19's single set). Acceptable for this 0.x, testing‑oriented crate.🤖 Generated with Claude Code
Cross-provider validation (independent third-party artifacts)
Beyond the reference implementation, the composite implementation is validated against green R5 artifacts submitted by five independent third parties — Bouncy Castle, Entrust, Crypto4A, CryptoNext, and leancrypto (
test_r5_cross_provider_interop, corpus undertest/data/r5_interop/providers/). For each provider we verify every composite signature self-signed cert, sign+verify with every composite signature private key against that provider's trust anchor, and decapsulate every composite KEM ciphertext to exactly that provider's expected shared secret.bc)Total: 75 signature checks + 48 KEM decapsulation checks across 5 independent implementations, zero failures. 159 unit tests pass; clippy clean.