Module storage_proofs_core::gadgets::insertion[][src]

Expand description

Insertion Permutation

Insert an AllocatedNum into a sequence of AllocatedNums at an arbitrary position. This can be thought of as a generalization of AllocatedNum::conditionally_reverse and reduces to it in the binary case.

Functions

insert

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.

insert_2
insert_4
insert_8
pick

Takes two allocated numbers (a, b) and returns a if the condition is true, and b otherwise.

select

Select the nth element of from, where path_bits represents n, least-significant bit first. The returned result contains the selected element, and constraints are enforced. from.len() must be a power of two.