diff --git a/src/field/fft.rs b/src/field/fft.rs index 281ee9d2..1061e7a7 100644 --- a/src/field/fft.rs +++ b/src/field/fft.rs @@ -122,10 +122,13 @@ pub fn fft_with_precomputation_power_of_2( } pub fn coset_fft(coefficients: Vec, shift: F) -> Vec { - fft(coefficients) - .into_iter() - .map(|x| x * shift) - .collect() + let mut points = fft(coefficients); + let mut shift_exp_i = F::ONE; + for p in points.iter_mut() { + *p *= shift_exp_i; + shift_exp_i *= shift; + } + points } pub fn ifft(points: Vec) -> Vec { @@ -135,10 +138,13 @@ pub fn ifft(points: Vec) -> Vec { pub fn coset_ifft(points: Vec, shift: F) -> Vec { let shift_inv = shift.inverse(); - ifft(points) - .into_iter() - .map(|x| x * shift_inv) - .collect() + let mut shift_inv_exp_i = F::ONE; + let mut coeffs = ifft(points); + for c in coeffs.iter_mut() { + *c *= shift_inv_exp_i; + shift_inv_exp_i *= shift_inv; + } + coeffs } pub fn lde_multiple(points: Vec>, rate_bits: usize) -> Vec> { diff --git a/src/prover.rs b/src/prover.rs index c9c45929..49a76efb 100644 --- a/src/prover.rs +++ b/src/prover.rs @@ -61,6 +61,10 @@ pub(crate) fn prove( common_data, prover_data, wire_ldes_t, plonk_z_ldes_t, alpha); info!("Computing vanishing poly took {}s", start_vanishing_poly.elapsed().as_secs_f32()); + let div_z_h_start = Instant::now(); + // TODO + info!("Division by Z_H took {}s", div_z_h_start.elapsed().as_secs_f32()); + let plonk_t: Vec = todo!(); // vanishing_poly / Z_H // Need to convert to coeff form and back? let plonk_t_parts = todo!();