Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ToConstraintFieldGadget bounds to CurveVar and FieldVar #144

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
- Add `UInt::rotate_{left,right}_in_place`.
- Add `{Boolean,UInt}::not_in_place`.
- Add `UInt::{from_bytes_le, from_bytes_be, to_bytes_be}`.
- [\#144](https://github.com/arkworks-rs/r1cs-std/pull/144)
- Add `ToConstraintFieldGadget` bounds to `CurveVar` and `FieldVar`

### Improvements

Expand Down
3 changes: 2 additions & 1 deletion src/fields/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::{
ops::{Add, AddAssign, Mul, MulAssign, Sub, SubAssign},
};

use crate::convert::{ToBitsGadget, ToBytesGadget};
use crate::convert::{ToBitsGadget, ToBytesGadget, ToConstraintFieldGadget};
use crate::prelude::*;

/// This module contains a generic implementation of cubic extension field
Expand Down Expand Up @@ -76,6 +76,7 @@ pub trait FieldVar<F: Field, ConstraintF: PrimeField>:
+ AllocVar<F, ConstraintF>
+ ToBytesGadget<ConstraintF>
+ CondSelectGadget<ConstraintF>
+ ToConstraintFieldGadget<ConstraintF>
+ for<'a> FieldOpsBounds<'a, F, Self>
+ for<'a> AddAssign<&'a Self>
+ for<'a> SubAssign<&'a Self>
Expand Down
3 changes: 2 additions & 1 deletion src/groups/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
convert::{ToBitsGadget, ToBytesGadget},
convert::{ToBitsGadget, ToBytesGadget, ToConstraintFieldGadget},
fields::emulated_fp::EmulatedFpVar,
prelude::*,
};
Expand Down Expand Up @@ -41,6 +41,7 @@ pub trait CurveVar<C: CurveGroup, ConstraintF: PrimeField>:
+ CondSelectGadget<ConstraintF>
+ AllocVar<C, ConstraintF>
+ AllocVar<C::Affine, ConstraintF>
+ ToConstraintFieldGadget<ConstraintF>
+ for<'a> GroupOpsBounds<'a, C, Self>
+ for<'a> AddAssign<&'a Self>
+ for<'a> SubAssign<&'a Self>
Expand Down
Loading