fetch values for input verification from synthesized circuit

This commit is contained in:
Alex Vlasov 2019-02-05 18:56:04 +03:00
parent e8409bb70b
commit e5bc2c197f
2 changed files with 21 additions and 0 deletions

@ -247,6 +247,14 @@ impl<E: Engine, C: Circuit<E>, S: SynthesisDriver> MultiVerifier<E, C, S> {
}
}
pub fn get_k_map(&self) -> Vec<usize> {
return self.k_map.clone();
}
pub fn get_n(&self) -> usize {
return self.n;
}
pub fn check_all(self) -> bool {
self.batch.check_all()
}

@ -621,6 +621,19 @@ fn test_inputs_into_sonic_mimc() {
}
println!("done in {:?}", start.elapsed());
}
{
let mut verifier = MultiVerifier::<Bn256, _, Basic>::new(AdaptorCircuit(circuit.clone()), &srs).unwrap();
println!("verifying 1 proof with advice");
let start = Instant::now();
{
for _ in 0..1 {
verifier.add_proof_with_advice(&proof, &[image], &advice);
}
assert_eq!(verifier.check_all(), true); // TODO
}
println!("done in {:?}", start.elapsed());
}
{
let mut verifier = MultiVerifier::<Bn256, _, Basic>::new(AdaptorCircuit(circuit.clone()), &srs).unwrap();