message: improve efficiency of quot computation for poseidon
diff: @@ -60,14 +60,12 @@ impl<F: FftField + SquareRootField> ConstraintSystem<F> {
  ) -> (
  Evaluations<F, D<F>>,
  Evaluations<F, D<F>>,
  - DensePolynomial<F>,
  ) {
  // if this gate is not used, return zero polynomials
  if self.psm.is_zero() {
  return (
  self.zero4.clone(),
  self.zero8.clone(),
  - DensePolynomial::<F>::zero(),
  );
  }
  @@ -156,17 +154,26 @@ impl<F: FftField + SquareRootField> ConstraintSystem<F> {
  }
  }
  - let rc = alp
  - .iter()
  - .enumerate()
  + let mut p4 = lhs;
  + for (round, als) in alp.iter().enumerate() {
  + for (col, a) in als.iter().enumerate() {
  + p4 += &self.coefficients4[round * SPONGE_WIDTH + col].scale(*a)
  + }
  + }
  + /*
  .fold(DensePolynomial::<F>::zero(), |acc0, (round, als)| {
  als.iter()
  .enumerate()
  .fold(acc0, |acc, (col, a)| &acc + &self.coefficientsm[round * SPONGE_WIDTH + col].scale(*a))
  });
  - let rc = &rc * &self.psm;
  + */
  +
  + p4 *= &self.ps4;
  +
  + let mut p8 = rhs;
  + p8 *= &self.ps8;
  - (&self.ps4 * &lhs, &self.ps8 * &rhs, rc)
  + (p4, p8)
  /*
  (
  &self.ps4 * &polys.d4.next.w.iter().zip(alpha[0..COLUMNS].iter()).map(|(p, a)| p.scale(-*a)).
  @@ -343,8 +350,8 @@ mod tests {
  // compute quotient by dividing with vanishing polynomial
  let lagrange = cs.evaluate(&witness, &DensePolynomial::zero());
  - let (pos4, pos8, posp) = cs.psdn_quot(&lagrange, &cs.fr_sponge_params, &alphas);
  - let t_before_division = &(&pos4.interpolate() + &pos8.interpolate()) + &posp;
  + let (pos4, pos8) = cs.psdn_quot(&lagrange, &cs.fr_sponge_params, &alphas);
  + let t_before_division = &pos4.interpolate() + &pos8.interpolate();
  let (t, rem) = t_before_division
  .divide_by_vanishing_poly(cs.domain.d1)
  .unwrap();
  