1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! # dig-urn-protocol
//!
//! The **canonical DIG content-addressing + server-untrusted verification contract** — the one
//! definition of how a DIG URN names content and how a blind client turns opaque gateway bytes into
//! verified plaintext, fail-closed.
//!
//! This crate OWNS (and is the single source of truth for):
//!
//! * **The `urn:dig:` scheme + byte-level grammar** — [`DigUrn`] parsing, [`DigUrn::canonical`]
//! rendering, and `retrieval_key = SHA-256(canonical())` (plus the root-independent
//! `content_key = SHA-256(canonical_rootless())`) derivation. The [`grammar`]
//! module carries the normative ABNF, pinned by the frozen conformance vectors.
//! * **The resolution INTERFACE** — the [`UrnResolver`] trait plus [`ResolveOutcome`] /
//! [`ResolveError`] / [`ResolveOptions`]. The contract, not the transport.
//! * **The browser content-VERIFICATION contract** — [`verify`]: rootless rejection, leaf-binding,
//! path-fold, root-anchoring, gate-then-decrypt, and the u64-bounded chunk split — over crypto
//! primitives INJECTED via [`verify::ContentCrypto`].
//!
//! ## A leaf crate that reimplements no crypto
//!
//! `dig-urn-protocol` has NO `dig-*` dependencies and NO transport (reqwest/tokio). The merkle-fold
//! and AES primitives are supplied by the caller (`digstore_core`), so this crate can never skew from
//! the canonical read-crypto. It performs only SHA-256 (the retrieval key + the content leaf), which
//! is byte-identical to `digstore_core`'s.
//!
//! ## Relationship to `dig-rpc-protocol`
//!
//! This crate owns addressing + resolution + verification only. It CONSUMES the `dig-rpc-protocol`
//! `PublicRead` contract conceptually for the actual fetch, but does not depend on it or duplicate
//! any RPC method — a concrete [`UrnResolver`] wires the two together.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
/// The crate version (matches `Cargo.toml`), for compatibility checks.