Function storage_proofs_core::gadgets::insertion::insert

source ยท
pub fn insert<Scalar: PrimeField, CS: ConstraintSystem<Scalar>>(
    cs: &mut CS,
    element: &AllocatedNum<Scalar>,
    bits: &[Boolean],
    elements: &[AllocatedNum<Scalar>],
) -> Result<Vec<AllocatedNum<Scalar>>, SynthesisError>
Expand description

Insert element after the nth 1-indexed element of elements, where path_bits represents n, least-significant bit first. The returned result contains a new vector of AllocatedNums with element inserted, and constraints are enforced. elements.len() + 1 must be a power of two.