Trait snarkvm_wasm::prelude::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<G, F, GG> ConditionalEqGadget<F> for GroupEncryptionCiphertextGadget<G, F, GG> where
G: Group + ProjectiveCurve,
F: Field,
GG: CompressedGroupGadget<G, F>, impl<G, F, GG> ConditionalEqGadget<F> for GroupEncryptionPlaintextGadget<G, F, GG> where
G: Group,
F: Field,
GG: GroupGadget<G, F>, impl<G, F, GG> ConditionalEqGadget<F> for GroupEncryptionPublicKeyGadget<G, F, GG> where
G: Group,
F: Field,
GG: GroupGadget<G, F>, impl<G, F, GG> ConditionalEqGadget<F> for SchnorrPublicKeyGadget<G, F, GG> where
G: Group,
F: Field,
GG: GroupGadget<G, F>, impl<P> ConditionalEqGadget<<P as Bls12Parameters>::Fp> for G1PreparedGadget<P> where
P: Bls12Parameters, impl<P> ConditionalEqGadget<<P as Bls12Parameters>::Fp> for G2PreparedGadget<P> where
P: Bls12Parameters, 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<P, F, FG> ConditionalEqGadget<F> for snarkvm_wasm::curves::templates::bls12::AffineGadget<P, F, FG> where
P: SWModelParameters,
F: Field,
FG: FieldGadget<<P as ModelParameters>::BaseField, F>, impl<P, F, FG> ConditionalEqGadget<F> for snarkvm_wasm::curves::templates::twisted_edwards::AffineGadget<P, F, FG> where
P: TEModelParameters,
F: Field,
FG: FieldGadget<<P as ModelParameters>::BaseField, F>, impl<TargetField, BaseField> ConditionalEqGadget<BaseField> for NonNativeFieldVar<TargetField, BaseField> where
BaseField: PrimeField,
TargetField: PrimeField,