From 8256fb3ee2ccf1f67571eacb16a6004a15d71a3b Mon Sep 17 00:00:00 2001 From: zhenfei Date: Tue, 20 Dec 2022 11:31:39 -0500 Subject: [PATCH] FEAT: msm timers (#108) --- subroutines/src/pcs/multilinear_kzg/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subroutines/src/pcs/multilinear_kzg/mod.rs b/subroutines/src/pcs/multilinear_kzg/mod.rs index a895535..4b64ee0 100644 --- a/subroutines/src/pcs/multilinear_kzg/mod.rs +++ b/subroutines/src/pcs/multilinear_kzg/mod.rs @@ -126,11 +126,16 @@ impl PolynomialCommitmentScheme for MultilinearKzgPCS { .into_iter() .map(|x| x.into_repr()) .collect(); + let msm_timer = start_timer!(|| format!( + "msm of size {}", + prover_param.powers_of_g[ignored].evals.len() + )); let commitment = VariableBaseMSM::multi_scalar_mul( &prover_param.powers_of_g[ignored].evals, scalars.as_slice(), ) .into_affine(); + end_timer!(msm_timer); end_timer!(commit_timer); Ok(Commitment(commitment)) @@ -269,7 +274,11 @@ fn open_internal( r[k - 1] = cur_r; // this is a MSM over G1 and is likely to be the bottleneck + let msm_timer = start_timer!(|| format!("msm of size {} at round {}", gi.evals.len(), i)); + proofs.push(VariableBaseMSM::multi_scalar_mul(&gi.evals, &scalars).into_affine()); + end_timer!(msm_timer); + end_timer!(ith_round); } let eval = evaluate_opt(polynomial, point);