@@ -44,7 +44,14 @@ impl<S: SpartanExtensionField> KnowledgeProof<S> {
4444    KnowledgeProof  {  z1,  z2 } 
4545  } 
4646
47-   pub  fn  verify ( & self ,  _transcript :  & mut  Transcript )  -> Result < ( ) ,  ProofVerifyError >  { 
47+   pub  fn  verify ( & self ,  transcript :  & mut  Transcript )  -> Result < ( ) ,  ProofVerifyError >  { 
48+     <Transcript  as  ProofTranscript < S > >:: append_protocol_name ( 
49+       transcript, 
50+       KnowledgeProof :: < S > :: protocol_name ( ) , 
51+     ) ; 
52+ 
53+     let  c:  S  = transcript. challenge_scalar ( b"c" ) ; 
54+ 
4855    // TODO: Alternative PCS Verification 
4956    Ok ( ( ) ) 
5057  } 
@@ -81,7 +88,14 @@ impl<S: SpartanExtensionField> EqualityProof<S> {
8188    EqualityProof  {  z } 
8289  } 
8390
84-   pub  fn  verify ( & self ,  _transcript :  & mut  Transcript )  -> Result < ( ) ,  ProofVerifyError >  { 
91+   pub  fn  verify ( & self ,  transcript :  & mut  Transcript )  -> Result < ( ) ,  ProofVerifyError >  { 
92+     <Transcript  as  ProofTranscript < S > >:: append_protocol_name ( 
93+       transcript, 
94+       EqualityProof :: < S > :: protocol_name ( ) , 
95+     ) ; 
96+ 
97+     let  c:  S  = transcript. challenge_scalar ( b"c" ) ; 
98+ 
8599    // TODO: Alternative PCS Verification 
86100    Ok ( ( ) ) 
87101  } 
@@ -136,7 +150,14 @@ impl<S: SpartanExtensionField> ProductProof<S> {
136150    true 
137151  } 
138152
139-   pub  fn  verify ( & self ,  _transcript :  & mut  Transcript )  -> Result < ( ) ,  ProofVerifyError >  { 
153+   pub  fn  verify ( & self ,  transcript :  & mut  Transcript )  -> Result < ( ) ,  ProofVerifyError >  { 
154+     <Transcript  as  ProofTranscript < S > >:: append_protocol_name ( 
155+       transcript, 
156+       ProductProof :: < S > :: protocol_name ( ) , 
157+     ) ; 
158+ 
159+     let  c:  S  = transcript. challenge_scalar ( b"c" ) ; 
160+ 
140161    // TODO: Alternative PCS Verification 
141162    Ok ( ( ) ) 
142163  } 
@@ -183,6 +204,7 @@ impl<S: SpartanExtensionField> DotProductProof<S> {
183204
184205    let  _dotproduct_a_d = DotProductProof :: compute_dotproduct ( a_vec,  & d_vec) ; 
185206
207+     S :: append_field_vector_to_transcript ( b"a" ,  transcript,  a_vec) ; 
186208    let  c:  S  = transcript. challenge_scalar ( b"c" ) ; 
187209
188210    let  z = ( 0 ..d_vec. len ( ) ) 
@@ -201,7 +223,8 @@ impl<S: SpartanExtensionField> DotProductProof<S> {
201223      DotProductProof :: < S > :: protocol_name ( ) , 
202224    ) ; 
203225    S :: append_field_vector_to_transcript ( b"a" ,  transcript,  a) ; 
204-     let  _c:  S  = transcript. challenge_scalar ( b"c" ) ; 
226+     let  c:  S  = transcript. challenge_scalar ( b"c" ) ; 
227+ 
205228    let  _dotproduct_z_a = DotProductProof :: compute_dotproduct ( & self . z ,  a) ; 
206229
207230    // TODO: Alternative PCS Verification 
@@ -275,10 +298,33 @@ impl<S: SpartanExtensionField> DotProductProofLog<S> {
275298
276299  pub  fn  verify ( 
277300    & self , 
278-     _n :  usize , 
279-     _transcript :  & mut  Transcript , 
280-     _a :  & [ S ] , 
301+     n :  usize , 
302+     transcript :  & mut  Transcript , 
303+     a :  & [ S ] , 
281304  )  -> Result < ( ) ,  ProofVerifyError >  { 
305+     assert_eq ! ( a. len( ) ,  n) ; 
306+ 
307+     <Transcript  as  ProofTranscript < S > >:: append_protocol_name ( 
308+       transcript, 
309+       DotProductProofLog :: < S > :: protocol_name ( ) , 
310+     ) ; 
311+ 
312+     S :: append_field_vector_to_transcript ( b"a" ,  transcript,  a) ; 
313+ 
314+     // sample a random base and scale the generator used for 
315+     // the output of the inner product 
316+     let  r:  S  = transcript. challenge_scalar ( b"r" ) ; 
317+ 
318+     // BulletReductionProof - verification_scalars 
319+     let  mut  m = a. len ( ) ; 
320+     while  m != 1  { 
321+       m /= 2 ; 
322+ 
323+       let  u:  S  = transcript. challenge_scalar ( b"u" ) ; 
324+     } 
325+ 
326+     let  c:  S  = transcript. challenge_scalar ( b"c" ) ; 
327+ 
282328    // TODO: Alternative PCS Verification 
283329    Ok ( ( ) ) 
284330  } 
0 commit comments