Skip to content

Commit

Permalink
fix register rand hint
Browse files Browse the repository at this point in the history
  • Loading branch information
Tabaie committed Aug 13, 2024
1 parent 298555b commit b3e7ef8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion constraint/solver/hint_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package solver

import (
"fmt"
"github.com/consensys/gnark/internal/hints"
"math/big"
"sync"

"github.com/consensys/gnark/logger"
)

func init() {
RegisterHint(InvZeroHint)
RegisterHint(InvZeroHint, hints.Randomize)
}

var (
Expand Down
2 changes: 1 addition & 1 deletion frontend/cs/r1cs/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ func (builder *builder) Commit(v ...frontend.Variable) (frontend.Variable, error
return nil, err
}
vCp[len(v)] = mask[0]
builder.cs.AddR1C(builder.newR1C(mask, 1, mask), builder.genericGate) // the variable needs to be involved in a constraint otherwise it will not affect the commitment
builder.cs.AddR1C(builder.newR1C(mask[0], builder.eOne, mask[0]), builder.genericGate) // the variable needs to be involved in a constraint otherwise it will not affect the commitment
v = vCp
}

Expand Down

0 comments on commit b3e7ef8

Please sign in to comment.