Skip to main content

select

Function select 

Source
pub fn select(
    builder: &CircuitBuilder,
    cond: Wire,
    t: &BigUint,
    f: &BigUint,
) -> BigUint
Expand description

Conditionally selects between two equal-sized BigUints.

§Arguments

  • builder - Circuit builder for constraint generation
  • cond - an MSB-boolean
  • t - Value to select when cond is true (MSB=1)
  • f - Value to select when cond is false (MSB=0)

§Return value

Selects t if cond is true, otherwise selects f.

§Panics

Panics if t and f have different number of limbs.