Function tree_hash::mix_in_selector

source ·
pub fn mix_in_selector(root: &Hash256, selector: u8) -> Option<Hash256>
Expand description

Returns Some(root) created by hashing root and selector, if selector <= MAX_UNION_SELECTOR. Otherwise, returns None.

Used in TreeHash for the “union” type.

Specification

mix_in_selector: Given a Merkle root root and a type selector selector ("uint256" little-endian
serialization) return hash(root + selector).

https://github.com/ethereum/consensus-specs/blob/v1.1.0-beta.3/ssz/simple-serialize.md#union