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 ¶
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.
Click to show internal directories.
Click to hide internal directories.