mamamerkle

package module
v0.0.0-...-bd379c1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2018 License: BSD-3-Clause Imports: 8 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

mamamerkle

Sparse Merkle Trees implementation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SparseMerkleTree

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

func NewSparseMerkleTree

func NewSparseMerkleTree(depth int64, leaves map[uint64][]byte) (*SparseMerkleTree, error)

func (*SparseMerkleTree) CreateDefaultNodes

func (smt *SparseMerkleTree) CreateDefaultNodes(depth int64) [][]byte

func (*SparseMerkleTree) CreateMerkleProof

func (smt *SparseMerkleTree) CreateMerkleProof(leafId uint64) []byte

CreateMerkleProof generates a merkle proof for a leaf.

func (*SparseMerkleTree) CreateTree

func (smt *SparseMerkleTree) CreateTree(orderedLeaves *ordered_map.OrderedMap, depth int64, defaultNodes [][]byte) []*ordered_map.OrderedMap

func (*SparseMerkleTree) Depth

func (smt *SparseMerkleTree) Depth() int64

func (*SparseMerkleTree) Leaves

func (smt *SparseMerkleTree) Leaves() *ordered_map.OrderedMap

func (*SparseMerkleTree) Root

func (smt *SparseMerkleTree) Root() []byte

func (*SparseMerkleTree) Verify

func (smt *SparseMerkleTree) Verify(leafId uint64, proof []byte) (bool, error)

Verify checks if the proof for the given leaf is valid.

Jump to

Keyboard shortcuts

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