mirror of
https://github.com/AleoHQ/leo.git
synced 2025-01-01 14:28:52 +03:00
Update r1cs traits
This commit is contained in:
parent
bfdf3c4dca
commit
400e3dd440
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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>
|
||||
|
@ -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>;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user