Trait snarkvm_wasm::prelude::CondSelectGadget [−][src]
pub trait CondSelectGadget<F> where
F: Field, { fn conditionally_select<CS>(
cs: CS,
cond: &Boolean,
first: &Self,
second: &Self
) -> Result<Self, SynthesisError>
where
CS: ConstraintSystem<F>; fn cost() -> usize; }
Expand description
If condition is true
, return first
; else, select second
.
Required methods
fn conditionally_select<CS>(
cs: CS,
cond: &Boolean,
first: &Self,
second: &Self
) -> Result<Self, SynthesisError> where
CS: ConstraintSystem<F>,
Implementors
impl<P, F> CondSelectGadget<F> for Fp2Gadget<P, F> where
F: PrimeField,
P: Fp2Parameters<Fp = F>,
impl<P, F> CondSelectGadget<F> for Fp6Gadget<P, F> where
F: PrimeField,
P: Fp6Parameters,
<P as Fp6Parameters>::Fp2Params: Fp2Parameters,
<<P as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp == F,
impl<P, F> CondSelectGadget<F> for Fp12Gadget<P, F> where
F: PrimeField,
P: Fp12Parameters,
<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params: Fp2Parameters,
<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp == F,
impl<TargetField, BaseField> CondSelectGadget<BaseField> for NonNativeFieldVar<TargetField, BaseField> where
BaseField: PrimeField,
TargetField: PrimeField,
impl<TargetField, BaseField> CondSelectGadget<BaseField> for AllocatedNonNativeFieldVar<TargetField, BaseField> where
BaseField: PrimeField,
TargetField: PrimeField,