Add @pksuite/crypto 0.1.0 and migrate pkvault onto it#1
Merged
Conversation
…vault New workspace package packages/crypto: browser/Node age v1 X25519 sealing (strict reader, canonical bech32/base64, constant-time MAC compare) and the PKFILE1 chunked file envelope — XChaCha20-Poly1305 with per-chunk HKDF keys, canonical-JSON metadata with path-safe filename rules, key zeroization throughout, and decryption state detached from the caller's buffer. spec/SPEC-FILE.md specifies the format; the derivation registry gains the pksuite/file labels in the same change. Conformance: frozen KAT vectors plus 9 executable byte-level tampering cases (count-asserted), an independent node:crypto reference reader, and a frozen external age-CLI interop artifact verified via age-keygen. Mobile release gate recorded: 60 MB round-trips pass on iOS Safari 18.4 (iPhone 16 Pro) and Android 16 Chrome (Pixel 8) — reports under test/mobile/reports/. pkvault migrates identity/bech32 helpers to the shared package (its own bech32.js deleted; plain 0.1.0 dependency, workspace-linked). Monorepo moves to pnpm workspaces: lockfile, pinned pnpm in CI with store caching, a committed-dist smoke check, and a dist-freshness gate (git diff --exit-code after rebuild). dist ships noble as external declared dependencies, not vendored copies. Reviewed: 10-finding high-effort review + two fix rounds, all findings closed (path-traversal metadata names, workspace: publish protocol, gitignored entry points, header aliasing, self-verifying vectors, JSON canonicality, vendored deps, zeroization, CI fragility, stale claims). Suites: crypto 20/20, pkvault 218/218.
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.
What
packages/crypto: browser/Node age v1 X25519 sealing (strict reader, canonical encodings) and the PKFILE1 chunked file envelope (XChaCha20-Poly1305, per-chunk HKDF keys, canonical-JSON metadata with path-safe filenames, key zeroization, caller-buffer detachment).spec/SPEC-FILE.mdspecifies the wire format;spec/derivation-registry.mdregisters thepksuite/filelabels in the same PR per registry rule 1.Review
Went through a 10-finding high-effort review plus two fix rounds — all findings closed and re-verified empirically (path-traversal metadata names, publish protocol, entry-point resolution, header aliasing, self-verifying vectors, JSON canonicality, vendored deps, zeroization, CI fragility, stale claims).
Tests