Skip to content

Commit 1b7a2e3

Browse files
committed
fix Uint reminder check
1 parent 454e91d commit 1b7a2e3

File tree

1 file changed

+3
-2
lines changed
  • plonky2x/core/src/frontend/uint/num/biguint

1 file changed

+3
-2
lines changed

plonky2x/core/src/frontend/uint/num/biguint/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,9 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilderBiguint<F, D>
310310
let div_b_plus_rem = self.add_biguint(&div_b, &rem);
311311
self.connect_biguint(a, &div_b_plus_rem);
312312

313-
let cmp_rem_b = self.cmp_biguint(&rem, b);
314-
self.assert_one(cmp_rem_b.target);
313+
// Assert that `r < b`. We do that by asserting that the result of `b \leq r` is `false`.
314+
let cmp_b_rem = self.cmp_biguint(b, &rem);
315+
self.assert_zero(cmp_b_rem.target);
315316

316317
(div, rem)
317318
}

0 commit comments

Comments
 (0)