Repository navigation
Conversation
…e v2 (CAP-1027)
generatePairKeyPair mints a P-384 ECDH key and an ML-KEM-1024 key
(@noble/post-quantum) and sends P-384 point || ML-KEM key as public_key.
openPairEnvelope opens only {v:2}: P-384 ECDH + ML-KEM decapsulation,
HKDF-SHA-384(ecdh || kem, salt = epk, info capy:pair:v2), AES-256-GCM.
v1 (P-256 only) envelopes are refused, so the post-quantum half can't be
stripped. engines bumped to Node >=20.19 for require() of the ESM-only
noble package in the npm build; the standalone binary bundles it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SjobYubUAofnRVQ6awH2Xf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SjobYubUAofnRVQ6awH2Xf
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
CAP-1027:
capy pairmints a P-384 + ML-KEM-1024 key (@noble/post-quantum), sends both aspublic_key, and opens onlyv:2envelopes. A v1 (P-256 only) envelope is refused, so the post-quantum half can't be stripped.enginesmoves to Node >=20.19 so the npm build canrequire()the ESM-only noble package; the standalone binary bundles it (checked: esbuild bundle includesml_kem1024).Linear project: PQC. Envelope v2: CLI
public_key= P-384 point (97 B) ‖ ML-KEM-1024 key (1568 B);{v:2, epk, iv, ct}withepk= ephemeral P-384 point ‖ ML-KEM ciphertext; key = HKDF-SHA-384(ECDH ‖ ML-KEM secret, salt = epk, infocapy:pair:v2) → AES-256-GCM. No new fields, no DB migration, no new commands.Rollout
Release only after capysc/capy and capysc/keep-app
feat/pqcare deployed. This CLI's 1665-byte key is rejected by today's service, and today's Keep would seal v1.Test plan
bun test tests/crypto/pairCrypto.test.ts tests/commands/pairCommand.test.ts(28 pass), browser sealer moved to v2 intests/helpers/sealPairV2.tstsc --noEmitclean;distloads on Node 22 and returns a 1665-byte keyfeat/pqcsealPairPayloadseals, thisopenPairEnvelopeopens