Skip to content

Add @pksuite/crypto 0.1.0 and migrate pkvault onto it#1

Merged
ddyy merged 1 commit into
mainfrom
crypto-package
Jul 18, 2026
Merged

Add @pksuite/crypto 0.1.0 and migrate pkvault onto it#1
ddyy merged 1 commit into
mainfrom
crypto-package

Conversation

@ddyy

@ddyy ddyy commented Jul 18, 2026

Copy link
Copy Markdown
Owner

What

  • New workspace package 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.md specifies the wire format; spec/derivation-registry.md registers the pksuite/file labels in the same PR per registry rule 1.
  • Conformance: frozen KATs + 9 executable byte-level tampering vectors, an independent node:crypto reference reader, and a frozen external age-CLI interop artifact.
  • Mobile release gate recorded: 60 MB round-trips pass on iOS Safari 18.4 (iPhone 16 Pro) and Android 16 Chrome (Pixel 8).
  • pkvault migrates its identity/bech32 helpers to the shared package; monorepo moves to pnpm workspaces with pinned-pnpm CI, a committed-dist smoke check, and a dist-freshness gate.

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

  • @pksuite/crypto: 20/20
  • pkvault: 218/218 (unchanged behavior, now through the shared helpers)

…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.
@ddyy
ddyy merged commit f93a003 into main Jul 18, 2026
2 checks passed
@ddyy
ddyy deleted the crypto-package branch July 18, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant