Expand description
SSZ merkleization primitives.
All hashes are 32-byte digests, threaded through the [digest::Digest]
trait with OutputSize = U32. No domain bytes or prefixes are mixed in
at the node level — concatenation is the only operation.
Functions§
- ceil_
log2 - Returns
ceil(log2(max(1, n))). - hash_
pair - Hash two 32-byte children into their parent node.
- leaves_
at_ depth - Number of leaves in a balanced tree of
depthlevels. - merkleize
- SSZ
merkleize— padchunkstomax(limit, chunks.len())rounded up to the next power of two, build a balanced binary tree usinghash(left || right), and return the root. - mix_
in_ length mix_in_length(root, len) = hash(root || u256_le(len)).- mix_
in_ selector mix_in_selector(root, sel) = hash(root || u256_le(sel)).- pack_
bytes - Pack a byte slice into 32-byte chunks, zero-padding the tail.
- zero_
hash - Cached zero-hash table:
zero_hash(d) = hash(zero_hash(d-1), zero_hash(d-1)), withzero_hash(0) == [0u8; 32].