Skip to content

Commit e69fa35

Browse files
committed
fix
1 parent 29f03d1 commit e69fa35

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/rec_aggregation/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,10 +513,11 @@ def checked_decompose_bits_small_value_const(to_decompose, n_bits: Const):
513513
bits = Array(n_bits)
514514
hint_decompose_bits(to_decompose, bits, n_bits, BIG_ENDIAN)
515515
sum: Mut = bits[n_bits - 1]
516-
power_of_2: Mut = 1
516+
assert sum * (1 - sum) == 0
517517
for i in unroll(1, n_bits):
518-
power_of_2 *= 2
519-
sum += bits[n_bits - 1 - i] * power_of_2
518+
b = bits[n_bits - 1 - i]
519+
assert b * (1 - b) == 0
520+
sum += b * 2**i
520521
assert to_decompose == sum
521522
return bits
522523

0 commit comments

Comments
 (0)