verify

package
v0.0.0-...-d12bbc4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package verify supports verification that the downloaded contents match the root hash commitment made in a log checkpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LeafHashFn

type LeafHashFn func(index uint64, data []byte) []byte

LeafHashFn returns the leaf hash (commitment) to the given preimage at the given log index.

type LogVerifier

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

LogVerifier calculates the Merkle root of a log.

func NewLogVerifier

func NewLogVerifier(db *logdb.Database, lh LeafHashFn, ih compact.HashFn) LogVerifier

NewLogVerifier returns a LogVerifier which obtains raw leaves from `db`, and uses the given hash functions to construct a merkle tree.

func (LogVerifier) MerkleRoot

func (v LogVerifier) MerkleRoot(ctx context.Context, size uint64) ([]byte, [][]byte, error)

MerkleRoot calculates the Merkle root hash of its log at the given size.

Jump to

Keyboard shortcuts

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