merkle

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrArity = errors.New("inconsistant arity")
	ErrIndex = errors.New("index too high")
)

Functions

This section is empty.

Types

type Proof

type Proof struct {
	RootHash curve.Element
	Path     []TreeLevel
}

Proof stores a Merkle tree proof

func (Proof) Verify

func (mp Proof) Verify(root, leaf curve.Element) (bool, error)

Verify ensures leaf is a member of the tree defined by {root, Proof.Path}

type TreeLevel

type TreeLevel struct {
	Elements []curve.Element
	Index    int // position of the missing element
}

TreeLevel i-th level of a Merkle tree contains only the neigbours (the missing element is computed while rewinding the Merkle tree)

Jump to

Keyboard shortcuts

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