binary_tree

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeConstantDepthRoot

func ComputeConstantDepthRoot(blobs [][]byte, hashFunc func([]byte) crypto.Hash) crypto.Hash

ComputeConstantDepthRoot computes the root hash of a constant-depth Binary Merkle tree. Preprocesses data with leaf prefix and pads to power of 2 size, making it suitable for larger data items and constant-size proofs. Graypaper 0.5.4

func ComputeNode

func ComputeNode(blobs [][]byte, hashFunc func([]byte) crypto.Hash) []byte

ComputeNode Computes the Merkle node for a given sequence of blobs.

func ComputeTrace

func ComputeTrace(blobs [][]byte, index int, hashFunc func([]byte) crypto.Hash) [][]byte

func ComputeWellBalancedRoot

func ComputeWellBalancedRoot(blobs [][]byte, hashFunc func([]byte) crypto.Hash) crypto.Hash

ComputeWellBalancedRoot computes the root hash of a well-balanced Binary Merkle tree. Suitable for data not much greater than 32 octets in length as it avoids hashing each item in the sequence.

func GeneratePageProof

func GeneratePageProof(blobs [][]byte, pageIndex, x int, hashFunc func([]byte) crypto.Hash) []crypto.Hash

GeneratePageProof implements Jx (Merkle path to a single page). Graypaper 0.5.4

func GetLeafPage

func GetLeafPage(blobs [][]byte, pageIndex, x int, hashFunc func([]byte) crypto.Hash) []crypto.Hash

GetLeafPage implements Lx (retrieves a single page of hashed leaves). Graypaper 0.5.4

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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