merkle

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HashLength     = 32
	SubProofLength = HashLength + 1
)

Variables

This section is empty.

Functions

func VerifyMainProof

func VerifyMainProof(rowId [4]byte, userId [8]byte, mainRoot, proof []byte) bool

func VerifySubProof

func VerifySubProof(rowId [4]byte, proof []byte) (bool, error)

Types

type MainTree

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

func NewMainTree

func NewMainTree(input map[[8]byte][][4]byte) (*MainTree, error)

func (*MainTree) GenerateProof

func (mt *MainTree) GenerateProof(rowId [4]byte, userId [8]byte) ([]byte, error)

func (*MainTree) Leaves

func (mt *MainTree) Leaves() map[[8]byte][][4]byte

func (*MainTree) Root

func (mt *MainTree) Root() common.Hash

type SubTree

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

func NewSubTree

func NewSubTree(input [][4]byte) (*SubTree, error)

func (*SubTree) GenerateProof

func (st *SubTree) GenerateProof(rowId [4]byte) ([]byte, error)

func (*SubTree) Leaves

func (st *SubTree) Leaves() [][4]byte

func (*SubTree) Root

func (st *SubTree) Root() common.Hash

Jump to

Keyboard shortcuts

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