mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-10 16:01:28 +01:00
Update r1cs-std tests
This commit is contained in:
@@ -736,7 +736,7 @@ mod test {
|
|||||||
use super::{AllocatedBit, Boolean};
|
use super::{AllocatedBit, Boolean};
|
||||||
use crate::{
|
use crate::{
|
||||||
test_constraint_system::TestConstraintSystem,
|
test_constraint_system::TestConstraintSystem,
|
||||||
utils::{AllocGadget, ConditionalEqGadget, EqGadget, ToBytesGadget},
|
prelude::*
|
||||||
};
|
};
|
||||||
use algebra::{fields::bls12_381::Fr, BitIterator, Field, PrimeField};
|
use algebra::{fields::bls12_381::Fr, BitIterator, Field, PrimeField};
|
||||||
use rand::{Rand, SeedableRng, XorShiftRng};
|
use rand::{Rand, SeedableRng, XorShiftRng};
|
||||||
|
|||||||
@@ -292,9 +292,7 @@ impl<ConstraintF: Field> AllocGadget<u8, ConstraintF> for UInt8 {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::UInt8;
|
use super::UInt8;
|
||||||
use crate::{
|
use crate::{prelude::*, test_constraint_system::TestConstraintSystem};
|
||||||
bits::boolean::Boolean, test_constraint_system::TestConstraintSystem, utils::AllocGadget,
|
|
||||||
};
|
|
||||||
use algebra::fields::bls12_381::Fr;
|
use algebra::fields::bls12_381::Fr;
|
||||||
use rand::{Rng, SeedableRng, XorShiftRng};
|
use rand::{Rng, SeedableRng, XorShiftRng};
|
||||||
use r1cs_core::ConstraintSystem;
|
use r1cs_core::ConstraintSystem;
|
||||||
|
|||||||
@@ -215,10 +215,7 @@ pub trait FieldGadget<F: Field, ConstraintF: Field>:
|
|||||||
mod test {
|
mod test {
|
||||||
use rand::{self, thread_rng, Rand, SeedableRng, XorShiftRng};
|
use rand::{self, thread_rng, Rand, SeedableRng, XorShiftRng};
|
||||||
|
|
||||||
use super::FieldGadget;
|
use crate::{prelude::*, test_constraint_system::TestConstraintSystem};
|
||||||
use crate::{
|
|
||||||
bits::boolean::Boolean, test_constraint_system::TestConstraintSystem, utils::AllocGadget,
|
|
||||||
};
|
|
||||||
use algebra::{fields::Field, BitIterator};
|
use algebra::{fields::Field, BitIterator};
|
||||||
use r1cs_core::ConstraintSystem;
|
use r1cs_core::ConstraintSystem;
|
||||||
|
|
||||||
|
|||||||
@@ -12,16 +12,10 @@ pub type G2PreparedGadget = Bls12G2PreparedGadget<Bls12_377Parameters>;
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use crate::fields::FieldGadget;
|
|
||||||
use rand;
|
use rand;
|
||||||
|
|
||||||
use super::{G1Gadget, G2Gadget};
|
use super::{G1Gadget, G2Gadget};
|
||||||
use crate::{
|
use crate::{test_constraint_system::TestConstraintSystem, prelude::*};
|
||||||
boolean::Boolean,
|
|
||||||
groups::GroupGadget,
|
|
||||||
test_constraint_system::TestConstraintSystem,
|
|
||||||
utils::{AllocGadget, CondSelectGadget, EqGadget},
|
|
||||||
};
|
|
||||||
use algebra::{
|
use algebra::{
|
||||||
curves::bls12_377::{G1Projective as G1, G2Projective as G2},
|
curves::bls12_377::{G1Projective as G1, G2Projective as G2},
|
||||||
fields::bls12_377::Fr,
|
fields::bls12_377::Fr,
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
use rand;
|
use rand;
|
||||||
|
|
||||||
use crate::{
|
use crate::{prelude::*, groups::test::group_test};
|
||||||
boolean::Boolean,
|
|
||||||
groups::{test::group_test, GroupGadget},
|
|
||||||
utils::{AllocGadget, CondSelectGadget},
|
|
||||||
};
|
|
||||||
|
|
||||||
use algebra::{
|
use algebra::{
|
||||||
curves::{models::TEModelParameters, twisted_edwards_extended::GroupAffine as TEAffine},
|
curves::{models::TEModelParameters, twisted_edwards_extended::GroupAffine as TEAffine},
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ mod test {
|
|||||||
use r1cs_core::ConstraintSystem;
|
use r1cs_core::ConstraintSystem;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
groups::GroupGadget, test_constraint_system::TestConstraintSystem, utils::AllocGadget,
|
prelude::*, test_constraint_system::TestConstraintSystem,
|
||||||
};
|
};
|
||||||
use algebra::groups::Group;
|
use algebra::groups::Group;
|
||||||
use rand;
|
use rand;
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ pub mod prelude {
|
|||||||
pub use crate::alloc::*;
|
pub use crate::alloc::*;
|
||||||
pub use crate::fields::FieldGadget;
|
pub use crate::fields::FieldGadget;
|
||||||
pub use crate::groups::GroupGadget;
|
pub use crate::groups::GroupGadget;
|
||||||
|
pub use crate::pairing::PairingGadget;
|
||||||
pub use crate::bits::{ToBitsGadget, ToBytesGadget, boolean::Boolean, uint8::UInt8, uint32::UInt32};
|
pub use crate::bits::{ToBitsGadget, ToBytesGadget, boolean::Boolean, uint8::UInt8, uint32::UInt32};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ pub trait PairingGadget<PairingE: PairingEngine, ConstraintF: Field> {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
// use rand;
|
// use rand;
|
||||||
use crate::{boolean::Boolean, test_constraint_system::TestConstraintSystem};
|
use crate::test_constraint_system::TestConstraintSystem;
|
||||||
use algebra::{BitIterator, Field};
|
use algebra::{BitIterator, Field};
|
||||||
use r1cs_core::ConstraintSystem;
|
use r1cs_core::ConstraintSystem;
|
||||||
|
|
||||||
@@ -71,10 +71,8 @@ mod test {
|
|||||||
|
|
||||||
use super::bls12_377::PairingGadget;
|
use super::bls12_377::PairingGadget;
|
||||||
use crate::{
|
use crate::{
|
||||||
fields::FieldGadget,
|
|
||||||
groups::bls12::bls12_377::{G1Gadget, G1PreparedGadget, G2Gadget, G2PreparedGadget},
|
groups::bls12::bls12_377::{G1Gadget, G1PreparedGadget, G2Gadget, G2PreparedGadget},
|
||||||
pairing::PairingGadget as _,
|
prelude::*, pairing::PairingGadget as _,
|
||||||
utils::{AllocGadget, EqGadget},
|
|
||||||
};
|
};
|
||||||
use algebra::curves::bls12_377::{Bls12_377, G1Projective, G2Projective};
|
use algebra::curves::bls12_377::{Bls12_377, G1Projective, G2Projective};
|
||||||
use std::ops::Mul;
|
use std::ops::Mul;
|
||||||
|
|||||||
Reference in New Issue
Block a user