Skip to main content

uor_addr/cbor/
mod.rs

1//! **`uor_addr::cbor` — the CBOR realization of UOR-ADDR**
2//! (ARCHITECTURE.md "Format-specific realizations").
3//!
4//! CBOR typed-input content-addressing under RFC 8949 §4.2 Deterministic
5//! Encoding, with the σ-projection bound to `prism::crypto::Sha256Hasher`
6//! by default and the other 32-byte axes ([`crate::hash`]) available via
7//! the `address_<algorithm>` entry points.
8//!
9//! ## Authoritative sources
10//!
11//! - **CBOR + deterministic encoding** — IETF RFC 8949 *Concise Binary
12//!   Object Representation (CBOR)*, §4.2 *Deterministically Encoded CBOR*
13//!   (<https://www.rfc-editor.org/rfc/rfc8949>). The canonical-form
14//!   invariants — preferred (shortest) integer/float encoding (§4.1,
15//!   §4.2.2), definite-length items, and bytewise-sorted map keys (§4.2.1)
16//!   — are validated against RFC 8949 Appendix A's diagnostic ⇄ encoding
17//!   vectors in `tests/cbor_rfc8949.rs`.
18//! - **SHA-256 σ-projection** — NIST FIPS 180-4.
19//!
20//! ## End-to-end (ADR-060)
21//!
22//! 1. [`canonicalize`] re-encodes any well-formed CBOR item into its RFC
23//!    8949 §4.2 deterministic form into an `alloc` buffer.
24//! 2. [`address`] wraps those bytes in the borrowed [`CborCarrier`] and
25//!    runs [`AddressModel`]'s `forward()`: the ψ-chain verb threads the
26//!    carrier through the shared [`AddressResolverTuple`] (ADR-036), and ψ₉
27//!    folds the canonical bytes through the σ-axis in one σ-projection.
28//! 3. [`address`] returns the [`crate::AddressOutcome`] carrying the
29//!    κ-label + replayable TC-05 witness.
30
31pub mod model;
32pub mod pipeline;
33pub mod shapes;
34pub mod value;
35pub mod verbs;
36
37pub use model::{
38    AddressModel, AddressModelBlake3, AddressModelKeccak256, AddressModelSha3_256,
39    AddressModelSha512, AddressRoute,
40};
41#[cfg(feature = "alloc")]
42pub use pipeline::{address, address_blake3, address_keccak256, address_sha3_256, address_sha512};
43pub use pipeline::{AddressFailure, AddressOutcome, AddressWitness, VerifyError};
44pub use shapes::{Sha256Hasher, MAX_CBOR_DEPTH};
45#[cfg(feature = "alloc")]
46pub use value::canonicalize;
47pub use value::CborCarrier;
48pub use verbs::{address_inference, VERB_TERMS_ADDRESS_INFERENCE};
49
50/// The shared `AddrBounds` capacity profile (canonical path
51/// [`crate::bounds::AddrBounds`]).
52pub use crate::bounds::AddrBounds;
53/// The shared, format-independent ψ-tower (canonical path
54/// [`crate::resolvers::AddressResolverTuple`]).
55pub use crate::resolvers::AddressResolverTuple;