Documentation
¶
Index ¶
- func ConsistencyProof(start, end, treeSize int64, reader tlog.HashReader) ([]tlog.Hash, error)
- func HashFromProof(entryHash tlog.Hash, proof []tlog.Hash, entryIndex, start, end int64) (tlog.Hash, error)
- func MTH(leaves []tlog.Hash) tlog.Hash
- func VerifyConsistency(start, end, n int64, proof []tlog.Hash, nodeHash, rootHash tlog.Hash) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsistencyProof ¶
ConsistencyProof returns SUBTREE_PROOF(start, end, D_n) for the tree of size treeSize, reading stored hashes through the provided reader, per the MTC draft section 4.4.1 Generating a Subtree Consistency Proof, detailed further in the draft's Appendix B.4. [start, end) must be a valid subtree with end <= treeSize.
func HashFromProof ¶ added in v0.20261006.0
func HashFromProof(entryHash tlog.Hash, proof []tlog.Hash, entryIndex, start, end int64) (tlog.Hash, error)
HashFromProof returns a subtree hash given an entry hash and an inclusion proof across a subtree of some Merkle tree.
func MTH ¶ added in v0.20260728.0
MTH emits the Merkle Tree Hash of its inputs, as defined in RFC 9162 section 2.1.1.
https://www.rfc-editor.org/info/rfc9162/#name-definition-of-the-merkle-tr
func VerifyConsistency ¶
VerifyConsistency reports whether proof shows that the subtree [start, end), whose hash is nodeHash, sits at those positions in the tree of size n with root rootHash. It follows the procedure in MTC draft section 4.4.3, detailed further in the draft's Appendix B.5.
Types ¶
This section is empty.