Crate tree_hash

Source

Modules§

impls

Macros§

tree_hash_ssz_encoding_as_list
tree_hash_ssz_encoding_as_vector

Structs§

MerkleHasher
Provides a Merkle-root hasher that allows for streaming bytes (i.e., providing any-length byte slices without need to separate into leaves). Efficiently handles cases where not all leaves have been provided by assuming all non-provided leaves are [0; 32] and pre-computing the zero-value hashes at all depths of the tree.

Enums§

Error
TreeHashType

Constants§

BYTES_PER_CHUNK
HASHSIZE
MAX_UNION_SELECTOR
MERKLE_HASH_CHUNK
SMALLVEC_SIZE

Traits§

TreeHash

Functions§

merkle_root
Convenience method for MerkleHasher which also provides some fast-paths for small trees.
merkleize_padded
Merkleize bytes and return the root, optionally padding the tree out to min_leaves number of leaves.
merkleize_standard
Merkleizes bytes and returns the root, using a simple algorithm that does not optimize to avoid processing or storing padding bytes.
mix_in_length
Returns the node created by hashing root and length.
mix_in_selector
Returns Some(root) created by hashing root and selector, if selector <= MAX_UNION_SELECTOR. Otherwise, returns None.

Type Aliases§

Hash256
PackedEncoding