uor_addr/asn1/mod.rs
1//! **`uor_addr::asn1` — the ASN.1 realization of UOR-ADDR**
2//! (ARCHITECTURE.md "Format-specific realizations" § `uor-addr-asn1`).
3//!
4//! ASN.1 typed-input content-addressing under ITU-T X.690
5//! Distinguished Encoding Rules (DER), with the σ-projection bound
6//! to `prism::crypto::Sha256Hasher`.
7//!
8//! ## Authoritative sources
9//!
10//! - **ITU-T X.690** — *Information technology — ASN.1 encoding
11//! rules: Specification of Basic Encoding Rules (BER), Canonical
12//! Encoding Rules (CER), and Distinguished Encoding Rules (DER)*
13//! (<https://www.itu.int/rec/T-REC-X.690>). DER (§§ 10–11) is
14//! the canonical-form discipline for the typed-iso surface.
15//! - **ITU-T X.680** — *Specification of basic notation*
16//! (<https://www.itu.int/rec/T-REC-X.680>). Defines the ASN.1
17//! abstract type system.
18//! - **SHA-256 σ-projection** — NIST FIPS 180-4
19//! (<https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf>).
20//!
21//! ## Supported universal tags
22//!
23//! Per ARCHITECTURE.md the typed-input shape `Asn1Value` is a
24//! `partition_coproduct!` over ASN.1 universal-tag cases. The current
25//! published support covers the cases that have unambiguous DER
26//! encoding in X.690 §8:
27//!
28//! - `Boolean` (tag 0x01) — DER encodes `false` as a single byte
29//! `0x00`, `true` as a single byte `0xFF` (X.690 §8.2.2).
30//! - `Integer` (tag 0x02) — minimum-octets two's-complement
31//! big-endian (X.690 §8.3).
32//! - `OctetString` (tag 0x04) — primitive encoding (X.690 §10.2).
33//! - `Null` (tag 0x05) — zero-length content (X.690 §8.8.1).
34//! - `Sequence` (tag 0x30) — children DER-encoded in declared order
35//! (X.690 §8.9). Used for both `SEQUENCE` and `SEQUENCE OF`.
36//!
37//! ## Canonical-bytes layout (DER)
38//!
39//! Every `Asn1Value::tagged_bytes()` returns a self-describing
40//! DER-encoded byte sequence; the ψ_9 canonicalizer is the identity
41//! on this layout because DER is itself the canonical form.
42
43pub mod model;
44pub mod pipeline;
45pub mod shapes;
46pub mod value;
47pub mod verbs;
48
49pub use model::{
50 AddressModel, AddressModelBlake3, AddressModelKeccak256, AddressModelSha3_256,
51 AddressModelSha512, AddressRoute,
52};
53pub use pipeline::{
54 address, address_blake3, address_keccak256, address_sha3_256, address_sha512, AddressFailure,
55 AddressOutcome, AddressWitness, VerifyError,
56};
57pub use shapes::MAX_ASN1_DEPTH;
58#[cfg(feature = "alloc")]
59pub use value::{canonicalize, Asn1Value};
60pub use value::{validate_der, Asn1Carrier};
61pub use verbs::{address_inference, VERB_TERMS_ADDRESS_INFERENCE};
62
63/// The shared, format-independent ψ-tower (re-exported for convenience;
64/// canonical path is [`crate::resolvers::AddressResolverTuple`]).
65pub use crate::resolvers::AddressResolverTuple;