rust-bitcoin / rust-secp256k1

Rust language bindings for Bitcoin secp256k1 library.
Creative Commons Zero v1.0 Universal
347 stars 265 forks source link

Global context is randomized twice #759

Closed DaniPopes closed 5 minutes ago

DaniPopes commented 5 hours ago

In: https://github.com/rust-bitcoin/rust-secp256k1/blob/bb4972f20fb5a1681a103ffd4d3c27cf31679278/src/context.rs#L44-L63

Secp256k1::new itself calls randomize with rand: https://github.com/rust-bitcoin/rust-secp256k1/blob/bb4972f20fb5a1681a103ffd4d3c27cf31679278/src/context.rs#L206-L234

Is this intended? If not, the call in deref should be dropped.

apoelstra commented 5 hours ago

Good catch. Yeah, let's drop the one in deref.

cc #388