Skip to content
This repository was archived by the owner on Feb 26, 2020. It is now read-only.

Commit 246aefe

Browse files
author
Andronik Ordian
authored
Merge pull request #18 from paritytech/na-bump-rand
[Cargo.toml] update rand to 0.7 (breaking change)
2 parents 72c93ab + b8c8f7a commit 246aefe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ dev = ["clippy"]
2727

2828
[dependencies]
2929
arrayvec = "0.4"
30-
clippy = {version = "0.0", optional = true}
31-
rand = "0.6"
30+
clippy = { version = "0.0", optional = true }
31+
rand = "0.7"
3232

3333
[dev-dependencies]
3434
hex-literal = "0.2"
35-
rand_core = "0.4.2"
35+
rand_core = "0.5.1"

src/key.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! # Public and secret keys
1717
1818
use arrayvec::ArrayVec;
19-
use rand::Rng;
19+
use rand::RngCore;
2020

2121
use super::{Secp256k1, ContextFlag};
2222
use super::Error::{self, IncapableContext, InvalidPublicKey, InvalidSecretKey};
@@ -64,7 +64,7 @@ pub const MINUS_ONE_KEY: SecretKey = SecretKey([0xff, 0xff, 0xff, 0xff, 0xff, 0x
6464
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
6565
pub struct PublicKey(ffi::PublicKey);
6666

67-
fn random_32_bytes<R: Rng>(rng: &mut R) -> [u8; 32] {
67+
fn random_32_bytes<R: RngCore>(rng: &mut R) -> [u8; 32] {
6868
let mut ret = [0u8; 32];
6969
rng.fill_bytes(&mut ret);
7070
ret
@@ -73,7 +73,7 @@ fn random_32_bytes<R: Rng>(rng: &mut R) -> [u8; 32] {
7373
impl SecretKey {
7474
/// Creates a new random secret key
7575
#[inline]
76-
pub fn new<R: Rng>(secp: &Secp256k1, rng: &mut R) -> SecretKey {
76+
pub fn new<R: RngCore>(secp: &Secp256k1, rng: &mut R) -> SecretKey {
7777
let mut data = random_32_bytes(rng);
7878
unsafe {
7979
while ffi::secp256k1_ec_seckey_verify(secp.ctx, data.as_ptr()) == 0 {

0 commit comments

Comments
 (0)