Skip to content

Commit

Permalink
Merge ff29160 into 1fd3e6d
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Jan 29, 2024
2 parents 1fd3e6d + ff29160 commit a50b855
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ impl AcirContext {
// Operands are booleans.
//
// a ^ b == a + b - 2*a*b
let sum = self.add_var(lhs, rhs)?;
let prod = self.mul_var(lhs, rhs)?;
let sum = self.add_var(lhs, rhs)?;
self.add_mul_var(sum, -FieldElement::from(2_i128), prod)
} else {
let inputs = vec![AcirValue::Var(lhs, typ.clone()), AcirValue::Var(rhs, typ)];
Expand Down Expand Up @@ -457,8 +457,8 @@ impl AcirContext {
if bit_size == 1 {
// Operands are booleans
// a + b - ab
let sum = self.add_var(lhs, rhs)?;
let mul = self.mul_var(lhs, rhs)?;
let sum = self.add_var(lhs, rhs)?;
self.sub_var(sum, mul)
} else {
// Implement OR in terms of AND
Expand Down

0 comments on commit a50b855

Please sign in to comment.