diff --git a/Cargo.toml b/Cargo.toml index 328cb9262..9d4f8aa1e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,9 +27,9 @@ dev = ["clippy"] [dependencies] arrayvec = "0.4" -clippy = {version = "0.0", optional = true} -rand = "0.6" +clippy = { version = "0.0", optional = true } +rand = "0.7" [dev-dependencies] hex-literal = "0.2" -rand_core = "0.4.2" +rand_core = "0.5.1" diff --git a/src/key.rs b/src/key.rs index ec938ccd6..3d3f9735b 100644 --- a/src/key.rs +++ b/src/key.rs @@ -16,7 +16,7 @@ //! # Public and secret keys use arrayvec::ArrayVec; -use rand::Rng; +use rand::RngCore; use super::{Secp256k1, ContextFlag}; use super::Error::{self, IncapableContext, InvalidPublicKey, InvalidSecretKey}; @@ -64,7 +64,7 @@ pub const MINUS_ONE_KEY: SecretKey = SecretKey([0xff, 0xff, 0xff, 0xff, 0xff, 0x #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] pub struct PublicKey(ffi::PublicKey); -fn random_32_bytes(rng: &mut R) -> [u8; 32] { +fn random_32_bytes(rng: &mut R) -> [u8; 32] { let mut ret = [0u8; 32]; rng.fill_bytes(&mut ret); ret @@ -73,7 +73,7 @@ fn random_32_bytes(rng: &mut R) -> [u8; 32] { impl SecretKey { /// Creates a new random secret key #[inline] - pub fn new(secp: &Secp256k1, rng: &mut R) -> SecretKey { + pub fn new(secp: &Secp256k1, rng: &mut R) -> SecretKey { let mut data = random_32_bytes(rng); unsafe { while ffi::secp256k1_ec_seckey_verify(secp.ctx, data.as_ptr()) == 0 {