Expand description
uor-addr-c — C ABI bindings for uor-addr.
Exposes each UOR-ADDR realization through a stable extern "C"
entry point. The crate is no_std and no_alloc (mirrors
uor-addr’s defaults); the staticlib / cdylib outputs are
consumable from embedded C/C++ toolchains plus any language with
a C FFI (Python cffi, Go cgo, Ruby FFI, .NET P/Invoke).
§API shape
Every realization exposes one entry point of the form
int32_t uor_addr_<realization>(
const uint8_t *input,
size_t input_len,
uint8_t *out_label,
size_t out_label_len,
size_t *out_written);input/input_len— caller-owned input byte sequence.out_label/out_label_len— caller-owned output buffer; must be at leastUOR_ADDR_LABEL_BYTES= 71 bytes.out_written— written with the number of bytes the function emitted (always 71 on success). May beNULL(the count is then discarded; the buffer is still filled).
Return value is one of:
UOR_ADDR_OK(0) — success.UOR_ADDR_ERR_NULL_POINTER(-1) — invalid pointer.UOR_ADDR_ERR_BUFFER_TOO_SMALL(-2) — output buffer too small.UOR_ADDR_ERR_INVALID_INPUT(-3) — input rejected by parser.UOR_ADDR_ERR_TOO_LARGE(-4) — reserved; never returned under ADR-060 (inputs are unbounded). Retained for error-code stability.UOR_ADDR_ERR_PIPELINE(-5) — substrate-level failure.
Structs§
- UorAddr
Grounded - Opaque, foreign-managed witness handle. Construct via any
uor_addr_*_with_witness[_hash]function; release withuor_addr_grounded_free.
Constants§
- UOR_
ADDR_ ERR_ BUFFER_ TOO_ SMALL out_label_len < UOR_ADDR_LABEL_BYTES.- UOR_
ADDR_ ERR_ INVALID_ INPUT - Input failed the realization’s host-boundary parser.
- UOR_
ADDR_ ERR_ NULL_ POINTER input == NULL && input_len > 0, orout_label == NULL.- UOR_
ADDR_ ERR_ PIPELINE - Defensive — substrate-level pipeline failure.
- UOR_
ADDR_ ERR_ SIGMA_ AXIS_ MISMATCH - A composition operand’s σ-axis does not match the operation’s axis (CA-3 σ-axis homogeneity), or — for the binary product — the two operands carry different axes.
- UOR_
ADDR_ ERR_ TOO_ LARGE - Reserved — never returned under ADR-060 (inputs are unbounded;
the per-realization size/count caps were removed). Retained so
existing
-4handlers in downstream C consumers keep compiling. - UOR_
ADDR_ ERR_ UNKNOWN_ HASH - Unknown σ-axis selector passed to a
*_with_hashentry point (not one of theUOR_ADDR_HASH_*constants). - UOR_
ADDR_ ERR_ VERIFY_ CAPACITY_ EXCEEDED - Reserved (see above).
- UOR_
ADDR_ ERR_ VERIFY_ EMPTY_ TRACE verify()failed: empty trace. Reserved — the live verify path maps every failure toUOR_ADDR_ERR_PIPELINE; retained for ABI stability.- UOR_
ADDR_ ERR_ VERIFY_ NON_ CONTIGUOUS_ STEPS - Reserved (see above).
- UOR_
ADDR_ ERR_ VERIFY_ OUT_ OF_ ORDER_ EVENT - Reserved (see above).
- UOR_
ADDR_ ERR_ VERIFY_ ZERO_ TARGET - Reserved (see above).
- UOR_
ADDR_ HASH_ BLAK E3 - σ-axis selector: BLAKE3.
- UOR_
ADDR_ HASH_ KECCA K256 - σ-axis selector: Keccak-256 (pre-FIPS padding).
- UOR_
ADDR_ HASH_ SHA3_ 256 - σ-axis selector: SHA3-256 (FIPS 202).
- UOR_
ADDR_ HASH_ SHA256 - σ-axis selector for the
*_with_hashentry points: SHA-256 (default). - UOR_
ADDR_ HASH_ SHA512 - σ-axis selector: SHA-512 (FIPS 180-4; 64-byte digest → 135-byte label).
- UOR_
ADDR_ OK - Success.
Statics§
- UOR_
ADDR_ LABEL_ BYTES - Wire-format κ-label byte width under the default σ-axis (sha256) —
len("sha256:") + 64 = 71. - UOR_
ADDR_ MAX_ LABEL_ BYTES - Widest κ-label byte width across the admissible σ-axes (keccak256 →
len("keccak256:") + 64 = 74). A*_with_hashoutput buffer sized to this fits every algorithm.
Functions§
- uor_
addr_ ⚠asn1 asn1realization — default σ-axis (SHA-256).- uor_
addr_ ⚠asn1_ with_ hash asn1realization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠asn1_ with_ witness asn1realization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠asn1_ with_ witness_ hash asn1realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠cbor cborrealization — default σ-axis (SHA-256).- uor_
addr_ ⚠cbor_ with_ hash cborrealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠cbor_ with_ witness cborrealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠cbor_ with_ witness_ hash cborrealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠codemodule codemodulerealization — default σ-axis (SHA-256).- uor_
addr_ ⚠codemodule_ with_ hash codemodulerealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠codemodule_ with_ witness codemodulerealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠codemodule_ with_ witness_ hash codemodulerealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠compose_ e6 - CS-E6 composition (label).
algoselects the σ-axis (operand width + composed axis);out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTESbytes. - uor_
addr_ ⚠compose_ e7 - CS-E7 composition (label).
algoselects the σ-axis (operand width + composed axis);out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTESbytes. - uor_
addr_ ⚠compose_ e8 - CS-E8 composition (label).
algoselects the σ-axis (operand width + composed axis);out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTESbytes. - uor_
addr_ ⚠compose_ e6_ with_ witness - CS-E6 composition (verifiable witness handle). See
uor_addr_compose_e6. - uor_
addr_ ⚠compose_ e7_ with_ witness - CS-E7 composition (verifiable witness handle). See
uor_addr_compose_e7. - uor_
addr_ ⚠compose_ e8_ with_ witness - CS-E8 composition (verifiable witness handle). See
uor_addr_compose_e8. - uor_
addr_ ⚠compose_ f4 - CS-F4 composition (label).
algoselects the σ-axis (operand width + composed axis);out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTESbytes. - uor_
addr_ ⚠compose_ f4_ with_ witness - CS-F4 composition (verifiable witness handle). See
uor_addr_compose_f4. - uor_
addr_ ⚠compose_ g2 - CS-G2 composition (label).
algoselects the σ-axis (operand width + composed axis);out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTESbytes. - uor_
addr_ ⚠compose_ g2_ with_ witness - CS-G2 composition (verifiable witness handle). See
uor_addr_compose_g2. - uor_
addr_ ⚠gguf ggufrealization — default σ-axis (SHA-256).- uor_
addr_ ⚠gguf_ with_ hash ggufrealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠gguf_ with_ witness ggufrealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠gguf_ with_ witness_ hash ggufrealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠grounded_ content_ fingerprint - Read the σ-projection content fingerprint into
out_digest(32 bytes for theHasher<32>axes, 64 for sha512). Sizeout_digestto 64. - uor_
addr_ ⚠grounded_ free - Free a Grounded handle. Null is a no-op; each handle is freed once.
- uor_
addr_ ⚠grounded_ kappa_ label - Read the κ-label this Grounded carries into
out_label(its width depends on the σ-axis; sizeout_labeltoUOR_ADDR_MAX_LABEL_BYTES). - uor_
addr_ ⚠grounded_ verify - Verify the witness by re-certifying its replay trace (no σ-axis
re-invocation) and write the recovered κ-label into
out_label. - uor_
addr_ ⚠json jsonrealization — default σ-axis (SHA-256).- uor_
addr_ ⚠json_ with_ hash jsonrealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠json_ with_ witness jsonrealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠json_ with_ witness_ hash jsonrealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠onnx onnxrealization — default σ-axis (SHA-256).- uor_
addr_ ⚠onnx_ with_ hash onnxrealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠onnx_ with_ witness onnxrealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠onnx_ with_ witness_ hash onnxrealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠ring ringrealization — default σ-axis (SHA-256).- uor_
addr_ ⚠ring_ with_ hash ringrealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠ring_ with_ witness ringrealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠ring_ with_ witness_ hash ringrealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠schema_ codemodule_ signed schema_codemodule_signedrealization — default σ-axis (SHA-256).- uor_
addr_ ⚠schema_ codemodule_ signed_ with_ hash schema_codemodule_signedrealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠schema_ codemodule_ signed_ with_ witness schema_codemodule_signedrealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠schema_ codemodule_ signed_ with_ witness_ hash schema_codemodule_signedrealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠schema_ document schema_documentrealization — default σ-axis (SHA-256).- uor_
addr_ ⚠schema_ document_ with_ hash schema_documentrealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠schema_ document_ with_ witness schema_documentrealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠schema_ document_ with_ witness_ hash schema_documentrealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠schema_ photo schema_photorealization — default σ-axis (SHA-256).- uor_
addr_ ⚠schema_ photo_ with_ hash schema_photorealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠schema_ photo_ with_ witness schema_photorealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠schema_ photo_ with_ witness_ hash schema_photorealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠sexp sexprealization — default σ-axis (SHA-256).- uor_
addr_ ⚠sexp_ with_ hash sexprealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠sexp_ with_ witness sexprealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠sexp_ with_ witness_ hash sexprealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).- uor_
addr_ ⚠xml xmlrealization — default σ-axis (SHA-256).- uor_
addr_ ⚠xml_ with_ hash xmlrealization under a caller-selected σ-axis (UOR_ADDR_HASH_*).out_labelmust be writable for at leastUOR_ADDR_MAX_LABEL_BYTES.- uor_
addr_ ⚠xml_ with_ witness xmlrealization — SHA-256 verifiable witness handle.- uor_
addr_ ⚠xml_ with_ witness_ hash xmlrealization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).