Browse Source

Update r1cs-std tests

master
Pratyush Mishra 5 years ago
parent
commit
c610ecbcc5
8 changed files with 9 additions and 25 deletions
  1. +1
    -1
      r1cs-std/src/bits/boolean.rs
  2. +1
    -3
      r1cs-std/src/bits/uint8.rs
  3. +1
    -4
      r1cs-std/src/fields/mod.rs
  4. +1
    -7
      r1cs-std/src/groups/curves/short_weierstrass/bls12/bls12_377.rs
  5. +1
    -5
      r1cs-std/src/groups/curves/twisted_edwards/test.rs
  6. +1
    -1
      r1cs-std/src/groups/mod.rs
  7. +1
    -0
      r1cs-std/src/lib.rs
  8. +2
    -4
      r1cs-std/src/pairing/mod.rs

+ 1
- 1
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};

+ 1
- 3
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;

+ 1
- 4
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;

+ 1
- 7
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,

+ 1
- 5
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},

+ 1
- 1
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;

+ 1
- 0
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};
}

+ 2
- 4
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;

Loading…
Cancel
Save