Trait snarkvm_wasm::traits::ConditionalEqGadget [−][src]
pub trait ConditionalEqGadget<F>: Eq where
F: Field, { fn conditional_enforce_equal<CS>(
&self,
cs: CS,
other: &Self,
condition: &Boolean
) -> Result<(), SynthesisError>
where
CS: ConstraintSystem<F>; fn cost() -> usize; }
Expand description
If condition == 1
, then enforces that self
and other
are equal;
otherwise, it doesn’t enforce anything.
Required methods
fn conditional_enforce_equal<CS>(
&self,
cs: CS,
other: &Self,
condition: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
Implementations on Foreign Types
pub fn conditional_enforce_equal<CS>(
&self,
cs: CS,
other: &[T],
condition: &Boolean
) -> Result<(), SynthesisError> where
CS: ConstraintSystem<F>,
Implementors
impl<P, F> ConditionalEqGadget<F> for Fp2Gadget<P, F> where
P: Fp2Parameters<Fp = F>,
F: PrimeField,
impl<P, F> ConditionalEqGadget<F> for Fp6Gadget<P, F> where
P: Fp6Parameters,
F: PrimeField,
<P as Fp6Parameters>::Fp2Params: Fp2Parameters,
<<P as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp == F,
impl<P, F> ConditionalEqGadget<F> for Fp12Gadget<P, F> where
P: Fp12Parameters,
F: PrimeField,
<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params: Fp2Parameters,
<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp == F,
impl<TargetField, BaseField> ConditionalEqGadget<BaseField> for NonNativeFieldVar<TargetField, BaseField> where
BaseField: PrimeField,
TargetField: PrimeField,