Skip to main content

Module cbor_audit

Module cbor_audit 

Source
Expand description

Raw-byte CBOR deterministic-encoding audit.

Validates RFC 8949 core deterministic encoding constraints at the byte level BEFORE ciborium deserializes (which resolves indefinite lengths and non-minimal integers transparently, destroying the evidence).

Enforces:

  • No indefinite-length maps (0xBF), arrays (0x9F), or byte/text strings (0x7B, 0x5F, 0x3F)
  • No CBOR tags (major type 6: 0xC0–0xDB)
  • No floating-point values (major type 7 simple: 0xF9, 0xFA, 0xFB for half/single/double)
  • Definite-length integers are minimal (no non-minimal encodings)
  • No trailing bytes (for top-level items)

Returns Ok(()) if the bytes conform to RFC 8949 core deterministic encoding. Returns Err with a description of the violation otherwise.

Functions§

audit_deterministic
Audit a complete CBOR byte string for deterministic-encoding compliance. Rejects trailing data.