Skip to content

Commit 1773fc9

Browse files
committed
fix(examples): do not rely on prove() but instead on prove_batchable().
1 parent 2624e53 commit 1773fc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/schnorr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ fn main() {
103103
// Generate a non-interactive proof with the witness.
104104
// The non-interactive proof contains the 3 elements of a sigma protocol transcript: a commitment, a challenge, and a response.
105105
// This transcript can be transmitted by the prover to any verifier, without revealing any secret information about the prover.
106-
let (commitment, challenge, response) = nizk.prove(&witness, &mut OsRng).unwrap();
106+
let proof = nizk.prove_batchable(&witness, &mut OsRng).unwrap();
107107

108108
// Verification requires checking the proof against the transcript and constraint system.
109109
// The verifier can be convinced that the prover indeed knows `x` so that `P = x*G`. This doesn't require any interaction with the prover other than receiving the transcript.
110-
let verified = nizk.verify(&commitment, &challenge, &response).is_ok();
110+
let verified = nizk.verify_batchable(&proof).is_ok();
111111
println!("Schnorr NIZK proof verified: {verified}");
112112
}

0 commit comments

Comments
 (0)