From 681c0f1312cebf96b9664884ec32347a47f489de Mon Sep 17 00:00:00 2001 From: Weikeng Chen Date: Thu, 4 Feb 2021 16:59:47 -0800 Subject: [PATCH] Replace `rand` with `ark_std::rand` (#23) --- Cargo.toml | 1 - src/generator.rs | 2 +- src/lib.rs | 2 +- src/prover.rs | 2 +- tests/mimc.rs | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 60ae165..7f61f34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,6 @@ ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std", default-featur tracing = { version = "0.1", default-features = false, features = [ "attributes" ], optional = true } derivative = { version = "2.0", features = ["use_core"], optional = true} -rand = { version = "0.7", default-features = false } rayon = { version = "1", optional = true } [dev-dependencies] diff --git a/src/generator.rs b/src/generator.rs index 1b66a21..ffe369c 100644 --- a/src/generator.rs +++ b/src/generator.rs @@ -6,8 +6,8 @@ use ark_relations::r1cs::{ ConstraintSynthesizer, ConstraintSystem, OptimizationGoal, Result as R1CSResult, SynthesisError, SynthesisMode, }; +use ark_std::rand::Rng; use ark_std::{cfg_into_iter, cfg_iter}; -use rand::Rng; #[cfg(feature = "parallel")] use rayon::prelude::*; diff --git a/src/lib.rs b/src/lib.rs index 8a61894..236ec0d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,8 +47,8 @@ pub use self::{generator::*, prover::*, verifier::*}; use ark_crypto_primitives::snark::*; use ark_ec::PairingEngine; use ark_relations::r1cs::{ConstraintSynthesizer, SynthesisError}; +use ark_std::rand::RngCore; use ark_std::{marker::PhantomData, vec::Vec}; -use rand::RngCore; /// The SNARK of [[Groth16]](https://eprint.iacr.org/2016/260.pdf). pub struct Groth16 { diff --git a/src/prover.rs b/src/prover.rs index 527997f..67509ef 100644 --- a/src/prover.rs +++ b/src/prover.rs @@ -5,8 +5,8 @@ use ark_poly::GeneralEvaluationDomain; use ark_relations::r1cs::{ ConstraintSynthesizer, ConstraintSystem, OptimizationGoal, Result as R1CSResult, }; +use ark_std::rand::Rng; use ark_std::{cfg_into_iter, cfg_iter, vec::Vec}; -use rand::Rng; #[cfg(feature = "parallel")] use rayon::prelude::*; diff --git a/tests/mimc.rs b/tests/mimc.rs index 8027495..7cfa5b2 100644 --- a/tests/mimc.rs +++ b/tests/mimc.rs @@ -11,7 +11,7 @@ )] // For randomness (during paramgen and proof generation) -use rand::Rng; +use ark_std::rand::Rng; // For benchmarking use std::time::{Duration, Instant};