@@ -62,7 +62,7 @@ impl Polynomial {
6262
6363  // Given point = (\vec{a}, \vec{b}), compute the polynomial q as 
6464  // q(Y) = 
65-   // \sum_{j \in \{0,1\}^m}(\sum_{i \in \{0,1\}^m} p(j,i) * chi_i(a )) * chi_j(Y) 
65+   // \sum_{j \in \{0,1\}^m}(\sum_{i \in \{0,1\}^m} p(j,i) * chi_i(b )) * chi_j(Y) 
6666  // and p(a,b) = q(b) where p is the initial polynomial 
6767  fn  get_q ( & mut  self ,  point :  & [ Scalar ] )  { 
6868    let  q_timer = Timer :: new ( "build_q" ) ; 
@@ -163,7 +163,12 @@ impl Polynomial {
163163  )  -> ( Commitment < I > ,  Proof < I > ,  MippProof < I > )  { 
164164    let  m = point. len ( )  / 2 ; 
165165    let  a = & point[ 0 ..m] ; 
166-     let  b = & point[ m..2  *  m] ; 
166+ 
167+     if  self . q . is_none ( )  { 
168+       self . get_q ( point) ; 
169+     } 
170+ 
171+     let  q = self . q . clone ( ) . unwrap ( ) ; 
167172
168173    if  self . q . is_none ( )  { 
169174      self . get_q ( point) ; 
@@ -207,16 +212,14 @@ impl Polynomial {
207212        . unwrap ( ) ; 
208213    timer_mipp_proof. stop ( ) ; 
209214
210-     // PST proof for opening q at b  
215+     // PST proof for opening q at a  
211216    let  timer_proof = Timer :: new ( "pst_open" ) ; 
212217    let  mut  a_rev = a. to_vec ( ) . clone ( ) ; 
213218    a_rev. reverse ( ) ; 
214219    let  pst_proof = MultilinearPC :: < I > :: open ( ck,  & q,  & a_rev) ; 
215220    timer_proof. stop ( ) ; 
216221
217222    timer_open. stop ( ) ; 
218- 
219-     // TODO: add MIPP proof as return value 
220223    ( U ,  pst_proof,  mipp_proof) 
221224  } 
222225
0 commit comments