Skip to main content

Module validate

Module validate 

Source
Expand description

Structural validation of untrusted images.

Validation is total and fail-closed: every byte of the buffer is accounted for before any caller receives a node, a string, a blob or a crate::view::InfinityView. The checker enforces the canonical form as well as safety — sorted symbol tables, zeroed padding, zeroed unused record fields — so a validated image cannot carry covert payload in slack space, and a validated image re-encodes to itself.

Work is bounded by Limits: counts are checked against the remaining bytes before allocation, traversals are iterative (no recursion), and every reference is bounds-checked.

Structs§

Validated
A validated image plus zero-copy accessors.

Functions§

is_hash_entry
Report whether a value is a hash provenance entry (helper for projections).
provenance_hash_of
Parse a provenance block from bytes already validated (used by tests).
validate
Validate a buffer with the default options.
validate_canonical
Validate and additionally prove buf is exactly the canonical encoding of its own content.
validate_with
Validate a buffer with explicit options.