You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Use assert_bool for max_bits_delta constraint
- Use when(next.value).assert_eq pattern instead of assert_zero(a * b)
- Simplify comments and reference README for explanation
- Replace "checksum" terminology with proper security explanation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: crates/circuits/primitives/src/var_range/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,6 @@ The constraints enforce the enumeration pattern by observing that `value + two_t
27
27
2. Transitions: `max_bits` can only stay the same or increment by 1; `value` can only be 0 or increment by 1; `two_to_max_bits` doubles when `max_bits` increments; and `value + two_to_max_bits` increases by exactly 1 each row
28
28
3. Last row: end at `[value=0, max_bits=range_max_bits+1, mult=0]` (dummy row to make trace height a power of 2)
29
29
30
-
The last-row constraint acts as a checksum—if the trace ever "cheats" (e.g., `value` continues past $2^{\mathtt{max\_bits}} - 1$ instead of wrapping to 0), it cannot reach the required final state.
30
+
The last-row constraint ensures correctness: if `value`ever continues past $2^{\mathtt{max\_bits}} - 1$ instead of wrapping to 0, the monotonic sum constraint forces `value` to keep incrementing and it can never return to 0, making the required final state unreachable.
31
31
32
32
The functionality and usage of the chip are very similar to those of the [Range Checker](../range/README.md) chip.
0 commit comments