oa::crypto::merkle
Module published by the oa::crypto module.
MdRust public API
Public Types
Public Functions
Function Documentation
Build retained device tree levels using the selected parent hash. Leaves are prehashed U8/U32 rows with the algorithm’s exact digest extent. Poseidon2 nodes use OA’s versioned field framing, not NVIDIA wire semantics. Errors Rejects dtype, rank, extent, leaf count, allocation or recording failures.
Produce version-two inclusion frames for U32 [batch] leaf indices. Frames carry the original count, index, hash identity and validity flag. Out-of-range indices produce invalid, completely zero sibling paths. Errors Rejects dtype, rank, ownership, address limits, allocation or recording failures.
Compute roots of contiguous power-of-two subtrees for hierarchical construction. Records the first log2(subtree_leaves) tree levels. The returned rows can be passed to build to finish the tree; no leaf readback/repacking is involved. Errors Rejects dtype, rank, extent, partition sizes, allocation or recording failures.
Verify inclusion frames against roots and an independently trusted leaf count. Roots may contain one shared digest or one digest per proof. Malformed headers, identity/count mismatches and changed sibling paths return zero. Errors Rejects metadata, ownership, address limits, allocation or recording failures.