Skip to content

Commit

Permalink
monkeypatch: new circuit has different PubSignals index (drop this co…
Browse files Browse the repository at this point in the history
…mmit before merge, breaks old circuit)
  • Loading branch information
altergui committed Dec 4, 2023
1 parent f7b345c commit e76dcee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crypto/zk/prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/iden3/go-rapidsnark/types"
"github.com/iden3/go-rapidsnark/verifier"
"github.com/iden3/go-rapidsnark/witness"
"go.vocdoni.io/dvote/log"
"go.vocdoni.io/dvote/tree/arbo"
)

Expand Down Expand Up @@ -112,6 +113,7 @@ func (p *Proof) Nullifier() (*big.Int, error) {
}
// Get the nullifier from the third public signal of the proof
strNullifier := p.PubSignals[2]
log.Warn(strNullifier)
// Parse it into a big.Int
nullifier, ok := new(big.Int).SetString(strNullifier, 10)
if !ok {
Expand All @@ -120,12 +122,12 @@ func (p *Proof) Nullifier() (*big.Int, error) {
return nullifier, nil
}

// SIKRoot function returns the sIKRoot included into the current proof.
// SIKRoot function returns the SIKRoot included into the current proof.
func (p *Proof) SIKRoot() ([]byte, error) {
if p.PubSignals == nil || len(p.PubSignals) != DefaultPubSignals {
return nil, ErrPublicSignalFormat
}
arboSIK, ok := new(big.Int).SetString(p.PubSignals[5], 10)
arboSIK, ok := new(big.Int).SetString(p.PubSignals[6], 10)
if !ok {
return nil, ErrParsingSIKRoot
}
Expand Down

0 comments on commit e76dcee

Please sign in to comment.