Browse Source

Make libraries compile

master
Pratyush Mishra 4 years ago
parent
commit
a3e1cd6cf2
2 changed files with 7 additions and 6 deletions
  1. +4
    -3
      r1cs-std/src/bits/boolean.rs
  2. +3
    -3
      r1cs-std/src/groups/curves/short_weierstrass/mod.rs

+ 4
- 3
r1cs-std/src/bits/boolean.rs

@ -308,7 +308,7 @@ impl AllocGadget for AllocatedBit {
} }
} }
impl<ConstraintF: Field> CondSelectGadget<ConstraintF> for AllocatedBit {
impl<ConstraintF: PrimeField> CondSelectGadget<ConstraintF> for AllocatedBit {
fn conditionally_select<CS: ConstraintSystem<ConstraintF>>( fn conditionally_select<CS: ConstraintSystem<ConstraintF>>(
cs: CS, cs: CS,
cond: &Boolean, cond: &Boolean,
@ -328,7 +328,7 @@ impl CondSelectGadget for AllocatedBit {
} }
} }
fn cond_select_helper<F: Field, CS: ConstraintSystem<F>>(
fn cond_select_helper<F: PrimeField, CS: ConstraintSystem<F>>(
mut cs: CS, mut cs: CS,
cond: &Boolean, cond: &Boolean,
first: (Option<bool>, impl Into<ConstraintVar<F>>), first: (Option<bool>, impl Into<ConstraintVar<F>>),
@ -785,7 +785,8 @@ impl ToBytesGadget for Boolean {
self.to_bytes(cs) self.to_bytes(cs)
} }
} }
impl<ConstraintF: Field> CondSelectGadget<ConstraintF> for Boolean {
impl<ConstraintF: PrimeField> CondSelectGadget<ConstraintF> for Boolean {
fn conditionally_select<CS>( fn conditionally_select<CS>(
mut cs: CS, mut cs: CS,
cond: &Self, cond: &Self,

+ 3
- 3
r1cs-std/src/groups/curves/short_weierstrass/mod.rs

@ -91,7 +91,7 @@ impl GroupGadget, ConstraintF>
for AffineGadget<P, ConstraintF, F> for AffineGadget<P, ConstraintF, F>
where where
P: SWModelParameters, P: SWModelParameters,
ConstraintF: Field,
ConstraintF: PrimeField,
F: FieldGadget<P::BaseField, ConstraintF>, F: FieldGadget<P::BaseField, ConstraintF>,
{ {
type Value = SWProjective<P>; type Value = SWProjective<P>;
@ -329,7 +329,7 @@ where
impl<P, ConstraintF, F> CondSelectGadget<ConstraintF> for AffineGadget<P, ConstraintF, F> impl<P, ConstraintF, F> CondSelectGadget<ConstraintF> for AffineGadget<P, ConstraintF, F>
where where
P: SWModelParameters, P: SWModelParameters,
ConstraintF: Field,
ConstraintF: PrimeField,
F: FieldGadget<P::BaseField, ConstraintF>, F: FieldGadget<P::BaseField, ConstraintF>,
{ {
#[inline] #[inline]
@ -424,7 +424,7 @@ impl AllocGadget, ConstraintF>
for AffineGadget<P, ConstraintF, F> for AffineGadget<P, ConstraintF, F>
where where
P: SWModelParameters, P: SWModelParameters,
ConstraintF: Field,
ConstraintF: PrimeField,
F: FieldGadget<P::BaseField, ConstraintF>, F: FieldGadget<P::BaseField, ConstraintF>,
{ {
#[inline] #[inline]

Loading…
Cancel
Save