verification

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: 7 Imported by: 0

Documentation

Overview

Package verification contains verifiers for clients of the map to confirm entries are committed to.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapVerifier

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

MapVerifier verifies inclusion of key/values in a map.

func NewMapVerifier

func NewMapVerifier(tileFetch TileFetch, prefixStrata int, treeID int64, hash crypto.Hash) *MapVerifier

NewMapVerifier returns a MapVerifier for the map at the given location and with the configuration provided.

func (*MapVerifier) CheckInclusion

func (v *MapVerifier) CheckInclusion(rev int, key string, value []byte) ([]byte, error)

CheckInclusion confirms that the key & value are committed to by the map in the given directory, and returns the computed and confirmed root hash that commits to this.

type TileFetch

type TileFetch func(revision int, path []byte) (*batchmap.Tile, error)

TileFetch gets the tile at the specified path in the given map revision. There is currently an assumption that this is very fast and thus it looks up tiles one at a time. This can be replaced with a batch version if that assumption is invalidated (e.g. this method triggers network operations).

Jump to

Keyboard shortcuts

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