rfc6962

package
v0.0.0-...-f1c747c Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package rfc6962 provides hashing functionality according to RFC6962.

Index

Constants

View Source
const (
	RFC6962LeafHashPrefix = 0
	RFC6962NodeHashPrefix = 1
)

Domain separation prefixes

Variables

View Source
var Hasher = &TreeHasher{Hash: crypto.SHA256}

Hasher is a SHA256 based TreeHasher.

Functions

This section is empty.

Types

type TreeHasher

type TreeHasher struct {
	crypto.Hash
}

TreeHasher implements the RFC6962 tree hashing algorithm.

func (TreeHasher) HashChildren

func (t TreeHasher) HashChildren(l, r []byte) []byte

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

func (TreeHasher) HashEmpty

func (t TreeHasher) HashEmpty() []byte

HashEmpty returns the hash of an empty element for the tree

func (TreeHasher) HashLeaf

func (t TreeHasher) 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