package hasher
import "github.com/google/trillian/merkle/coniks/hasher"
Package hasher provides CONIKS hashing for maps.
Index ¶
Variables ¶
var ( // Default is the standard CONIKS hasher. Default = New(crypto.SHA512_256) )
Domain separation prefixes
Types ¶
type Hasher ¶
Hasher implements the sparse merkle tree hashing algorithm specified in the CONIKS paper.
func New ¶
New creates a new hashers.TreeHasher using the passed in hash function.
func (*Hasher) BitLen ¶
BitLen returns the number of bits in the hash function.
func (*Hasher) EmptyRoot ¶
EmptyRoot returns the root of an empty tree.
func (*Hasher) HashChildren ¶
HashChildren returns the internal Merkle tree node hash of the the two child nodes l and r. The hashed structure is H(l || r).
func (*Hasher) HashEmpty ¶
HashEmpty returns the hash of an empty subtree of the given height at the position defined by the BitLen()-height most significant bits of the given index. Note that a height of 0 indicates a leaf.
func (*Hasher) HashLeaf ¶
HashLeaf calculate the merkle tree leaf value: H(Identifier || treeID || depth || index || dataHash)
Source Files ¶
- Version
- v1.3.13
- Published
- Feb 16, 2021
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 3 hours ago –
Tools for package owners.