Cryptography Policy SSoT
This document enforces the cryptography invariants referenced in AGENTS.md.
Allowed Primitives
Section titled “Allowed Primitives”All cryptographic logic MUST use the vox-crypto crate.
- AEAD: Pure-Rust
chacha20poly1305is the standard. - Hashing: Use
sha2(SHA-256 or SHA-512) orblake3via pure-Rust crates.
Banned Primitives & Dependencies
Section titled “Banned Primitives & Dependencies”The following are explicitly banned in this repository:
- AEGIS: Prohibited due to state-management complexity and cross-platform inconsistencies.
ring— no longer banned; see the correction below. It is the workspace’s deliberate TLS provider (Cargo.tomlpinsrustls/tokio-rustlstofeatures = ["ring"]) and iroh 1.x’s default. Banning it here while the root manifest selected it on purpose is the contradiction this revision resolves.zig-chains: Prohibited for cross-compilation within the crypto stack.- C-assembly build chains — restated as a build invariant rather than a crate
ban: no dependency may require cmake, nasm, Go, perl, or libclang. Verified by a
CI image lacking those tools, not by blacklisting names. (
aws-lc-sys>= 0.41 builds onx86_64-pc-windows-msvcwith neither cmake nor nasm present — confirmed empirically on 2026-09-04 — so the old clause described a hazard that had ceased to exist, while missing feature-mediated provider selection, which is the real one.)
All cryptography must compile on stable Rust without a C toolchain requirement.
Correction (2026-09-04) — this document was unenforced and self-contradictory
Section titled “Correction (2026-09-04) — this document was unenforced and self-contradictory”Three findings, each verified against the tree:
-
The gate had never executed.
vox-code-audit’sCryptoBanDetectorcarries a Cargo-manifest branch and listsLanguage::Unknowninsupported_langsprecisely so manifests reach it. Butscanner.rsdropped everyUnknownfile before any detector ran, andLanguage::from_extension("toml")isUnknown. The branch was unreachable in production; its unit tests passed only because they constructSourceFiledirectly and bypass the scanner. Fixed, with a regression test that goes throughscan(). -
The workspace ships two TLS providers, and this document banned the one it chose on purpose.
ringis pinned in the root manifest.aws-lc-rsarrives with reqwest 0.13 viachromiumoxideandgix->jj-lib->vox-vcs;jj-libexposes no TLS feature, so it cannot be steered from our manifests. Full attribution, and the collapse path (hf-hub 1.0 moves to reqwest 0.13), is incontracts/crypto/transport-providers.v1.json. -
A name ban is the wrong tool for provider selection. Providers are chosen by a feature on a shared crate (
rustls/aws-lc-rs), which no source-text regex can see, and cargo unifies features per-package so one crate turning it on affects everything. The sound input is the resolved lockfile. SeeAGENTS.md§Cryptography Policy for the two-concern split that replaces the single rule.