Move ConstraintVar to r1cs-core

This commit is contained in:
Pratyush Mishra
2019-08-12 18:05:24 -07:00
parent c610ecbcc5
commit b617d217a1
4 changed files with 9 additions and 300 deletions

View File

@@ -1,20 +1,12 @@
use algebra::{bytes::ToBytes, FpParameters, PrimeField};
use r1cs_core::{ConstraintSystem, LinearCombination, SynthesisError};
use r1cs_core::{ConstraintSystem, LinearCombination, SynthesisError, ConstraintVar::{self, *}};
use std::borrow::Borrow;
use super::FieldGadget;
use crate::{
boolean::{AllocatedBit, Boolean},
uint8::UInt8,
};
use crate::boolean::AllocatedBit;
use crate::Assignment;
use crate::prelude::*;
use crate::{
Assignment,
ConstraintVar::{self, *},
};
#[derive(Debug)]
pub struct FpGadget<F: PrimeField> {

View File

@@ -2,12 +2,12 @@ use algebra::{
fields::{Fp2, Fp2Parameters},
Field, PrimeField,
};
use r1cs_core::{ConstraintSystem, SynthesisError};
use r1cs_core::{ConstraintSystem, SynthesisError, ConstraintVar};
use std::{borrow::Borrow, marker::PhantomData};
use crate::fields::fp::FpGadget;
use crate::prelude::*;
use crate::{Assignment, ConstraintVar};
use crate::Assignment;
#[derive(Derivative)]
#[derivative(Debug(bound = "P: Fp2Parameters, ConstraintF: PrimeField"))]

View File

@@ -5,11 +5,10 @@ use algebra::{
},
PrimeField,
};
use r1cs_core::{ConstraintSystem, SynthesisError};
use r1cs_core::{ConstraintSystem, SynthesisError, ConstraintVar};
use std::{borrow::Borrow, marker::PhantomData};
use crate::prelude::*;
use crate::ConstraintVar;
use crate::Assignment;
type Fp2Gadget<P, ConstraintF> = super::fp2::Fp2Gadget<<P as Fp6Parameters>::Fp2Params, ConstraintF>;