@@ -4,7 +4,7 @@ use crate::scalar::SpartanExtensionField;
44use super :: errors:: ProofVerifyError ;
55use super :: math:: Math ;
66use super :: random:: RandomTape ;
7- use super :: transcript:: { AppendToTranscript , ProofTranscript } ;
7+ use super :: transcript:: ProofTranscript ;
88use merlin:: Transcript ;
99use serde:: { Deserialize , Serialize } ;
1010mod bullet;
@@ -45,12 +45,15 @@ impl<S: SpartanExtensionField> KnowledgeProof<S> {
4545 }
4646
4747 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" ) ;
48+ // Transcript operations to preserve consistency for the verify function
49+ {
50+ <Transcript as ProofTranscript < S > >:: append_protocol_name (
51+ transcript,
52+ KnowledgeProof :: < S > :: protocol_name ( ) ,
53+ ) ;
54+
55+ let _c: S = transcript. challenge_scalar ( b"c" ) ;
56+ }
5457
5558 // TODO: Alternative PCS Verification
5659 Ok ( ( ) )
@@ -89,12 +92,15 @@ impl<S: SpartanExtensionField> EqualityProof<S> {
8992 }
9093
9194 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" ) ;
95+ // Transcript operations to preserve consistency for the verify function
96+ {
97+ <Transcript as ProofTranscript < S > >:: append_protocol_name (
98+ transcript,
99+ EqualityProof :: < S > :: protocol_name ( ) ,
100+ ) ;
101+
102+ let _c: S = transcript. challenge_scalar ( b"c" ) ;
103+ }
98104
99105 // TODO: Alternative PCS Verification
100106 Ok ( ( ) )
@@ -145,18 +151,21 @@ impl<S: SpartanExtensionField> ProductProof<S> {
145151 ProductProof { z }
146152 }
147153
148- fn check_equality ( _c : & S , _z1 : & S , _z2 : & S ) -> bool {
154+ fn _check_equality ( _c : & S , _z1 : & S , _z2 : & S ) -> bool {
149155 // TODO: Alternative PCS Verification
150156 true
151157 }
152158
153159 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+ // Transcript operations to preserve consistency for the verify function
161+ {
162+ <Transcript as ProofTranscript < S > >:: append_protocol_name (
163+ transcript,
164+ ProductProof :: < S > :: protocol_name ( ) ,
165+ ) ;
166+
167+ let _c: S = transcript. challenge_scalar ( b"c" ) ;
168+ }
160169
161170 // TODO: Alternative PCS Verification
162171 Ok ( ( ) )
@@ -218,12 +227,15 @@ impl<S: SpartanExtensionField> DotProductProof<S> {
218227 }
219228
220229 pub fn verify ( & self , transcript : & mut Transcript , a : & [ S ] ) -> Result < ( ) , ProofVerifyError > {
221- <Transcript as ProofTranscript < S > >:: append_protocol_name (
222- transcript,
223- DotProductProof :: < S > :: protocol_name ( ) ,
224- ) ;
225- S :: append_field_vector_to_transcript ( b"a" , transcript, a) ;
226- let c: S = transcript. challenge_scalar ( b"c" ) ;
230+ // Transcript operations to preserve consistency for the verify function
231+ {
232+ <Transcript as ProofTranscript < S > >:: append_protocol_name (
233+ transcript,
234+ DotProductProof :: < S > :: protocol_name ( ) ,
235+ ) ;
236+ S :: append_field_vector_to_transcript ( b"a" , transcript, a) ;
237+ let _c: S = transcript. challenge_scalar ( b"c" ) ;
238+ }
227239
228240 let _dotproduct_z_a = DotProductProof :: compute_dotproduct ( & self . z , a) ;
229241
@@ -304,26 +316,29 @@ impl<S: SpartanExtensionField> DotProductProofLog<S> {
304316 ) -> Result < ( ) , ProofVerifyError > {
305317 assert_eq ! ( a. len( ) , n) ;
306318
307- <Transcript as ProofTranscript < S > >:: append_protocol_name (
308- transcript,
309- DotProductProofLog :: < S > :: protocol_name ( ) ,
310- ) ;
319+ // Transcript operations to preserve consistency for the verify function
320+ {
321+ <Transcript as ProofTranscript < S > >:: append_protocol_name (
322+ transcript,
323+ DotProductProofLog :: < S > :: protocol_name ( ) ,
324+ ) ;
311325
312- S :: append_field_vector_to_transcript ( b"a" , transcript, a) ;
326+ S :: append_field_vector_to_transcript ( b"a" , transcript, a) ;
313327
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" ) ;
328+ // sample a random base and scale the generator used for
329+ // the output of the inner product
330+ let _r : S = transcript. challenge_scalar ( b"r" ) ;
317331
318- // BulletReductionProof - verification_scalars
319- let mut m = a. len ( ) ;
320- while m != 1 {
321- m /= 2 ;
332+ // BulletReductionProof - verification_scalars
333+ let mut m = a. len ( ) ;
334+ while m != 1 {
335+ m /= 2 ;
322336
323- let u : S = transcript. challenge_scalar ( b"u" ) ;
324- }
337+ let _u : S = transcript. challenge_scalar ( b"u" ) ;
338+ }
325339
326- let c: S = transcript. challenge_scalar ( b"c" ) ;
340+ let _c: S = transcript. challenge_scalar ( b"c" ) ;
341+ }
327342
328343 // TODO: Alternative PCS Verification
329344 Ok ( ( ) )
0 commit comments