merkle

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyProof

func VerifyProof(root Digest, index int, value []byte, proof []Digest) (valid bool, more bool)

VerifyProof verifies that the given value maps to the given index in the merkle-tree with the given root. It returns "more" if the value is not the last value in the merkle-tree.

Types

type Digest

type Digest = [32]byte

Digest is a 32-byte hash digest.

func Tree

func Tree(values [][]byte) Digest

Tree returns a the root of the merkle-tree of the given values.

func TreeWithProofs

func TreeWithProofs(values [][]byte) (Digest, [][]Digest)

TreeWithProofs returns a the root of the merkle-tree of the given values, along with merkle-proofs for each leaf.

Jump to

Keyboard shortcuts

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