Skip to main content

Module verifier

Module verifier 

Source

Structs§

KeyRecord
A key chain record returned by GET /api/keys.

Functions§

leaf_hash
Returns SHA-256(0x00 || data). See docs/wire-format.md §3.
node_hash
Returns SHA-256(0x01 || left || right). See docs/wire-format.md §3.
signing_payload
Returns the canonical 48-byte signing payload for a Signed Tree Head. Layout: tree_size (u64 BE, 8 bytes) || root_hash (32 bytes) || timestamp_ns (i64 BE, 8 bytes). See docs/wire-format.md §5.2.
verify_consistency
Verifies an RFC 6962 consistency proof. Returns true iff the tree of old_size with root old_root is a prefix of the tree of new_size with root new_root.
verify_inclusion
Verifies an RFC 6962 inclusion proof. Returns true iff leaf at leaf_index in a tree of tree_size with the given proof hashes produces root.
verify_tree_head
Verifies the Ed25519 signature on a Signed Tree Head. public_key must be 32 raw bytes; signature must be 64 raw bytes.
verify_tree_head_sequential
Verifies an STH and enforces that its timestamp is strictly later than previous_timestamp_ns. Returns false if timestamp_ns <= previous_timestamp_ns or if the signature is invalid. Use this when processing a sequence of STHs to guard against replayed or out-of-order tree heads.
verify_tree_head_with_chain
Verifies an STH against a key chain. Finds the record whose version matches key_version and verifies the signature with that record’s public key.