Skip to content

Commit

Permalink
fix: conditional check in non-native IsZero for applying optimization (
Browse files Browse the repository at this point in the history
…#1145)

* fix: IsZero optimization conditional

* chore: update stats
  • Loading branch information
ivokub authored Jul 18, 2024
1 parent de4fa56 commit d738f08
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file modified internal/stats/latest.stats
Binary file not shown.
2 changes: 1 addition & 1 deletion std/math/emulated/field_assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (f *Field[T]) IsZero(a *Element[T]) frontend.Variable {
// as ca is already reduced, then every limb overflow is already 0. Only
// every addition adds a bit to the overflow
totalOverflow := len(ca.Limbs) - 1
if totalOverflow < int(f.maxOverflow()) {
if totalOverflow > int(f.maxOverflow()) {
// the sums of limbs would overflow the native field. Use the first
// approach instead.
res := f.api.IsZero(ca.Limbs[0])
Expand Down

0 comments on commit d738f08

Please sign in to comment.