verifier

package
v0.0.0-...-02c3ccb Latest Latest
Warning

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

Go to latest
Published: May 22, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package verifier allows client to verify a tree proof.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNeighborsLen occurs when the neighbor list length is longer than
	// the maximum allowed value.
	ErrNeighborsLen = fmt.Errorf("Neighbors len > %d", sparse.IndexLen)
	// ErrIndexBit occurs when the string-formatted index contains an invalid
	// bit (character), i.e., other than '0' or '1'.
	ErrIndexBit = errors.New("Invalid index bit")
	// ErrInvalidProof occurs when the provided tree proof cannot be
	// verified. This can be caused by an invalid neighbor tree or root.
	ErrInvalidProof = errors.New("Invalid proof")
)

Functions

This section is empty.

Types

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

Verifier represents a sparse tree proof verifier object.

func New

func New(mapID int64, hasher sparse.TreeHasher) *Verifier

New returns a new tree proofs verifier object.

func (*Verifier) VerifyProof

func (v *Verifier) VerifyProof(neighbors [][]byte, index, leaf []byte, root sparse.Hash) error

VerifyProof verifies a tree proof of a given leaf at a given index based on the provided root and neighbor list

Jump to

Keyboard shortcuts

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