Skip to content

Commit

Permalink
fix: don't check if one wire is constrained
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel committed Nov 2, 2021
1 parent 8f68bd0 commit ca6f89a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/cs.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,12 @@ func (cs *constraintSystem) checkVariables() error {
// TODO @gbotrel add unit test for that.

cptSecret := len(cs.secret.variables.variables)
cptPublic := len(cs.public.variables.variables)
cptPublic := len(cs.public.variables.variables) - 1
cptHints := len(cs.mHintsConstrained)

secretConstrained := make([]bool, cptSecret)
publicConstrained := make([]bool, cptPublic)
publicConstrained := make([]bool, cptPublic+1)
publicConstrained[0] = true

// for each constraint, we check the linear expressions and mark our inputs / hints as constrained
processLinearExpression := func(l compiled.LinearExpression) {
Expand All @@ -381,7 +382,7 @@ func (cs *constraintSystem) checkVariables() error {

switch visibility {
case compiled.Public:
if !publicConstrained[vID] {
if vID != 0 && !publicConstrained[vID] {
publicConstrained[vID] = true
cptPublic--
}
Expand Down

0 comments on commit ca6f89a

Please sign in to comment.