Skip to content

Commit

Permalink
test: IsZero test for constants
Browse files Browse the repository at this point in the history
  • Loading branch information
ivokub committed Sep 13, 2022
1 parent 1114992 commit 6fef78e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/backend/circuits/iszero.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ func (circuit *isZero) Define(api frontend.API) error {

a := api.IsZero(circuit.X)
b := api.IsZero(circuit.Y)
c := api.IsZero(1)
d := api.IsZero(0)
api.AssertIsEqual(a, 1)
api.AssertIsEqual(b, 0)
api.AssertIsEqual(c, 0)
api.AssertIsEqual(d, 1)

return nil
}
Expand Down

0 comments on commit 6fef78e

Please sign in to comment.