Skip to content

feat(core): tablepro-keys crate for the end-to-end design - #4519

Merged
datlechin merged 7 commits into
mainfrom
feat/core-keys
Nov 25, 2026
Merged

datlechin merged 7 commits into
mainfrom
feat/core-keys

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • New crate tablepro-keys (core/crates/keys), suite tp1 from ADR 0056, with no workspace dependency and no I/O (no tokio, network or SQLite). aws-lc-rs for AES-256-GCM, HKDF-SHA256, Ed25519, X25519, SHA-256, HMAC and the RNG; HPKE from rustls's crypto::aws_lc_rs::hpke.
  • Encoding: LP framing, labels, origins, UUIDs as 16 bytes and as upper-case text, scopes and purposes, versions 1 to 2^31-1, canonical base64url, Crockford Base32, EFF word digits, ISO/IEC 7816-4 padding.
  • Keys and objects: the recovery key (text, checksum, reading), IK seed, K_rec and the blob; account certificates of each kind with the replace endorsement and IK change checks; device certificates; IK cancels; kid; version records with start and their digest; wraps of every purpose and recipient with their signature and the recipient's checks; chained rings and the walk down them.
  • Envelopes with the sealed dest and its check at use, history entries, the trust plaintext and what it leaves out for size, the SAS commitment, words and session order, fingerprint words and QR text, the state MAC (0054), DPoP proofs (Ed25519, OKP jwk).
  • Key object bodies and record ids as 0051 and 0052 give them, strict: duplicate, unknown, missing or wrongly typed members refused at any depth by a strict JSON reader that keeps member order and number text. "The same object" compares as JSON values.
  • Ed25519 pre-checks before the library verifies: non-canonical A or R, A of small order, S at or above L. HPKE refuses an all-zero X25519 shared secret.
  • KeysError carries 0056's Errors table as code(), plus keys.random for a failed system RNG.
  • Secrets in zeroize and secrecy types with redacted Debug.
  • core/crates/keys/vectors/: one JSON file per area with every random input as an input of the case, every known-answer row, and a case for every row of 0056's negative table with its client and server codes. Rows a flow or the server decides are in flows.json with their key objects from one world. scripts/update-vectors.sh writes them; --standard fetches RFC 9180's (revision 5f503c5) and Wycheproof's (65ca494) vectors by SHA-256.
  • EFF large word list shipped with its SHA-256 pinned; deny.toml and linux/about.toml allow CC-BY-3.0.
  • cargo-fuzz targets for every parser under core/crates/keys/fuzz, a workspace of its own.
  • core.yml checks the crate and runs its tests on Windows x64, Arm64 and macOS. core/ARCHITECTURE.md and core/AGENTS.md list it.

Test plan

  • cargo test -p tablepro-keys: unit and property tests, zeroize tests, RFC 9180 (every encryption of the base-mode entry), Wycheproof AES-GCM, X25519, Ed25519 and HKDF-SHA256, every committed vector case from its inputs, the vectors equal to what the generator writes, and every negative row of 0056 named by a case.
  • cargo clippy -p tablepro-keys --all-targets -- -D warnings, cargo fmt --check, cargo shear, cargo deny check bans licenses sources.
  • update-third-party-licenses.sh and update-core-licenses.sh --check: no change.
  • verify.sh --platform linux --jobs 4 test tablepro-keys in the Linux dev container.
  • Fuzzing, one hour per target, one at a time under mem-guard: running; the results go here when each hour ends.

@datlechin
datlechin enabled auto-merge (squash) November 25, 2026 18:37
@datlechin
datlechin disabled auto-merge November 25, 2026 18:43
@datlechin
datlechin enabled auto-merge (squash) November 25, 2026 18:45
@datlechin
datlechin disabled auto-merge November 25, 2026 18:47
@datlechin
datlechin merged commit 79e19fc into main Nov 25, 2026
1 check passed
@datlechin
datlechin deleted the feat/core-keys branch November 25, 2026 18:47
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