rust-bitcoin / rust-secp256k1

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

Global context is randomized twice #759

Closed DaniPopes closed 3 weeks ago

DaniPopes commented 3 weeks 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 3 weeks ago

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

cc #388