Trait ark_r1cs_std::eq::EqGadget [−][src]
Specifies how to generate constraints that check for equality for two
variables of type Self
.
Required methods
fn is_eq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
[src]
Output a Boolean
value representing whether self.value() == other.value()
.
Provided methods
fn is_neq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
[src]
Output a Boolean
value representing whether self.value() != other.value()
.
By default, this is defined as self.is_eq(other)?.not()
.
fn conditional_enforce_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
If should_enforce == true
, enforce that self
and other
are equal;
else, enforce a vacuously true statement.
A safe default implementation is provided that generates the following
constraints: self.is_eq(other)?.conditional_enforce_equal(&Boolean: :TRUE, should_enforce)
.
More efficient specialized implementation may be possible; implementors are encouraged to carefully analyze the efficiency and safety of these.
fn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>
[src]
Enforce that self
and other
are equal.
A safe default implementation is provided that generates the following
constraints: self.conditional_enforce_equal(other, &Boolean::TRUE)
.
More efficient specialized implementation may be possible; implementors are encouraged to carefully analyze the efficiency and safety of these.
fn conditional_enforce_not_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
If should_enforce == true
, enforce that self
and other
are not
equal; else, enforce a vacuously true statement.
A safe default implementation is provided that generates the following
constraints: self.is_neq(other)?.conditional_enforce_equal(& Boolean::TRUE, should_enforce)
.
More efficient specialized implementation may be possible; implementors are encouraged to carefully analyze the efficiency and safety of these.
fn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>
[src]
Enforce that self
and other
are not equal.
A safe default implementation is provided that generates the following
constraints: self.conditional_enforce_not_equal(other, &Boolean::TRUE)
.
More efficient specialized implementation may be possible; implementors are encouraged to carefully analyze the efficiency and safety of these.
Implementations on Foreign Types
impl<T: EqGadget<F> + R1CSVar<F>, F: Field> EqGadget<F> for [T]
[src]
fn is_eq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
[src]
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<F>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<F>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
Implementors
impl<BF, P> EqGadget<<P as CubicExtParameters>::BasePrimeField> for CubicExtVar<BF, P> where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: CubicExtVarParams<BF>,
[src]
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: CubicExtVarParams<BF>,
fn is_eq(
&self,
other: &Self
) -> Result<Boolean<P::BasePrimeField>, SynthesisError>
[src]
&self,
other: &Self
) -> Result<Boolean<P::BasePrimeField>, SynthesisError>
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<P::BasePrimeField>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<P::BasePrimeField>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<P::BasePrimeField>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<P::BasePrimeField>
) -> Result<(), SynthesisError>
impl<BF, P> EqGadget<<P as QuadExtParameters>::BasePrimeField> for QuadExtVar<BF, P> where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'b BF: FieldOpsBounds<'b, P::BaseField, BF>,
P: QuadExtVarParams<BF>,
[src]
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'b BF: FieldOpsBounds<'b, P::BaseField, BF>,
P: QuadExtVarParams<BF>,
fn is_eq(
&self,
other: &Self
) -> Result<Boolean<P::BasePrimeField>, SynthesisError>
[src]
&self,
other: &Self
) -> Result<Boolean<P::BasePrimeField>, SynthesisError>
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<P::BasePrimeField>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<P::BasePrimeField>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<P::BasePrimeField>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<P::BasePrimeField>
) -> Result<(), SynthesisError>
impl<ConstraintF: Field> EqGadget<ConstraintF> for UInt8<ConstraintF>
[src]
fn is_eq(&self, other: &Self) -> Result<Boolean<ConstraintF>, SynthesisError>
[src]
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
impl<ConstraintF: Field> EqGadget<ConstraintF> for UInt16<ConstraintF>
[src]
fn is_eq(&self, other: &Self) -> Result<Boolean<ConstraintF>, SynthesisError>
[src]
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
impl<ConstraintF: Field> EqGadget<ConstraintF> for UInt32<ConstraintF>
[src]
fn is_eq(&self, other: &Self) -> Result<Boolean<ConstraintF>, SynthesisError>
[src]
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
impl<ConstraintF: Field> EqGadget<ConstraintF> for UInt64<ConstraintF>
[src]
fn is_eq(&self, other: &Self) -> Result<Boolean<ConstraintF>, SynthesisError>
[src]
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
impl<ConstraintF: Field> EqGadget<ConstraintF> for UInt128<ConstraintF>
[src]
fn is_eq(&self, other: &Self) -> Result<Boolean<ConstraintF>, SynthesisError>
[src]
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<ConstraintF>
) -> Result<(), SynthesisError>
impl<F: Field> EqGadget<F> for Boolean<F>
[src]
fn is_eq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
[src]
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<F>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<F>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
impl<F: PrimeField> EqGadget<F> for FpVar<F>
[src]
fn is_eq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
[src]
fn conditional_enforce_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
impl<P, F> EqGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
&'a F: FieldOpsBounds<'a, P::BaseField, F>,
[src]
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
&'a F: FieldOpsBounds<'a, P::BaseField, F>,
fn is_eq(
&self,
other: &Self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
[src]
&self,
other: &Self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
impl<P, F> EqGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for AffineVar<P, F> where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
&'b F: FieldOpsBounds<'b, P::BaseField, F>,
[src]
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
&'b F: FieldOpsBounds<'b, P::BaseField, F>,
fn is_eq(
&self,
other: &Self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
[src]
&self,
other: &Self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
[src]
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>