Update r1cs traits

This commit is contained in:
howardwu 2021-03-04 10:36:54 -08:00
parent bfdf3c4dca
commit 400e3dd440
16 changed files with 16 additions and 16 deletions

View File

@ -26,7 +26,7 @@ use leo_asg::Expression;
use leo_asg::Span;
use snarkvm_models::curves::PrimeField;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_r1cs::ConstraintSystem;
impl<'a, F: PrimeField, G: GroupType<F>> ConstrainedProgram<'a, F, G> {
/// Enforce array expressions

View File

@ -22,8 +22,8 @@ use crate::GroupType;
use leo_asg::Span;
use snarkvm_models::curves::PrimeField;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_models::gadgets::utilities::boolean::Boolean;
use snarkvm_r1cs::ConstraintSystem;
pub fn enforce_and<'a, F: PrimeField, G: GroupType<F>, CS: ConstraintSystem<F>>(
cs: &mut CS,

View File

@ -23,7 +23,7 @@ use leo_asg::Span;
use leo_gadgets::bits::comparator::EvaluateLtGadget;
use snarkvm_models::curves::PrimeField;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_r1cs::ConstraintSystem;
pub fn evaluate_lt<'a, F: PrimeField, G: GroupType<F>, CS: ConstraintSystem<F>>(
cs: &mut CS,

View File

@ -27,7 +27,7 @@ use leo_ast::InputValue;
use leo_ast::Parameter;
use snarkvm_models::curves::PrimeField;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_r1cs::ConstraintSystem;
use indexmap::IndexMap;

View File

@ -24,9 +24,9 @@ use leo_ast::Span;
use snarkvm_errors::gadgets::SynthesisError;
use snarkvm_models::curves::PrimeField;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_models::gadgets::utilities::alloc::AllocGadget;
use snarkvm_models::gadgets::utilities::boolean::Boolean;
use snarkvm_r1cs::ConstraintSystem;
pub(crate) fn allocate_bool<F: PrimeField, CS: ConstraintSystem<F>>(
cs: &mut CS,

View File

@ -25,7 +25,7 @@ use leo_ast::InputValue;
use snarkvm_errors::gadgets::SynthesisError;
use snarkvm_models::curves::PrimeField;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_r1cs::ConstraintSystem;
pub(crate) fn allocate_group<F: PrimeField, G: GroupType<F>, CS: ConstraintSystem<F>>(
cs: &mut CS,

View File

@ -15,7 +15,7 @@
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use snarkvm_errors::gadgets::SynthesisError;
use snarkvm_models::curves::Field;
use snarkvm_fields::Field;
use snarkvm_models::curves::PrimeField;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_models::gadgets::utilities::uint::UInt;

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use snarkvm_models::curves::Field;
use snarkvm_fields::Field;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
/// Returns division of `self` / `other` in the constraint system.

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use snarkvm_models::curves::Field;
use snarkvm_fields::Field;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
/// Returns multiplication of `self` * `other` in the constraint system.

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use snarkvm_models::curves::Field;
use snarkvm_fields::Field;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
/// Returns exponentiation of `self` ** `other` in the constraint system.

View File

@ -15,7 +15,7 @@
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use snarkvm_fields::Field;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_r1cs::ConstraintSystem;
/// Returns subtraction of `self` - `other` in the constraint system.
pub trait Sub<F: Field, Rhs = Self>

View File

@ -17,7 +17,6 @@
use snarkvm_errors::gadgets::SynthesisError;
use snarkvm_fields::Field;
use snarkvm_models::curves::PrimeField;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_models::gadgets::utilities::boolean::Boolean;
use snarkvm_models::gadgets::utilities::select::CondSelectGadget;
use snarkvm_models::gadgets::utilities::uint::UInt128;
@ -25,6 +24,7 @@ use snarkvm_models::gadgets::utilities::uint::UInt16;
use snarkvm_models::gadgets::utilities::uint::UInt32;
use snarkvm_models::gadgets::utilities::uint::UInt64;
use snarkvm_models::gadgets::utilities::uint::UInt8;
use snarkvm_r1cs::ConstraintSystem;
pub trait EvaluateLtGadget<F: Field> {
fn less_than<CS: ConstraintSystem<F>>(&self, cs: CS, other: &Self) -> Result<Boolean, SynthesisError>;

View File

@ -24,7 +24,7 @@ use crate::Int8;
use core::borrow::Borrow;
use core::iter;
use snarkvm_errors::gadgets::SynthesisError;
use snarkvm_models::curves::Field;
use snarkvm_fields::Field;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_models::gadgets::utilities::alloc::AllocGadget;
use snarkvm_models::gadgets::utilities::boolean::AllocatedBit;

View File

@ -19,11 +19,11 @@ use leo_gadgets::Int64;
use snarkvm_models::curves::One;
use snarkvm_models::curves::Zero;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_models::gadgets::r1cs::Fr;
use snarkvm_models::gadgets::r1cs::TestConstraintSystem;
use snarkvm_models::gadgets::utilities::alloc::AllocGadget;
use snarkvm_models::gadgets::utilities::boolean::Boolean;
use snarkvm_r1cs::ConstraintSystem;
use rand::Rng;
use rand_core::SeedableRng;

View File

@ -15,7 +15,7 @@
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use snarkvm_errors::gadgets::SynthesisError;
use snarkvm_models::curves::Field;
use snarkvm_fields::Field;
use snarkvm_models::curves::PairingEngine;
use snarkvm_models::gadgets::r1cs::ConstraintSystem;
use snarkvm_models::gadgets::r1cs::Index;

View File

@ -21,7 +21,7 @@ use num_bigint::BigUint;
use serde::Deserialize;
use serde::Serialize;
use snarkvm_errors::curves::FieldError;
use snarkvm_models::curves::Field;
use snarkvm_fields::Field;
use snarkvm_models::curves::Fp256;
use snarkvm_models::curves::Fp256Parameters;