@@ -411,9 +411,6 @@ impl KeyAggCache {
411411 let mut key_agg_cache = MaybeUninit :: < ffi:: MusigKeyAggCache > :: uninit ( ) ;
412412 let mut agg_pk = MaybeUninit :: < ffi:: XOnlyPublicKey > :: uninit ( ) ;
413413
414- // We have no seed here but we want rerandomiziation to happen for `rand` users.
415- let seed = [ 0_u8 ; 32 ] ;
416-
417414 unsafe {
418415 let pubkeys_ref = core:: slice:: from_raw_parts (
419416 pubkeys. as_c_ptr ( ) as * const * const ffi:: PublicKey ,
@@ -430,7 +427,7 @@ impl KeyAggCache {
430427 pubkeys_ref. len ( ) ,
431428 )
432429 } ,
433- Some ( & seed ) ,
430+ None ,
434431 ) ;
435432 if ret == 0 {
436433 // Returns 0 only if the keys are malformed that never happens in safe rust type system.
@@ -507,8 +504,6 @@ impl KeyAggCache {
507504 /// # }
508505 /// ```
509506 pub fn pubkey_ec_tweak_add ( & mut self , tweak : & Scalar ) -> Result < PublicKey , InvalidTweakErr > {
510- // We have no seed here but we want rerandomiziation to happen for `rand` users.
511- let seed = [ 0_u8 ; 32 ] ;
512507 unsafe {
513508 let mut out = PublicKey :: from ( ffi:: PublicKey :: new ( ) ) ;
514509
@@ -521,7 +516,7 @@ impl KeyAggCache {
521516 tweak. as_c_ptr ( ) ,
522517 )
523518 } ,
524- Some ( & seed ) ,
519+ None ,
525520 ) ;
526521 if ret == 0 {
527522 Err ( InvalidTweakErr )
@@ -569,8 +564,6 @@ impl KeyAggCache {
569564 /// # }
570565 /// ```
571566 pub fn pubkey_xonly_tweak_add ( & mut self , tweak : & Scalar ) -> Result < PublicKey , InvalidTweakErr > {
572- // We have no seed here but we want rerandomiziation to happen for `rand` users.
573- let seed = [ 0_u8 ; 32 ] ;
574567 unsafe {
575568 let mut out = PublicKey :: from ( ffi:: PublicKey :: new ( ) ) ;
576569
@@ -583,7 +576,7 @@ impl KeyAggCache {
583576 tweak. as_c_ptr ( ) ,
584577 )
585578 } ,
586- Some ( & seed ) ,
579+ None ,
587580 ) ;
588581 if ret == 0 {
589582 Err ( InvalidTweakErr )
@@ -956,9 +949,6 @@ impl AggregatedNonce {
956949
957950 let mut aggnonce = MaybeUninit :: < ffi:: MusigAggNonce > :: uninit ( ) ;
958951
959- // We have no seed here but we want rerandomiziation to happen for `rand` users.
960- let seed = [ 0_u8 ; 32 ] ;
961-
962952 unsafe {
963953 let pubnonces = core:: slice:: from_raw_parts (
964954 nonces. as_c_ptr ( ) as * const * const ffi:: MusigPubNonce ,
@@ -974,7 +964,7 @@ impl AggregatedNonce {
974964 pubnonces. len ( ) ,
975965 )
976966 } ,
977- Some ( & seed ) ,
967+ None ,
978968 ) ;
979969 if ret == 0 {
980970 // This can only crash if the individual nonces are invalid which is not possible is rust.
@@ -1124,9 +1114,6 @@ impl Session {
11241114 pub fn new ( key_agg_cache : & KeyAggCache , agg_nonce : AggregatedNonce , msg : & [ u8 ; 32 ] ) -> Self {
11251115 let mut session = MaybeUninit :: < ffi:: MusigSession > :: uninit ( ) ;
11261116
1127- // We have no seed here but we want rerandomiziation to happen for `rand` users.
1128- let seed = [ 0_u8 ; 32 ] ;
1129-
11301117 unsafe {
11311118 let ret = crate :: with_global_context (
11321119 |secp : & Secp256k1 < crate :: AllPreallocated > | {
@@ -1138,7 +1125,7 @@ impl Session {
11381125 key_agg_cache. as_ptr ( ) ,
11391126 )
11401127 } ,
1141- Some ( & seed ) ,
1128+ None ,
11421129 ) ;
11431130 if ret == 0 {
11441131 // Only fails on cryptographically unreachable codes or if the args are invalid.
@@ -1281,8 +1268,6 @@ impl Session {
12811268 pub_nonce : & PublicNonce ,
12821269 pub_key : PublicKey ,
12831270 ) -> bool {
1284- // We have no seed here but we want rerandomiziation to happen for `rand` users.
1285- let seed = [ 0_u8 ; 32 ] ;
12861271 unsafe {
12871272 let ret = crate :: with_global_context (
12881273 |secp : & Secp256k1 < crate :: AllPreallocated > | {
@@ -1295,7 +1280,7 @@ impl Session {
12951280 self . as_ptr ( ) ,
12961281 )
12971282 } ,
1298- Some ( & seed ) ,
1283+ None ,
12991284 ) ;
13001285 ret == 1
13011286 }
0 commit comments