@@ -166,21 +166,27 @@ typename kzg10_batched_2_point<ppT>::evaluation_witness kzg10_batched_2_point<
166166 // polynomial into the kzg10 create_witness function, to yield $W_1$ and
167167 // $sf_1$.
168168
169- // TODO: Use the evaluations object to compute f_accum_eval and
170- // g_accum_eval, instead of evaluating the accumulated polynomial.
169+ // The evaluation of the accumulated polynomials is computed as:
170+ //
171+ // s_1[0] + s_1[1] * gamma_1 + ... + s_i[t1 - 1] gamma_1^{t1 - 1}
172+ //
173+ // which can be views as a polynomial in gamma with coefficients s_1. Note
174+ // that this approach assumes that the highest degree of the polynomials
175+ // f_s and g_s is larger than the number of polynomials, and therefore it
176+ // is more efficient to reuse the existing evaluations instead of
177+ // evaluating the accumulated polynomials.
171178
172- // Accumulate polynomials and get the witnesses
173179 const polynomial<Field> f_accum =
174180 internal::polynomial_accumulate_with_power_factors (fs, gamma_1);
175181 const libff::Fr<ppT> f_accum_eval =
176- kzg10<ppT>::evaluate_polynomial (f_accum, z_1 );
182+ kzg10<ppT>::evaluate_polynomial (evaluations. s_1s , gamma_1 );
177183 const libff::G1<ppT> f_accum_witness =
178184 kzg10<ppT>::create_evaluation_witness (f_accum, z_1, f_accum_eval, srs);
179185
180186 const polynomial<Field> g_accum =
181187 internal::polynomial_accumulate_with_power_factors (gs, gamma_2);
182188 const libff::Fr<ppT> g_accum_eval =
183- kzg10<ppT>::evaluate_polynomial (g_accum, z_2 );
189+ kzg10<ppT>::evaluate_polynomial (evaluations. s_2s , gamma_2 );
184190 const libff::G1<ppT> g_accum_witness =
185191 kzg10<ppT>::create_evaluation_witness (g_accum, z_2, g_accum_eval, srs);
186192
0 commit comments