Function snarkvm_gadgets::algorithms::merkle_tree::masked_tree::compute_root[][src]

pub fn compute_root<H: CRH, HG: MaskedCRHGadget<H, F>, F: PrimeField, TB: ToBytesGadget<F>, CS: ConstraintSystem<F>>(
    cs: CS,
    parameters: &HG::ParametersGadget,
    mask_parameters: &HG::ParametersGadget,
    mask: &TB,
    leaves: &[HG::OutputGadget]
) -> Result<HG::OutputGadget, SynthesisError>
Expand description

Computes a root given leaves. Uses a nonce to mask the computation, to ensure amortization resistance. Assumes the number of leaves is for a full tree, so it hashes the leaves until there is only one element.