@@ -53,8 +53,10 @@ impl Prover {
5353 ///
5454 /// See our blog post: <https://blog.lambdaclass.com/gkr-protocol-a-step-by-step-example/>
5555 ///
56- /// This function is only known to the prover. It returns the components of `f` grouped
57- /// into two terms, ready to be used by the sumcheck prover, which expects a product of multilinear polynomials.
56+ /// This function is only known to the prover.
57+ ///
58+ /// It returns the components of `f` grouped into two terms, ready to be used by the sumcheck prover, which expects
59+ /// a product of multilinear polynomials.
5860 /// Both terms are the product of two multilinear polynomials.
5961 /// The first term is `add_i(r_i, b, c) * (W_{i+1}(b) + W_{i+1}(c))`.
6062 /// And the second term is `mul_i(r_i, b, c) * (W_{i+1}(b) * W_{i+1}(c))`.
@@ -63,7 +65,13 @@ impl Prover {
6365 r_i : & [ FieldElement < F > ] ,
6466 w_next_evals : & [ FieldElement < F > ] ,
6567 layer_idx : usize ,
66- ) -> Result < Vec < Vec < DenseMultilinearPolynomial < F > > > , ProverError >
68+ ) -> Result <
69+ (
70+ Vec < DenseMultilinearPolynomial < F > > ,
71+ Vec < DenseMultilinearPolynomial < F > > ,
72+ ) ,
73+ ProverError ,
74+ >
6775 where
6876 <F as IsField >:: BaseType : Send + Sync + Copy ,
6977 {
@@ -98,7 +106,7 @@ impl Prover {
98106 // Corresponds to mul_i(r_i,b,c) * W_{i+1}(b) * W_{i+1}(c)
99107 let term2 = vec ! [ mul_i_ext, w_mul_ext] ;
100108
101- Ok ( vec ! [ term1, term2] )
109+ Ok ( ( term1, term2) )
102110 }
103111
104112 /// Given `b` and `c` (challenges for the input of the gates),
@@ -179,10 +187,10 @@ impl Prover {
179187 let w_next_evals = & evaluation. layers [ layer_idx + 1 ] ;
180188
181189 // Build the GKR polynomial terms
182- let gkr_poly_terms =
190+ let ( term_1 , term_2 ) =
183191 Prover :: build_gkr_polynomial ( circuit, & r_i, w_next_evals, layer_idx) ?;
184192
185- let sumcheck_proof = gkr_sumcheck_prove ( gkr_poly_terms , & mut transcript) ?;
193+ let sumcheck_proof = gkr_sumcheck_prove ( term_1 , term_2 , & mut transcript) ?;
186194
187195 let sumcheck_challenges = & sumcheck_proof. challenges ;
188196
0 commit comments