mmr

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InclusionProof

type InclusionProof struct {
	LeafIndex uint64
	LeafHash  crypto.Hash
	Siblings  []crypto.Hash
	Peaks     []crypto.Hash
	MMRSize   uint64
}

type MMR

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

func NewMMR

func NewMMR() *MMR

func NewMMRFromSnapshot

func NewMMRFromSnapshot(snapshot Snapshot) (*MMR, error)

func (*MMR) AddLeaf

func (mmr *MMR) AddLeaf(leaf []byte) crypto.Hash

func (*MMR) GenerateInclusionProof

func (mmr *MMR) GenerateInclusionProof(leafIndex uint64) (*InclusionProof, error)

func (*MMR) LeafIndex added in v0.2.0

func (mmr *MMR) LeafIndex(leaf []byte) (uint64, error)

func (*MMR) NumLeaves

func (mmr *MMR) NumLeaves() uint64

func (*MMR) NumPeaks

func (mmr *MMR) NumPeaks() uint64

func (*MMR) Restore

func (mmr *MMR) Restore(snapshot Snapshot) error

func (*MMR) Root

func (mmr *MMR) Root() crypto.Hash

func (*MMR) Size

func (mmr *MMR) Size() uint64

func (*MMR) Snapshot

func (mmr *MMR) Snapshot() Snapshot

func (*MMR) VerifyInclusionProof

func (mmr *MMR) VerifyInclusionProof(proof *InclusionProof) bool

type Snapshot

type Snapshot []byte

Jump to

Keyboard shortcuts

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