comment out field gadget eq

This commit is contained in:
collin 2020-08-17 23:13:54 -07:00
parent 3f49eb0e3f
commit a8530c9012
2 changed files with 25 additions and 25 deletions

View File

@ -209,7 +209,7 @@ impl<F: Field + PrimeField> PartialOrd for FieldType<F> {
}
impl<F: Field + PrimeField> EvaluateEqGadget<F> for FieldType<F> {
fn evaluate_equal<CS: ConstraintSystem<F>>(&self, mut cs: CS, other: &Self) -> Result<Boolean, SynthesisError> {
fn evaluate_equal<CS: ConstraintSystem<F>>(&self, mut _cs: CS, other: &Self) -> Result<Boolean, SynthesisError> {
match (self, other) {
(FieldType::Constant(first), FieldType::Constant(second)) => Ok(Boolean::constant(first.eq(second))),
_ => unimplemented!(),

View File

@ -236,32 +236,32 @@ impl PartialEq for EdwardsGroupType {
impl Eq for EdwardsGroupType {}
fn compare_allocated_edwards_bls_gadgets<CS: ConstraintSystem<Fq>>(
mut cs: CS,
first: &EdwardsBlsGadget,
second: &EdwardsBlsGadget,
) -> Result<Boolean, SynthesisError> {
// compare x coordinates
let x_first = &first.x;
let x_second = &second.x;
let compare_x = x_first.evaluate_equal(&mut cs.ns(|| format!("compare x")), x_second)?;
// compare y coordinates
let y_first = &first.y;
let y_second = &second.y;
let compare_y = y_first.evaluate_equal(&mut cs.ns(|| format!("compare y")), y_second)?;
Boolean::and(
&mut cs.ns(|| format!("compare x and y results")),
&compare_x,
&compare_y,
)
}
// fn compare_allocated_edwards_bls_gadgets<CS: ConstraintSystem<Fq>>(
// mut cs: CS,
// first: &EdwardsBlsGadget,
// second: &EdwardsBlsGadget,
// ) -> Result<Boolean, SynthesisError> {
// // compare x coordinates
// let x_first = &first.x;
// let x_second = &second.x;
//
// let compare_x = x_first.evaluate_equal(&mut cs.ns(|| format!("compare x")), x_second)?;
//
// // compare y coordinates
// let y_first = &first.y;
// let y_second = &second.y;
//
// let compare_y = y_first.evaluate_equal(&mut cs.ns(|| format!("compare y")), y_second)?;
//
// Boolean::and(
// &mut cs.ns(|| format!("compare x and y results")),
// &compare_x,
// &compare_y,
// )
// }
impl EvaluateEqGadget<Fq> for EdwardsGroupType {
fn evaluate_equal<CS: ConstraintSystem<Fq>>(&self, mut cs: CS, other: &Self) -> Result<Boolean, SynthesisError> {
fn evaluate_equal<CS: ConstraintSystem<Fq>>(&self, mut _cs: CS, other: &Self) -> Result<Boolean, SynthesisError> {
match (self, other) {
(EdwardsGroupType::Constant(self_value), EdwardsGroupType::Constant(other_value)) => {
Ok(Boolean::constant(self_value.eq(other_value)))