rfc6962

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package rfc6962 provides hashing functionality according to RFC6962.

Deprecated: This package is superseded by the corresponding functionality in https://github.com/transparency-dev/merkle. It will be removed in future releases of Trillian.

Index

Constants

View Source
const (
	RFC6962LeafHashPrefix = 0
	RFC6962NodeHashPrefix = 1
)

Domain separation prefixes

Variables

View Source
var DefaultHasher = New(crypto.SHA256)

DefaultHasher is a SHA256 based LogHasher.

Functions

This section is empty.

Types

type Hasher

type Hasher struct {
	crypto.Hash
}

Hasher implements the RFC6962 tree hashing algorithm.

func New

func New(h crypto.Hash) *Hasher

New creates a new Hashers.LogHasher on the passed in hash function.

func (*Hasher) EmptyRoot

func (t *Hasher) EmptyRoot() []byte

EmptyRoot returns a special case for an empty tree.

func (*Hasher) HashChildren

func (t *Hasher) HashChildren(l, r []byte) []byte

HashChildren returns the inner Merkle tree node hash of the two child nodes l and r. The hashed structure is NodeHashPrefix||l||r.

func (*Hasher) HashLeaf

func (t *Hasher) HashLeaf(leaf []byte) []byte

HashLeaf returns the Merkle tree leaf hash of the data passed in through leaf. The data in leaf is prefixed by the LeafHashPrefix.

Jump to

Keyboard shortcuts

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