File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ rand-std = ["rand/std"]
29
29
recovery = [" secp256k1-sys/recovery" ]
30
30
endomorphism = [" secp256k1-sys/endomorphism" ]
31
31
lowmemory = [" secp256k1-sys/lowmemory" ]
32
- global-context = []
32
+ global-context = [" std " , " rand " ]
33
33
34
34
# Use this feature to not compile the bundled libsecp256k1 C symbols,
35
35
# but use external ones. Use this only if you know what you are doing!
Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ pub mod global {
31
31
static ONCE : Once = Once :: new ( ) ;
32
32
static mut CONTEXT : Option < Secp256k1 < All > > = None ;
33
33
ONCE . call_once ( || unsafe {
34
- CONTEXT = Some ( Secp256k1 :: new ( ) ) ;
34
+ let mut ctx = Secp256k1 :: new ( ) ;
35
+ ctx. randomize ( & mut rand:: thread_rng ( ) ) ;
36
+ CONTEXT = Some ( ctx) ;
35
37
} ) ;
36
38
unsafe { CONTEXT . as_ref ( ) . unwrap ( ) }
37
39
}
You can’t perform that action at this time.
0 commit comments