Skip to main content

uor_addr/sexp/
model.rs

1//! `sexp::AddressModel*` — the sexp 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::label::{
8    AddressLabelBlake3, AddressLabelKeccak256, AddressLabelSha256, AddressLabelSha3_256,
9    AddressLabelSha512,
10};
11use crate::sexp::value::SExprValue;
12#[allow(unused_imports)]
13use crate::sexp::verbs::{
14    address_inference, address_inference_blake3, address_inference_keccak256,
15    address_inference_sha3_256, address_inference_sha512, VERB_TERMS_ADDRESS_INFERENCE,
16    VERB_TERMS_ADDRESS_INFERENCE_BLAKE3, VERB_TERMS_ADDRESS_INFERENCE_KECCAK256,
17    VERB_TERMS_ADDRESS_INFERENCE_SHA3_256, VERB_TERMS_ADDRESS_INFERENCE_SHA512,
18};
19
20addr_models! {
21    input: SExprValue<'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}