@@ -382,15 +382,9 @@ where
382382 fn simulate_proof (
383383 & self ,
384384 challenge : & Self :: Challenge ,
385- rng : & mut ( impl RngCore + CryptoRng ) ,
385+ mut rng : & mut ( impl RngCore + CryptoRng ) ,
386386 ) -> ( Self :: Commitment , Self :: Response ) {
387- let mut response = Vec :: new ( ) ;
388- // FIXME: This repeats the same element over and over, which was probably not the
389- // intention.
390- response. extend ( std:: iter:: repeat_n (
391- G :: Scalar :: random ( rng) ,
392- self . scalars_nb ( ) ,
393- ) ) ;
387+ let response = ( 0 ..self . scalars_nb ( ) ) . map ( |_| G :: Scalar :: random ( & mut rng) ) . collect ( ) ;
394388 let commitment = self . get_commitment ( challenge, & response) . unwrap ( ) ;
395389 ( commitment, response)
396390 }
@@ -404,9 +398,9 @@ where
404398 /// - A tuple `(commitment, challenge, response)` forming a valid proof.
405399 fn simulate_transcript (
406400 & self ,
407- rng : & mut ( impl RngCore + CryptoRng ) ,
401+ mut rng : & mut ( impl RngCore + CryptoRng ) ,
408402 ) -> ( Self :: Commitment , Self :: Challenge , Self :: Response ) {
409- let challenge = G :: Scalar :: random ( & mut * rng) ;
403+ let challenge = G :: Scalar :: random ( & mut rng) ;
410404 let ( commitment, response) = self . simulate_proof ( & challenge, rng) ;
411405 ( commitment, challenge, response)
412406 }
0 commit comments