diff --git a/alu_u32/src/com/stark.rs b/alu_u32/src/com/stark.rs index 3dff54ef..9ce13575 100644 --- a/alu_u32/src/com/stark.rs +++ b/alu_u32/src/com/stark.rs @@ -35,6 +35,8 @@ where ); builder.assert_bool(local.not_equal); builder.assert_eq(local.not_equal, local.diff * local.diff_inv); + let equal = AB::Expr::one() - local.not_equal; + builder.assert_zero(equal * local.diff); builder.assert_bool(local.is_ne); builder.assert_bool(local.is_eq); diff --git a/cpu/src/stark.rs b/cpu/src/stark.rs index def87bf2..425267bd 100644 --- a/cpu/src/stark.rs +++ b/cpu/src/stark.rs @@ -267,6 +267,8 @@ impl CpuChip { ); builder.assert_bool(local.not_equal); builder.assert_eq(local.not_equal, local.diff * local.diff_inv); + let equal = AB::Expr::one() - local.not_equal; + builder.assert_zero(equal * local.diff); } }