mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-25 03:04:13 +03:00
use field eq method
This commit is contained in:
parent
d24623d9d2
commit
abeb796cbb
@ -242,14 +242,13 @@ impl<F: PrimeField> EvaluateEqGadget<F> for FieldType<F> {
|
||||
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!(),
|
||||
// (FieldType::Allocated(first), FieldType::Allocated(second)) => first.evaluate_equal(cs, second),
|
||||
// (FieldType::Constant(constant_value), FieldType::Allocated(allocated_value))
|
||||
// | (FieldType::Allocated(allocated_value), FieldType::Constant(constant_value)) => {
|
||||
// let allocated_constant_value =
|
||||
// FpGadget::alloc(&mut cs.ns(|| format!("alloc constant for eq")), || Ok(constant_value))?;
|
||||
// allocated_value.evaluate_equal(cs, &allocated_constant_value)
|
||||
// }
|
||||
_ => unimplemented!("field equality not implemented yet"), // (FieldType::Allocated(first), FieldType::Allocated(second)) => first.is_eq(cs, second),
|
||||
// (FieldType::Constant(constant_value), FieldType::Allocated(allocated_value))
|
||||
// | (FieldType::Allocated(allocated_value), FieldType::Constant(constant_value)) => {
|
||||
// let allocated_constant_value =
|
||||
// FpGadget::alloc(&mut cs.ns(|| format!("alloc constant for eq")), || Ok(constant_value))?;
|
||||
// allocated_value.is_eq(cs, &allocated_constant_value)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user