Skip to content

Commit

Permalink
chore(bench): measure proof size for zk benchmarks
Browse files Browse the repository at this point in the history
Also clean key sizes measurements since they are now done in
shortint_key_sizes.rs

Co-authored-by: David Testé <david.teste@zama.ai>
  • Loading branch information
IceTDrinker and soonum committed Jul 19, 2024
1 parent 4260998 commit b700416
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tfhe/benches/integer/zk_pke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ fn pke_zk_verify(c: &mut Criterion, results_file: &Path) {
public_params
.serialize_with_mode(&mut crs_data, Compress::No)
.unwrap();

println!("CRS size: {}", crs_data.len());

let test_name = format!("zk::crs_sizes::{param_name}_{bits}_bits_packed");

write_result(&mut file, &test_name, crs_data.len());
Expand Down Expand Up @@ -178,6 +181,24 @@ fn pke_zk_verify(c: &mut Criterion, results_file: &Path) {
.build_with_proof_packed(public_params, compute_load)
.unwrap();

let proof_serialized = bincode::serialize(&ct1).unwrap();

println!("proof size: {}", proof_serialized.len());

let test_name =
format!("zk::proof_sizes::{param_name}_{bits}_bits_packed_{zk_load}");

write_result(&mut file, &test_name, proof_serialized.len());
write_to_json::<u64, _>(
&test_name,
shortint_params,
param_name,
"pke_zk_proof",
&OperatorType::Atomic,
0,
vec![],
);

bench_group.bench_function(&bench_id_verify, |b| {
b.iter(|| {
let _ret = ct1.verify(public_params, &pk);
Expand Down

0 comments on commit b700416

Please sign in to comment.