Skip to main content

uor_addr/asn1/
model.rs

1//! `asn1::AddressModel*` — the asn1 realization's `PrismModel` declarations,
2//! one per admissible σ-axis ([`crate::hash`]). Each binds the shared
3//! [`AddressResolverTuple`](crate::resolvers) ψ-tower and the axis's
4//! capacity profile (`AddrBounds` for the 32-byte axes, `AddrBounds64` for
5//! sha512). `AddressModel` (sha256) is the default.
6
7use crate::asn1::value::Asn1Carrier;
8#[allow(unused_imports)]
9use crate::asn1::verbs::{
10    address_inference, address_inference_blake3, address_inference_keccak256,
11    address_inference_sha3_256, address_inference_sha512, VERB_TERMS_ADDRESS_INFERENCE,
12    VERB_TERMS_ADDRESS_INFERENCE_BLAKE3, VERB_TERMS_ADDRESS_INFERENCE_KECCAK256,
13    VERB_TERMS_ADDRESS_INFERENCE_SHA3_256, VERB_TERMS_ADDRESS_INFERENCE_SHA512,
14};
15use crate::label::{
16    AddressLabelBlake3, AddressLabelKeccak256, AddressLabelSha256, AddressLabelSha3_256,
17    AddressLabelSha512,
18};
19
20addr_models! {
21    input: Asn1Carrier<'a>,
22    {
23        hasher: prism::crypto::Sha256Hasher,
24        bounds: crate::bounds::AddrBounds,
25        shape: AddressLabelSha256,
26        model: AddressModel,
27        route: AddressRoute,
28        verb: address_inference
29    },
30    {
31        hasher: prism::crypto::Blake3Hasher,
32        bounds: crate::bounds::AddrBounds,
33        shape: AddressLabelBlake3,
34        model: AddressModelBlake3,
35        route: AddressRouteBlake3,
36        verb: address_inference_blake3
37    },
38    {
39        hasher: prism::crypto::Sha3_256Hasher,
40        bounds: crate::bounds::AddrBounds,
41        shape: AddressLabelSha3_256,
42        model: AddressModelSha3_256,
43        route: AddressRouteSha3_256,
44        verb: address_inference_sha3_256
45    },
46    {
47        hasher: prism::crypto::Keccak256Hasher,
48        bounds: crate::bounds::AddrBounds,
49        shape: AddressLabelKeccak256,
50        model: AddressModelKeccak256,
51        route: AddressRouteKeccak256,
52        verb: address_inference_keccak256
53    },
54    {
55        hasher: prism::crypto::Sha512Hasher,
56        bounds: crate::bounds::AddrBounds64,
57        shape: AddressLabelSha512,
58        model: AddressModelSha512,
59        route: AddressRouteSha512,
60        verb: address_inference_sha512
61    },
62}