Documentation ¶
Overview ¶
Package merkle provides Merkle tree manipulation functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Rehash ¶ added in v1.3.10
Rehash computes the proof based on the slice of NodeFetch structs, and the corresponding hashes of these nodes. The slices must be of the same length. The hc parameter computes node's hash based on hashes of its children.
Warning: The passed-in slice of hashes can be modified in-place.
Types ¶
type NodeFetch ¶
NodeFetch bundles a node ID with additional information on how to use the node to construct a proof.
func CalcConsistencyProofNodeAddresses ¶
CalcConsistencyProofNodeAddresses returns the tree node IDs needed to build a consistency proof between two specified tree sizes. All the returned nodes represent complete subtrees in the tree of size2 or above.
Use Rehash function to compose the proof after the node hashes are fetched.
func CalcInclusionProofNodeAddresses ¶
CalcInclusionProofNodeAddresses returns the tree node IDs needed to build an inclusion proof for a specified tree size and leaf index. All the returned nodes represent complete subtrees in the tree of this size or above.
Use Rehash function to compose the proof after the node hashes are fetched.
Directories ¶
Path | Synopsis |
---|---|
Package compact provides compact Merkle tree data structures.
|
Package compact provides compact Merkle tree data structures. |
Package coniks provides CONIKS hashing for maps.
|
Package coniks provides CONIKS hashing for maps. |
Package rfc6962 provides hashing functionality according to RFC6962.
|
Package rfc6962 provides hashing functionality according to RFC6962. |
Package smt contains the implementation of the sparse Merkle tree logic.
|
Package smt contains the implementation of the sparse Merkle tree logic. |
node
Package node implements a sparse Merkle tree node.
|
Package node implements a sparse Merkle tree node. |
Package testonly contains code and data for testing Merkle trees.
|
Package testonly contains code and data for testing Merkle trees. |