Skip to content

Commit

Permalink
perf: mark the result of builder.IsZero as boolean to save constrai…
Browse files Browse the repository at this point in the history
…nts when used in future (#977)
  • Loading branch information
winderica authored Jan 4, 2024
1 parent 8f954aa commit 84ffe1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/cs/r1cs/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ func (builder *builder) IsZero(i1 frontend.Variable) frontend.Variable {

builder.cs.AttachDebugInfo(debug, []int{c1, c2})

builder.MarkBoolean(m)

return m
}

Expand Down
2 changes: 2 additions & 0 deletions frontend/cs/scs/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ func (builder *builder) IsZero(i1 frontend.Variable) frontend.Variable {
qM: a.Coeff,
})

builder.MarkBoolean(m)

return m
}

Expand Down

0 comments on commit 84ffe1c

Please sign in to comment.