remove circuit parameter from proof Verification

This commit is contained in:
arnaucube
2019-07-27 18:08:54 +02:00
parent e98a97e9fe
commit 41f7a3518a
8 changed files with 28 additions and 65 deletions

View File

@@ -275,7 +275,7 @@ func GenerateProofs(circuit circuitcompiler.Circuit, setup Setup, w []*big.Int,
}
// VerifyProof verifies over the BN128 the Pairings of the Proof
func VerifyProof(circuit circuitcompiler.Circuit, setup Setup, proof Proof, publicSignals []*big.Int, debug bool) bool {
func VerifyProof(setup Setup, proof Proof, publicSignals []*big.Int, debug bool) bool {
icPubl := setup.Vk.IC[0]
for i := 0; i < len(publicSignals); i++ {

View File

@@ -97,11 +97,11 @@ func TestGroth16MinimalFlow(t *testing.T) {
b35Verif := big.NewInt(int64(35))
publicSignalsVerif := []*big.Int{b35Verif}
before := time.Now()
assert.True(t, VerifyProof(*circuit, setup, proof, publicSignalsVerif, true))
assert.True(t, VerifyProof(setup, proof, publicSignalsVerif, true))
fmt.Println("verify proof time elapsed:", time.Since(before))
// check that with another public input the verification returns false
bOtherWrongPublic := big.NewInt(int64(34))
wrongPublicSignalsVerif := []*big.Int{bOtherWrongPublic}
assert.True(t, !VerifyProof(*circuit, setup, proof, wrongPublicSignalsVerif, false))
assert.True(t, !VerifyProof(setup, proof, wrongPublicSignalsVerif, false))
}