Skip to main content

Module cbor

Module cbor 

Source
Expand description

uor_addr::cbor — the CBOR realization of UOR-ADDR (ARCHITECTURE.md “Format-specific realizations”).

CBOR typed-input content-addressing under RFC 8949 §4.2 Deterministic Encoding, with the σ-projection bound to prism::crypto::Sha256Hasher by default and the other 32-byte axes (crate::hash) available via the address_<algorithm> entry points.

§Authoritative sources

  • CBOR + deterministic encoding — IETF RFC 8949 Concise Binary Object Representation (CBOR), §4.2 Deterministically Encoded CBOR (https://www.rfc-editor.org/rfc/rfc8949). The canonical-form invariants — preferred (shortest) integer/float encoding (§4.1, §4.2.2), definite-length items, and bytewise-sorted map keys (§4.2.1) — are validated against RFC 8949 Appendix A’s diagnostic ⇄ encoding vectors in tests/cbor_rfc8949.rs.
  • SHA-256 σ-projection — NIST FIPS 180-4.

§End-to-end (ADR-060)

  1. canonicalize re-encodes any well-formed CBOR item into its RFC 8949 §4.2 deterministic form into an alloc buffer.
  2. address wraps those bytes in the borrowed CborCarrier and runs AddressModel’s forward(): the ψ-chain verb threads the carrier through the shared AddressResolverTuple (ADR-036), and ψ₉ folds the canonical bytes through the σ-axis in one σ-projection.
  3. address returns the crate::AddressOutcome carrying the κ-label + replayable TC-05 witness.

Re-exports§

pub use model::AddressModel;
pub use model::AddressModelBlake3;
pub use model::AddressModelKeccak256;
pub use model::AddressModelSha3_256;
pub use model::AddressModelSha512;
pub use model::AddressRoute;
pub use pipeline::address;
pub use pipeline::address_blake3;
pub use pipeline::address_keccak256;
pub use pipeline::address_sha3_256;
pub use pipeline::address_sha512;
pub use pipeline::AddressFailure;
pub use pipeline::AddressOutcome;
pub use pipeline::AddressWitness;
pub use pipeline::VerifyError;
pub use shapes::MAX_CBOR_DEPTH;
pub use value::canonicalize;
pub use value::CborCarrier;
pub use verbs::address_inference;
pub use verbs::VERB_TERMS_ADDRESS_INFERENCE;
pub use crate::bounds::AddrBounds;
pub use crate::resolvers::AddressResolverTuple;

Modules§

model
cbor::AddressModel* — the cbor realization’s PrismModel declarations, one per admissible σ-axis (crate::hash). Each binds the shared AddressResolverTuple ψ-tower and the axis’s capacity profile (AddrBounds for the 32-byte axes, AddrBounds64 for sha512). AddressModel (sha256) is the default.
pipeline
cbor::address* — the CBOR realization’s public entry points, one per admissible σ-axis (crate::hash).
shapes
Substitution-axis selections for the CBOR realization.
value
CBOR typed input (ADR-023 amended by ADR-060) with RFC 8949 §4.2 Deterministic-Encoding canonical-form byte output.
verbs
CBOR realization’s ψ-chain content-address derivation verbs (wiki ADR-024 + ADR-035 + ADR-036), one per admissible σ-axis.

Structs§

Sha256Hasher
Default Hasher<32> selection for the CBOR address-derivation pipeline. FIPS-180-4 SHA-256 hasher. 32-byte digest.