diff --git a/ferveo-tdec/benches/tpke.rs b/ferveo-tdec/benches/tpke.rs index 03711289..b2388d33 100644 --- a/ferveo-tdec/benches/tpke.rs +++ b/ferveo-tdec/benches/tpke.rs @@ -409,69 +409,70 @@ pub fn bench_ciphertext_validity_checks(c: &mut Criterion) { } } -pub fn bench_decryption_share_validity_checks(c: &mut Criterion) { - let mut group = c.benchmark_group("DECRYPTION SHARE VERIFICATION"); - group.sample_size(10); +// TODO: Uncomment benchmarks +// pub fn bench_decryption_share_validity_checks(c: &mut Criterion) { +// let mut group = c.benchmark_group("DECRYPTION SHARE VERIFICATION"); +// group.sample_size(10); - let rng = &mut StdRng::seed_from_u64(0); - let msg_size = MSG_SIZE_CASES[0]; +// let rng = &mut StdRng::seed_from_u64(0); +// let msg_size = MSG_SIZE_CASES[0]; - for shares_num in NUM_SHARES_CASES { - let share_fast_verification = { - let mut rng = rng.clone(); - let setup = SetupFast::new(shares_num, msg_size, &mut rng); - move || { - black_box(verify_decryption_shares_fast( - &setup.pub_contexts, - &setup.shared.ciphertext, - &setup.decryption_shares, - )) - } - }; - group.bench_function( - BenchmarkId::new("share_fast_verification", shares_num), - |b| b.iter(|| share_fast_verification()), - ); +// for shares_num in NUM_SHARES_CASES { +// let share_fast_verification = { +// let mut rng = rng.clone(); +// let setup = SetupFast::new(shares_num, msg_size, &mut rng); +// move || { +// black_box(verify_decryption_shares_fast( +// &setup.pub_contexts, +// &setup.shared.ciphertext, +// &setup.decryption_shares, +// )) +// } +// }; +// group.bench_function( +// BenchmarkId::new("share_fast_verification", shares_num), +// |b| b.iter(|| share_fast_verification()), +// ); - let mut share_fast_batch_verification = { - let mut rng = rng.clone(); - let setup = SetupFast::new(shares_num, msg_size, &mut rng); - // We need to repackage a bunch of variables here to avoid borrowing issues: - let ciphertext = setup.shared.ciphertext.clone(); - let ciphertexts = vec![ciphertext]; - let decryption_shares = setup.decryption_shares.clone(); - let decryption_shares = vec![decryption_shares]; - move || { - black_box(batch_verify_decryption_shares( - &setup.pub_contexts, - &ciphertexts, - &decryption_shares, - &mut rng, - )) - } - }; - group.bench_function( - BenchmarkId::new("share_fast_batch_verification", shares_num), - |b| b.iter(|| share_fast_batch_verification()), - ); +// let mut share_fast_batch_verification = { +// let mut rng = rng.clone(); +// let setup = SetupFast::new(shares_num, msg_size, &mut rng); +// // We need to repackage a bunch of variables here to avoid borrowing issues: +// let ciphertext = setup.shared.ciphertext.clone(); +// let ciphertexts = vec![ciphertext]; +// let decryption_shares = setup.decryption_shares.clone(); +// let decryption_shares = vec![decryption_shares]; +// move || { +// black_box(batch_verify_decryption_shares( +// &setup.pub_contexts, +// &ciphertexts, +// &decryption_shares, +// &mut rng, +// )) +// } +// }; +// group.bench_function( +// BenchmarkId::new("share_fast_batch_verification", shares_num), +// |b| b.iter(|| share_fast_batch_verification()), +// ); - let share_simple_verification = { - let mut rng = rng.clone(); - let setup = SetupSimple::new(shares_num, msg_size, &mut rng); - move || { - black_box(verify_decryption_shares_simple( - &setup.pub_contexts, - &setup.shared.ciphertext, - &setup.decryption_shares, - )) - } - }; - group.bench_function( - BenchmarkId::new("share_simple_verification", shares_num), - |b| b.iter(|| share_simple_verification()), - ); - } -} +// let share_simple_verification = { +// let mut rng = rng.clone(); +// let setup = SetupSimple::new(shares_num, msg_size, &mut rng); +// move || { +// black_box(verify_decryption_shares_simple( +// &setup.pub_contexts, +// &setup.shared.ciphertext, +// &setup.decryption_shares, +// )) +// } +// }; +// group.bench_function( +// BenchmarkId::new("share_simple_verification", shares_num), +// |b| b.iter(|| share_simple_verification()), +// ); +// } +// } // TODO: Relocate benchmark to ferveo/benches as part of #162, #163 // pub fn bench_recover_share_at_point(c: &mut Criterion) { @@ -585,7 +586,7 @@ criterion_group!( bench_share_combine, bench_share_encrypt_decrypt, bench_ciphertext_validity_checks, - bench_decryption_share_validity_checks, + // bench_decryption_share_validity_checks, // bench_recover_share_at_point, // bench_refresh_shares, );