Domain separation prefixes
const ( RFC6962LeafHashPrefix = 0 RFC6962NodeHashPrefix = 1 )
DefaultHasher is a SHA256 based LogHasher.
var DefaultHasher = New(crypto.SHA256)
Hasher implements the RFC6962 tree hashing algorithm.
type Hasher struct { crypto.Hash }
func New(h crypto.Hash) *Hasher
New creates a new Hashers.LogHasher on the passed in hash function.
func (t *Hasher) EmptyRoot() []byte
EmptyRoot returns a special case for an empty tree.
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 (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.