Skip to content

Commit

Permalink
Address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
thealmarty committed Jan 17, 2024
1 parent 9e48bf3 commit a693dc9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions alu_u32/src/com/stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ where
.input_1
.into_iter()
.zip(local.input_2)
.map(|(a, b)| (a - b) * (a - b))
.map(|(a, b)| (a - b).square())
.sum::<AB::Expr>(),
);
builder.assert_bool(local.not_equal);
Expand All @@ -40,7 +40,9 @@ where
builder.assert_bool(local.is_eq);
builder.assert_bool(local.is_ne + local.is_eq);

builder.when(local.is_ne).assert_one(local.not_equal);
builder.when(local.is_eq).assert_zero(local.not_equal);
builder.assert_eq(
local.output,
local.is_ne * local.not_equal + local.is_eq * (AB::Expr::one() - local.not_equal),
)
}
}

0 comments on commit a693dc9

Please sign in to comment.