darkfi_sdk::crypto::smt

Function gen_empty_nodes

Source
pub fn gen_empty_nodes<const M: usize, F: FieldElement, H: FieldHasher<F, 2>>(
    hasher: &H,
    empty_leaf: F,
) -> [F; M]
Expand description

A function to generate empty hashes with a given default_leaf.

Given a FieldHasher, generate a list of N hashes consisting of the default_leaf hashed with itself and repeated N times with the intermediate results. These are used to initialize the sparse portion of the SMT.

Ordering is depth-wise starting from root going down.