use std::env;
use kimchi::bench::BenchmarkCtx;
pub fn black_box<T>(dummy: T) -> T {
unsafe {
let ret = std::ptr::read_volatile(&dummy);
std::mem::forget(dummy);
ret
}
}
fn main() {
let mode = env::args().nth(1);
match mode.as_deref() {
Some("prove") => {
let ctx = BenchmarkCtx::new(14);
loop {
let proof_and_public = ctx.create_proof();
black_box(proof_and_public);
}
}
Some("verify") => {
let ctx = BenchmarkCtx::new(4);
let proof_and_public = ctx.create_proof();
loop {
ctx.batch_verification(black_box(&vec![proof_and_public.clone()]));
}
}
_ => panic!("you must provide an argument (prove or verify)"),
};
}