Function plonk_gadgets::scalar::conditionally_select_one[][src]

pub fn conditionally_select_one(
    composer: &mut StandardComposer,
    y: Variable,
    selector: Variable
) -> Variable
Expand description

Conditionally selects the value provided or a one instead. NOTE that the select input has to be previously constrained to be either one or zero.

Performs:

y’ = y if selector = 1 y’ = 1 if selector = 0 => y’ = selector * y + (1 - selector)