Skip to main content

Crate uor_addr_c

Crate uor_addr_c 

Source
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 least UOR_ADDR_LABEL_BYTES = 71 bytes.
  • out_written — written with the number of bytes the function emitted (always 71 on success). May be NULL (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§

UorAddrGrounded
Opaque, foreign-managed witness handle. Construct via any uor_addr_*_with_witness[_hash] function; release with uor_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, or out_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 -4 handlers in downstream C consumers keep compiling.
UOR_ADDR_ERR_UNKNOWN_HASH
Unknown σ-axis selector passed to a *_with_hash entry point (not one of the UOR_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 to UOR_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_BLAKE3
σ-axis selector: BLAKE3.
UOR_ADDR_HASH_KECCAK256
σ-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_hash entry 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_hash output buffer sized to this fits every algorithm.

Functions§

uor_addr_asn1
asn1 realization — default σ-axis (SHA-256).
uor_addr_asn1_with_hash
asn1 realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_asn1_with_witness
asn1 realization — SHA-256 verifiable witness handle.
uor_addr_asn1_with_witness_hash
asn1 realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).
uor_addr_cbor
cbor realization — default σ-axis (SHA-256).
uor_addr_cbor_with_hash
cbor realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_cbor_with_witness
cbor realization — SHA-256 verifiable witness handle.
uor_addr_cbor_with_witness_hash
cbor realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).
uor_addr_codemodule
codemodule realization — default σ-axis (SHA-256).
uor_addr_codemodule_with_hash
codemodule realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_codemodule_with_witness
codemodule realization — SHA-256 verifiable witness handle.
uor_addr_codemodule_with_witness_hash
codemodule realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).
uor_addr_compose_e6
CS-E6 composition (label). algo selects the σ-axis (operand width + composed axis); out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES bytes.
uor_addr_compose_e7
CS-E7 composition (label). algo selects the σ-axis (operand width + composed axis); out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES bytes.
uor_addr_compose_e8
CS-E8 composition (label). algo selects the σ-axis (operand width + composed axis); out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES bytes.
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). algo selects the σ-axis (operand width + composed axis); out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES bytes.
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). algo selects the σ-axis (operand width + composed axis); out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES bytes.
uor_addr_compose_g2_with_witness
CS-G2 composition (verifiable witness handle). See uor_addr_compose_g2.
uor_addr_gguf
gguf realization — default σ-axis (SHA-256).
uor_addr_gguf_with_hash
gguf realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_gguf_with_witness
gguf realization — SHA-256 verifiable witness handle.
uor_addr_gguf_with_witness_hash
gguf realization — 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 the Hasher<32> axes, 64 for sha512). Size out_digest to 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; size out_label to UOR_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
json realization — default σ-axis (SHA-256).
uor_addr_json_with_hash
json realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_json_with_witness
json realization — SHA-256 verifiable witness handle.
uor_addr_json_with_witness_hash
json realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).
uor_addr_onnx
onnx realization — default σ-axis (SHA-256).
uor_addr_onnx_with_hash
onnx realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_onnx_with_witness
onnx realization — SHA-256 verifiable witness handle.
uor_addr_onnx_with_witness_hash
onnx realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).
uor_addr_ring
ring realization — default σ-axis (SHA-256).
uor_addr_ring_with_hash
ring realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_ring_with_witness
ring realization — SHA-256 verifiable witness handle.
uor_addr_ring_with_witness_hash
ring realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).
uor_addr_schema_codemodule_signed
schema_codemodule_signed realization — default σ-axis (SHA-256).
uor_addr_schema_codemodule_signed_with_hash
schema_codemodule_signed realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_schema_codemodule_signed_with_witness
schema_codemodule_signed realization — SHA-256 verifiable witness handle.
uor_addr_schema_codemodule_signed_with_witness_hash
schema_codemodule_signed realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).
uor_addr_schema_document
schema_document realization — default σ-axis (SHA-256).
uor_addr_schema_document_with_hash
schema_document realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_schema_document_with_witness
schema_document realization — SHA-256 verifiable witness handle.
uor_addr_schema_document_with_witness_hash
schema_document realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).
uor_addr_schema_photo
schema_photo realization — default σ-axis (SHA-256).
uor_addr_schema_photo_with_hash
schema_photo realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_schema_photo_with_witness
schema_photo realization — SHA-256 verifiable witness handle.
uor_addr_schema_photo_with_witness_hash
schema_photo realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).
uor_addr_sexp
sexp realization — default σ-axis (SHA-256).
uor_addr_sexp_with_hash
sexp realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_sexp_with_witness
sexp realization — SHA-256 verifiable witness handle.
uor_addr_sexp_with_witness_hash
sexp realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).
uor_addr_xml
xml realization — default σ-axis (SHA-256).
uor_addr_xml_with_hash
xml realization under a caller-selected σ-axis (UOR_ADDR_HASH_*). out_label must be writable for at least UOR_ADDR_MAX_LABEL_BYTES.
uor_addr_xml_with_witness
xml realization — SHA-256 verifiable witness handle.
uor_addr_xml_with_witness_hash
xml realization — verifiable witness handle under a caller-selected σ-axis (UOR_ADDR_HASH_*).