Merge pull request #134 from NikVolf/z-rng
Avoid using rand_os crate (fixes warnings)
This commit is contained in:
commit
524055bbb4
|
@ -368,7 +368,6 @@ dependencies = [
|
|||
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pairing 0.14.2",
|
||||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"zcash_primitives 0.0.0",
|
||||
"zcash_proofs 0.0.0",
|
||||
]
|
||||
|
@ -513,15 +512,6 @@ dependencies = [
|
|||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_os"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_xorshift"
|
||||
version = "0.2.0"
|
||||
|
@ -640,7 +630,6 @@ dependencies = [
|
|||
"pairing 0.14.2",
|
||||
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -656,7 +645,6 @@ dependencies = [
|
|||
"ff 0.4.0",
|
||||
"pairing 0.14.2",
|
||||
"rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"zcash_primitives 0.0.0",
|
||||
]
|
||||
|
@ -717,7 +705,6 @@ dependencies = [
|
|||
"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853"
|
||||
"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
|
||||
"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
|
||||
"checksum rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a788ae3edb696cfcba1c19bfd388cc4b8c21f8a408432b199c072825084da58a"
|
||||
"checksum rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8"
|
||||
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
||||
"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d"
|
||||
|
|
|
@ -25,6 +25,5 @@ pairing = { path = "../pairing" }
|
|||
lazy_static = "1"
|
||||
byteorder = "1"
|
||||
rand_core = "0.5"
|
||||
rand_os = "0.2"
|
||||
zcash_primitives = { path = "../zcash_primitives" }
|
||||
zcash_proofs = { path = "../zcash_proofs" }
|
||||
|
|
|
@ -27,8 +27,7 @@ use blake2s_simd::Params as Blake2sParams;
|
|||
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
|
||||
use rand_core::RngCore;
|
||||
use rand_os::OsRng;
|
||||
use rand_core::{OsRng, RngCore};
|
||||
use std::io::BufReader;
|
||||
|
||||
use libc::{c_char, c_uchar, size_t};
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use ff::{PrimeField, PrimeFieldRepr};
|
||||
use pairing::bls12_381::Bls12;
|
||||
use rand_core::RngCore;
|
||||
use rand_os::OsRng;
|
||||
use rand_core::{OsRng, RngCore};
|
||||
use zcash_primitives::jubjub::{edwards, JubjubBls12};
|
||||
use zcash_primitives::primitives::{Diversifier, ViewingKey};
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ log = "0.4"
|
|||
pairing = { path = "../pairing" }
|
||||
rand = "0.7"
|
||||
rand_core = "0.5"
|
||||
rand_os = "0.2"
|
||||
sha2 = "0.8"
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -2,13 +2,11 @@
|
|||
|
||||
extern crate pairing;
|
||||
extern crate rand_core;
|
||||
extern crate rand_os;
|
||||
extern crate test;
|
||||
extern crate zcash_primitives;
|
||||
|
||||
use pairing::bls12_381::Bls12;
|
||||
use rand_core::RngCore;
|
||||
use rand_os::OsRng;
|
||||
use rand_core::{OsRng, RngCore};
|
||||
use zcash_primitives::jubjub::JubjubBls12;
|
||||
use zcash_primitives::pedersen_hash::{pedersen_hash, Personalization};
|
||||
|
||||
|
|
|
@ -202,18 +202,19 @@ impl<Node: Hashable> CommitmentTree<Node> {
|
|||
/// ```
|
||||
/// extern crate ff;
|
||||
/// extern crate pairing;
|
||||
/// extern crate rand_os;
|
||||
/// extern crate rand_core;
|
||||
/// extern crate zcash_primitives;
|
||||
///
|
||||
/// use ff::{Field, PrimeField};
|
||||
/// use pairing::bls12_381::Fr;
|
||||
/// use rand_os::OsRng;
|
||||
/// use rand_core::OsRng;
|
||||
/// use zcash_primitives::{
|
||||
/// merkle_tree::{CommitmentTree, IncrementalWitness},
|
||||
/// sapling::Node,
|
||||
/// };
|
||||
///
|
||||
/// let mut rng = OsRng::new().unwrap();
|
||||
/// let mut rng = OsRng;
|
||||
///
|
||||
/// let mut tree = CommitmentTree::<Node>::new();
|
||||
///
|
||||
/// tree.append(Node::new(Fr::random(&mut rng).into_repr()));
|
||||
|
|
|
@ -214,12 +214,12 @@ fn prf_ock(
|
|||
/// ```
|
||||
/// extern crate ff;
|
||||
/// extern crate pairing;
|
||||
/// extern crate rand_os;
|
||||
/// extern crate rand_core;
|
||||
/// extern crate zcash_primitives;
|
||||
///
|
||||
/// use ff::Field;
|
||||
/// use pairing::bls12_381::Bls12;
|
||||
/// use rand_os::OsRng;
|
||||
/// use rand_core::OsRng;
|
||||
/// use zcash_primitives::{
|
||||
/// jubjub::fs::Fs,
|
||||
/// keys::OutgoingViewingKey,
|
||||
|
@ -556,8 +556,8 @@ mod tests {
|
|||
use crypto_api_chachapoly::ChachaPolyIetf;
|
||||
use ff::{Field, PrimeField, PrimeFieldRepr};
|
||||
use pairing::bls12_381::{Bls12, Fr, FrRepr};
|
||||
use rand_core::OsRng;
|
||||
use rand_core::{CryptoRng, RngCore};
|
||||
use rand_os::OsRng;
|
||||
use std::str::FromStr;
|
||||
|
||||
use super::{
|
||||
|
|
|
@ -74,7 +74,7 @@ pub trait TxProver {
|
|||
pub(crate) mod mock {
|
||||
use ff::Field;
|
||||
use pairing::bls12_381::{Bls12, Fr};
|
||||
use rand_os::OsRng;
|
||||
use rand_core::OsRng;
|
||||
|
||||
use crate::{
|
||||
jubjub::{edwards, fs::Fs, FixedGenerators, Unknown},
|
||||
|
|
|
@ -534,7 +534,7 @@ impl<R: RngCore + CryptoRng> Builder<R> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ff::{Field, PrimeField};
|
||||
use rand::rngs::OsRng;
|
||||
use rand_core::OsRng;
|
||||
|
||||
use crate::jubjub::fs::Fs;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use ff::Field;
|
||||
use pairing::bls12_381::Bls12;
|
||||
use rand_os::OsRng;
|
||||
use rand_core::OsRng;
|
||||
|
||||
use crate::jubjub::{fs::Fs, FixedGenerators};
|
||||
|
||||
|
|
|
@ -14,11 +14,10 @@ byteorder = "1"
|
|||
directories = { version = "1", optional = true }
|
||||
ff = { path = "../ff" }
|
||||
pairing = { path = "../pairing" }
|
||||
rand_os = "0.2"
|
||||
rand_core = "0.5"
|
||||
zcash_primitives = { path = "../zcash_primitives" }
|
||||
|
||||
[dev-dependencies]
|
||||
rand_core = "0.5"
|
||||
rand_xorshift = "0.2"
|
||||
|
||||
[features]
|
||||
|
|
|
@ -4,7 +4,7 @@ use bellman::{
|
|||
};
|
||||
use ff::Field;
|
||||
use pairing::bls12_381::{Bls12, Fr};
|
||||
use rand_os::OsRng;
|
||||
use rand_core::OsRng;
|
||||
use zcash_primitives::{
|
||||
jubjub::{edwards, fs::Fs, FixedGenerators, JubjubBls12, Unknown},
|
||||
primitives::{Diversifier, Note, PaymentAddress, ProofGenerationKey, ValueCommitment},
|
||||
|
|
Loading…
Reference in New Issue