Skip to content

Commit

Permalink
Use lookup tables for first proof Lagrange output (#1437)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyleiserson authored Nov 22, 2024
1 parent a21f229 commit 0cbc5de
Show file tree
Hide file tree
Showing 11 changed files with 974 additions and 662 deletions.
34 changes: 4 additions & 30 deletions ipa-core/benches/dzkp_convert_prover.rs
Original file line number Diff line number Diff line change
@@ -1,41 +1,15 @@
//! Benchmark for the convert_prover function in dzkp_field.rs.
//! Benchmark for the table_indices_prover function in dzkp_field.rs.
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use ipa_core::{
ff::Fp61BitPrime,
protocol::context::{dzkp_field::DZKPBaseField, dzkp_validator::MultiplicationInputsBlock},
};
use ipa_core::protocol::context::dzkp_validator::MultiplicationInputsBlock;
use rand::{thread_rng, Rng};

fn convert_prover_benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("dzkp_convert_prover");
group.bench_function("convert", |b| {
b.iter_batched_ref(
|| {
// Generate input
let mut rng = thread_rng();

MultiplicationInputsBlock {
x_left: rng.gen::<[u8; 32]>().into(),
x_right: rng.gen::<[u8; 32]>().into(),
y_left: rng.gen::<[u8; 32]>().into(),
y_right: rng.gen::<[u8; 32]>().into(),
prss_left: rng.gen::<[u8; 32]>().into(),
prss_right: rng.gen::<[u8; 32]>().into(),
z_right: rng.gen::<[u8; 32]>().into(),
}
},
|input| {
let MultiplicationInputsBlock {
x_left,
x_right,
y_left,
y_right,
prss_right,
..
} = input;
Fp61BitPrime::convert_prover(x_left, x_right, y_left, y_right, prss_right);
},
|| thread_rng().gen(),
|input: &mut MultiplicationInputsBlock| input.table_indices_prover(),
BatchSize::SmallInput,
)
});
Expand Down
Loading

0 comments on commit 0cbc5de

Please sign in to comment.