mirror of https://github.com/zcash/halo2.git
Add mechanism for generating a new proof in test.
This commit is contained in:
parent
c12620c598
commit
e10f4e1d0e
|
@ -431,6 +431,24 @@ fn plonk_api() {
|
||||||
};
|
};
|
||||||
assert_eq!(prover.verify(), Ok(()));
|
assert_eq!(prover.verify(), Ok(()));
|
||||||
|
|
||||||
|
if std::env::var_os("HALO2_PLONK_TEST_GENERATE_NEW_PROOF").is_some() {
|
||||||
|
let mut transcript = Blake2bWrite::<_, _, Challenge255<_>>::init(vec![]);
|
||||||
|
// Create a proof
|
||||||
|
create_proof(
|
||||||
|
¶ms,
|
||||||
|
&pk,
|
||||||
|
&[circuit.clone(), circuit.clone()],
|
||||||
|
&[&[&[instance]], &[&[instance]]],
|
||||||
|
OsRng,
|
||||||
|
&mut transcript,
|
||||||
|
)
|
||||||
|
.expect("proof generation should not fail");
|
||||||
|
let proof: Vec<u8> = transcript.finalize();
|
||||||
|
|
||||||
|
std::fs::write("plonk_api_proof.bin", &proof[..])
|
||||||
|
.expect("should succeed to write new proof");
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Check that a hardcoded proof is satisfied
|
// Check that a hardcoded proof is satisfied
|
||||||
let proof = include_bytes!("plonk_api_proof.bin");
|
let proof = include_bytes!("plonk_api_proof.bin");
|
||||||
|
|
Loading…
Reference in New Issue