diff --git a/r1cs-std/src/bits/boolean.rs b/r1cs-std/src/bits/boolean.rs index de29c90..e455c3d 100644 --- a/r1cs-std/src/bits/boolean.rs +++ b/r1cs-std/src/bits/boolean.rs @@ -736,7 +736,7 @@ mod test { use super::{AllocatedBit, Boolean}; use crate::{ test_constraint_system::TestConstraintSystem, - utils::{AllocGadget, ConditionalEqGadget, EqGadget, ToBytesGadget}, + prelude::* }; use algebra::{fields::bls12_381::Fr, BitIterator, Field, PrimeField}; use rand::{Rand, SeedableRng, XorShiftRng}; diff --git a/r1cs-std/src/bits/uint8.rs b/r1cs-std/src/bits/uint8.rs index 61eda09..25ddaf8 100644 --- a/r1cs-std/src/bits/uint8.rs +++ b/r1cs-std/src/bits/uint8.rs @@ -292,9 +292,7 @@ impl AllocGadget for UInt8 { #[cfg(test)] mod test { use super::UInt8; - use crate::{ - bits::boolean::Boolean, test_constraint_system::TestConstraintSystem, utils::AllocGadget, - }; + use crate::{prelude::*, test_constraint_system::TestConstraintSystem}; use algebra::fields::bls12_381::Fr; use rand::{Rng, SeedableRng, XorShiftRng}; use r1cs_core::ConstraintSystem; diff --git a/r1cs-std/src/fields/mod.rs b/r1cs-std/src/fields/mod.rs index e3aeebc..c3b5313 100644 --- a/r1cs-std/src/fields/mod.rs +++ b/r1cs-std/src/fields/mod.rs @@ -215,10 +215,7 @@ pub trait FieldGadget: mod test { use rand::{self, thread_rng, Rand, SeedableRng, XorShiftRng}; - use super::FieldGadget; - use crate::{ - bits::boolean::Boolean, test_constraint_system::TestConstraintSystem, utils::AllocGadget, - }; + use crate::{prelude::*, test_constraint_system::TestConstraintSystem}; use algebra::{fields::Field, BitIterator}; use r1cs_core::ConstraintSystem; diff --git a/r1cs-std/src/groups/curves/short_weierstrass/bls12/bls12_377.rs b/r1cs-std/src/groups/curves/short_weierstrass/bls12/bls12_377.rs index 7f379a1..eb3b0ba 100644 --- a/r1cs-std/src/groups/curves/short_weierstrass/bls12/bls12_377.rs +++ b/r1cs-std/src/groups/curves/short_weierstrass/bls12/bls12_377.rs @@ -12,16 +12,10 @@ pub type G2PreparedGadget = Bls12G2PreparedGadget; #[cfg(test)] mod test { - use crate::fields::FieldGadget; use rand; use super::{G1Gadget, G2Gadget}; - use crate::{ - boolean::Boolean, - groups::GroupGadget, - test_constraint_system::TestConstraintSystem, - utils::{AllocGadget, CondSelectGadget, EqGadget}, - }; + use crate::{test_constraint_system::TestConstraintSystem, prelude::*}; use algebra::{ curves::bls12_377::{G1Projective as G1, G2Projective as G2}, fields::bls12_377::Fr, diff --git a/r1cs-std/src/groups/curves/twisted_edwards/test.rs b/r1cs-std/src/groups/curves/twisted_edwards/test.rs index 5a3f6b1..c959092 100644 --- a/r1cs-std/src/groups/curves/twisted_edwards/test.rs +++ b/r1cs-std/src/groups/curves/twisted_edwards/test.rs @@ -1,10 +1,6 @@ use rand; -use crate::{ - boolean::Boolean, - groups::{test::group_test, GroupGadget}, - utils::{AllocGadget, CondSelectGadget}, -}; +use crate::{prelude::*, groups::test::group_test}; use algebra::{ curves::{models::TEModelParameters, twisted_edwards_extended::GroupAffine as TEAffine}, diff --git a/r1cs-std/src/groups/mod.rs b/r1cs-std/src/groups/mod.rs index 4176dd9..4731d45 100644 --- a/r1cs-std/src/groups/mod.rs +++ b/r1cs-std/src/groups/mod.rs @@ -146,7 +146,7 @@ mod test { use r1cs_core::ConstraintSystem; use crate::{ - groups::GroupGadget, test_constraint_system::TestConstraintSystem, utils::AllocGadget, + prelude::*, test_constraint_system::TestConstraintSystem, }; use algebra::groups::Group; use rand; diff --git a/r1cs-std/src/lib.rs b/r1cs-std/src/lib.rs index 2e32ff5..d60bc96 100644 --- a/r1cs-std/src/lib.rs +++ b/r1cs-std/src/lib.rs @@ -64,6 +64,7 @@ pub mod prelude { pub use crate::alloc::*; pub use crate::fields::FieldGadget; pub use crate::groups::GroupGadget; + pub use crate::pairing::PairingGadget; pub use crate::bits::{ToBitsGadget, ToBytesGadget, boolean::Boolean, uint8::UInt8, uint32::UInt32}; } diff --git a/r1cs-std/src/pairing/mod.rs b/r1cs-std/src/pairing/mod.rs index 17da3f6..5b3fcbc 100644 --- a/r1cs-std/src/pairing/mod.rs +++ b/r1cs-std/src/pairing/mod.rs @@ -58,7 +58,7 @@ pub trait PairingGadget { #[cfg(test)] mod test { // use rand; - use crate::{boolean::Boolean, test_constraint_system::TestConstraintSystem}; + use crate::test_constraint_system::TestConstraintSystem; use algebra::{BitIterator, Field}; use r1cs_core::ConstraintSystem; @@ -71,10 +71,8 @@ mod test { use super::bls12_377::PairingGadget; use crate::{ - fields::FieldGadget, groups::bls12::bls12_377::{G1Gadget, G1PreparedGadget, G2Gadget, G2PreparedGadget}, - pairing::PairingGadget as _, - utils::{AllocGadget, EqGadget}, + prelude::*, pairing::PairingGadget as _, }; use algebra::curves::bls12_377::{Bls12_377, G1Projective, G2Projective}; use std::ops::Mul;