merkle

package
v0.6.4-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2019 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructProof

func ConstructProof(values []Root, index uint64, depth uint8) (branch []Root)

ConstructProof builds a merkle-branch of the given depth, as a proof of inclusion of the leaf (or something in the path to the root, with a smaller depth) at the given index (at that depth), for a list of leafs of a balanced binary hash-root-tree.

func MerkleRoot

func MerkleRoot(values []Root) Root

MerkleRoot merkleizes values (where len(values) is a power of two) and returns the Merkle root. Note that the leaves are not hashed.

func VerifyMerkleBranch

func VerifyMerkleBranch(leaf Root, branch []Root, depth uint64, index uint64, root Root) bool

VerifyMerkleBranch verifies that the given leaf is on the merkle branch at the given depth, at the index at that depth.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL