Skip to main content

uor_addr/ring/
mod.rs

1//! **`uor_addr::ring` — the ring-element realization of UOR-ADDR**
2//! (ARCHITECTURE.md "Format-specific realizations" § `uor-addr-ring`).
3//!
4//! Ring-element typed-input content-addressing under UOR-Framework
5//! Amendment 43 §2's `Element::canonical_bytes` layout, with the
6//! σ-projection bound to `prism::crypto::Sha256Hasher`.
7//!
8//! ## Authoritative sources
9//!
10//! - **Amendment 43 §2 canonical-bytes layout** — UOR-Framework wiki
11//!   <https://github.com/UOR-Foundation/UOR-Framework/wiki/Amendment-43>.
12//!   The canonical-bytes layout is `header(k) || le_bytes(x, k+1)`
13//!   where `k` is the element's Witt level and `x` is its value
14//!   coefficient encoded in little-endian over `k+1` bytes.
15//! - **ADR-039 ring algebra surface** — UOR-Framework wiki
16//!   <https://github.com/UOR-Foundation/UOR-Framework/wiki/ADR-039>.
17//! - **SHA-256 σ-projection** — NIST FIPS 180-4
18//!   (<https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf>).
19//!
20//! ## Canonical-bytes layout
21//!
22//! ```text
23//! canonical_bytes(e) := [witt_level: u8] || [coefficient: u8; witt_level + 1]
24//! ```
25//!
26//! - `witt_level ∈ {0, 1, 2, 3}` — the element's Witt level per
27//!   Amendment 43.
28//! - `coefficient` — `witt_level + 1` little-endian bytes encoding the
29//!   element value `x`. The coefficient byte width is determined by
30//!   the Witt level (1, 2, 3, or 4 bytes), so the canonical bytes are
31//!   `1 + (witt_level + 1)` bytes total — between 2 and 5 bytes.
32//!
33//! This is the minimum-information byte sequence that distinguishes
34//! two ring elements: the Witt level disambiguates the algebraic
35//! domain; the LE coefficient bytes distinguish elements within the
36//! same level.
37
38pub mod model;
39pub mod pipeline;
40pub mod shapes;
41pub mod value;
42pub mod verbs;
43
44pub use model::{
45    AddressModel, AddressModelBlake3, AddressModelKeccak256, AddressModelSha3_256,
46    AddressModelSha512, AddressRoute,
47};
48pub use pipeline::{
49    address, address_blake3, address_keccak256, address_sha3_256, address_sha512, AddressFailure,
50    AddressOutcome, AddressWitness, VerifyError,
51};
52pub use shapes::{MAX_WITT_LEVEL, RING_VALUE_MAX_BYTES};
53pub use value::RingElement;
54pub use verbs::{address_inference, VERB_TERMS_ADDRESS_INFERENCE};
55
56/// The shared, format-independent ψ-tower (re-exported for convenience;
57/// canonical path is [`crate::resolvers::AddressResolverTuple`]).
58pub use crate::resolvers::AddressResolverTuple;