merkle

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: BSD-2-Clause Imports: 3 Imported by: 1

Documentation

Overview

package merkle provides hashing operations that can be used to verify a Sigsum log's Merkle tree. The exact hash strategy is defined in RFC 6962.

Index

Constants

View Source
const (
	HashSize = sha256.Size
)

Variables

This section is empty.

Functions

func VerifyConsistency

func VerifyConsistency(oldSize, newSize uint64, oldRoot, newRoot Hash, path []Hash) error

VerifyConsistency verifies that a Merkle tree is consistent. The algorithm used is in RFC 9162, §2.1.4.2. It is the same proof technique as RFC 6962.

func VerifyInclusion

func VerifyInclusion(leaf Hash, index, size uint64, root Hash, path []Hash) error

VerifyInclusion verifies that something is in a Merkle tree. The algorithm used is in RFC 9162, §2.1.3.2. It is the same proof technique as RFC 6962.

Types

type Hash

type Hash [HashSize]byte

func HashFn

func HashFn(b []byte) *Hash

func HashInteriorNode

func HashInteriorNode(left, right Hash) *Hash

func HashLeafNode

func HashLeafNode(leaf []byte) *Hash

type Prefix

type Prefix uint8
const (
	PrefixLeafNode Prefix = iota
	PrefixInteriorNode
)

Jump to

Keyboard shortcuts

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