Skip to content

Commit

Permalink
fix(frontend): reduce constant by modulus
Browse files Browse the repository at this point in the history
  • Loading branch information
ivokub committed Dec 17, 2021
1 parent 0843573 commit a64b624
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions frontend/cs_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ func (cs *constraintSystem) ToBinary(i1 interface{}, n ...int) []Variable {
// if a is a constant, work with the big int value.
if a.IsConstant() {
c := cs.constantValue(a)
c.Mod(c, cs.curveID.Info().Fr.Modulus())
b := make([]compiled.Variable, nbBits)
for i := 0; i < len(b); i++ {
b[i] = cs.constant(c.Bit(i)).(compiled.Variable)
Expand Down

0 comments on commit a64b624

Please sign in to comment.