@@ -66,7 +66,7 @@ pub enum ProtocolProverState<G: Group + GroupEncoding> {
6666 Or (
6767 usize , // real index
6868 Vec < ProtocolProverState < G > > , // real ProverState
69- ( Vec < ProtocolChallenge < G > > , Vec < ProtocolResponse < G > > ) , // fake transcripts
69+ ( Vec < ProtocolChallenge < G > > , Vec < ProtocolResponse < G > > ) , // simulated transcripts
7070 ) ,
7171}
7272
@@ -128,15 +128,15 @@ impl<G: Group + GroupEncoding> SigmaProtocol for Protocol<G> {
128128 }
129129 ( Protocol :: Or ( ps) , ProtocolWitness :: Or ( w_index, w) ) => {
130130 let mut commitments = Vec :: with_capacity ( ps. len ( ) ) ;
131- let mut fake_challenges = Vec :: new ( ) ;
132- let mut fake_responses = Vec :: new ( ) ;
131+ let mut simulated_challenges = Vec :: new ( ) ;
132+ let mut simulated_responses = Vec :: new ( ) ;
133133 let ( real_commit, real_state) = ps[ * w_index] . prover_commit ( & w[ 0 ] , rng) ?;
134134 for ( i, _) in ps. iter ( ) . enumerate ( ) {
135135 if i != * w_index {
136136 let ( c, ch, r) = ps[ i] . simulate_transcript ( rng) ;
137137 commitments. push ( c) ;
138- fake_challenges . push ( ch) ;
139- fake_responses . push ( r) ;
138+ simulated_challenges . push ( ch) ;
139+ simulated_responses . push ( r) ;
140140 } else {
141141 commitments. push ( real_commit. clone ( ) ) ;
142142 }
@@ -146,7 +146,7 @@ impl<G: Group + GroupEncoding> SigmaProtocol for Protocol<G> {
146146 ProtocolProverState :: Or (
147147 * w_index,
148148 vec ! [ real_state] ,
149- ( fake_challenges , fake_responses ) ,
149+ ( simulated_challenges , simulated_responses ) ,
150150 ) ,
151151 ) )
152152 }
@@ -177,13 +177,17 @@ impl<G: Group + GroupEncoding> SigmaProtocol for Protocol<G> {
177177 }
178178 (
179179 Protocol :: Or ( ps) ,
180- ProtocolProverState :: Or ( w_index, real_state, ( f_challenges, f_responses) ) ,
180+ ProtocolProverState :: Or (
181+ w_index,
182+ real_state,
183+ ( simulated_challenges, simulated_responses) ,
184+ ) ,
181185 ) => {
182186 let mut challenges = Vec :: with_capacity ( ps. len ( ) ) ;
183187 let mut responses = Vec :: with_capacity ( ps. len ( ) ) ;
184188
185189 let mut real_challenge = * challenge;
186- for ch in & f_challenges {
190+ for ch in & simulated_challenges {
187191 real_challenge -= ch;
188192 }
189193 let real_response =
@@ -194,9 +198,9 @@ impl<G: Group + GroupEncoding> SigmaProtocol for Protocol<G> {
194198 challenges. push ( real_challenge) ;
195199 responses. push ( real_response. clone ( ) ) ;
196200 } else {
197- let fake_index = if i < w_index { i } else { i - 1 } ;
198- challenges. push ( f_challenges [ fake_index ] ) ;
199- responses. push ( f_responses [ fake_index ] . clone ( ) ) ;
201+ let simulated_index = if i < w_index { i } else { i - 1 } ;
202+ challenges. push ( simulated_challenges [ simulated_index ] ) ;
203+ responses. push ( simulated_responses [ simulated_index ] . clone ( ) ) ;
200204 }
201205 }
202206 Ok ( ProtocolResponse :: Or ( challenges, responses) )
@@ -364,26 +368,26 @@ impl<G: Group + GroupEncoding> SigmaProtocol for Protocol<G> {
364368 }
365369 }
366370
367- fn get_commitment (
371+ fn simulate_commitment (
368372 & self ,
369373 challenge : & Self :: Challenge ,
370374 response : & Self :: Response ,
371375 ) -> Result < Self :: Commitment , Error > {
372376 match ( self , response) {
373- ( Protocol :: Simple ( p) , ProtocolResponse :: Simple ( r) ) => {
374- Ok ( ProtocolCommitment :: Simple ( p . get_commitment ( challenge, r) ?) )
375- }
377+ ( Protocol :: Simple ( p) , ProtocolResponse :: Simple ( r) ) => Ok ( ProtocolCommitment :: Simple (
378+ p . simulate_commitment ( challenge, r) ?,
379+ ) ) ,
376380 ( Protocol :: And ( ps) , ProtocolResponse :: And ( rs) ) => {
377381 let mut commitments = Vec :: with_capacity ( ps. len ( ) ) ;
378382 for ( i, p) in ps. iter ( ) . enumerate ( ) {
379- commitments. push ( p. get_commitment ( challenge, & rs[ i] ) ?) ;
383+ commitments. push ( p. simulate_commitment ( challenge, & rs[ i] ) ?) ;
380384 }
381385 Ok ( ProtocolCommitment :: And ( commitments) )
382386 }
383387 ( Protocol :: Or ( ps) , ProtocolResponse :: Or ( ch, rs) ) => {
384388 let mut commitments = Vec :: with_capacity ( ps. len ( ) ) ;
385389 for ( i, p) in ps. iter ( ) . enumerate ( ) {
386- commitments. push ( p. get_commitment ( & ch[ i] , & rs[ i] ) ?) ;
390+ commitments. push ( p. simulate_commitment ( & ch[ i] , & rs[ i] ) ?) ;
387391 }
388392 Ok ( ProtocolCommitment :: Or ( commitments) )
389393 }
0 commit comments