Documentation
¶
Overview ¶
Package verify is a dependency-light, standalone verifier for Bide audit proofs. It depends on nothing but the Go standard library (crypto/sha256, crypto/ed25519, encoding/binary, bytes, math/bits), deliberately NOT the agent core or gsm, so a third party (an auditor, a regulator) can verify a proof without importing the SDK, or reimplement this file from RFC 6962 and check us against it. That is what "verifiable without trusting the vendor" means in practice.
It operates on canonical LEAF BYTES, not typed records, precisely so it needs no domain types. The leaf for a journal record is the record's canonical JSON (what the audit package hashes); the caller supplies those bytes. The algorithms mirror the audit package exactly and are cross-checked against it in the tests, so the intentional duplication cannot drift.
This mirror is verification-only, by design: it can check a proof, never mint one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Consistency ¶
Consistency runs the RFC 6962 §2.1.2 consistency-proof algorithm: reports whether firstRoot (over the first `first` leaves) is an append-only prefix of laterRoot (over `size` leaves).
func Inclusion ¶
Inclusion runs the RFC 6962 §2.1.1 inclusion-proof algorithm: leaf is the canonical leaf bytes, index/size locate it in the tree, path is the sibling hashes leaf-to-root, and root is the committed Merkle root (an STH's Root). Reports whether leaf is provably at index in a size-leaf tree committed by root.
func TreeHead ¶
TreeHead reports whether sig is a valid Ed25519 signature, under pub, of the signed tree head committing to (root, size, timestamp). The canonical encoding is domain-separated and length-prefixed, byte-identical to audit.TreeHead.canonical(), so an STH signed by the SDK verifies here and vice versa.
Types ¶
This section is empty.