mt

package
v0.0.0-...-0a5e2f9 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

In-memory Merkle Tree which implements an authenticated list.

Index

Constants

This section is empty.

Variables

View Source
var InternalSeparator = []byte("MT::InternalNode")
View Source
var LeafSeparator = []byte("MT::LeafNode")
View Source
var MerklePlaceholderDigest = Digest([]byte("MERKLE_PLACEHOLDER_HASH_________"))

Functions

func Verify

func Verify(expectedRootDigest Digest, index uint64, leafPreimage []byte, proof []Digest) error

Verify verifies that leafPreimage is preimage of the index-th leaf in the Merkle tree rooted at expectedRootDigest.

Types

type Digest

type Digest = [sha256.Size]byte

func Prove

func Prove(leafPreimages [][]byte, index uint64) ([]Digest, error)

Prove generates a Merkle inclusion proof that the leafPreimage at index is included in the tree rooted at Root(leafPreimages).

func Root

func Root(leafPreimages [][]byte) Digest

Root computes the Merkle tree root from leaf preimages.

Jump to

Keyboard shortcuts

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