mirror of
https://github.com/arnaucube/go-snark-study.git
synced 2026-02-02 17:26:41 +01:00
remove circuit parameter from proof Verification
This commit is contained in:
@@ -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++ {
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user