Replace rand with rand_core where possible

Turns out rand_core offers OsRng.
This commit is contained in:
Luke Parker
2022-07-27 05:43:23 -04:00
parent 023afaf7ce
commit 755dc84859
14 changed files with 23 additions and 25 deletions

View File

@@ -24,7 +24,7 @@ async fn test_ecrecover_hack() {
};
use k256::elliptic_curve::bigint::ArrayEncoding;
use k256::{Scalar, U256};
use rand::rngs::OsRng;
use rand_core::OsRng;
let anvil = Anvil::new().spawn();
let wallet: LocalWallet = anvil.keys()[0].clone().into();

View File

@@ -12,7 +12,7 @@ fn test_ecrecover() {
signature::{Signer, Verifier},
SigningKey, VerifyingKey,
};
use rand::rngs::OsRng;
use rand_core::OsRng;
let private = SigningKey::random(&mut OsRng);
let public = VerifyingKey::from(&private);
@@ -33,7 +33,7 @@ fn test_signing() {
algorithm::Schnorr,
tests::{algorithm_machines, key_gen, sign},
};
use rand::rngs::OsRng;
use rand_core::OsRng;
let keys = key_gen::<_, Secp256k1>(&mut OsRng);
let _group_key = keys[&1].group_key();
@@ -53,7 +53,7 @@ fn test_ecrecover_hack() {
algorithm::Schnorr,
tests::{algorithm_machines, key_gen, sign},
};
use rand::rngs::OsRng;
use rand_core::OsRng;
let keys = key_gen::<_, Secp256k1>(&mut OsRng);
let group_key = keys[&1].group_key();