diff --git a/CHANGELOG.md b/CHANGELOG.md index e1a5e57..5041df4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/fields/mod.rs b/src/fields/mod.rs index bced7ff..bc77cff 100644 --- a/src/fields/mod.rs +++ b/src/fields/mod.rs @@ -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 @@ -76,6 +76,7 @@ pub trait FieldVar: + AllocVar + ToBytesGadget + CondSelectGadget + + ToConstraintFieldGadget + for<'a> FieldOpsBounds<'a, F, Self> + for<'a> AddAssign<&'a Self> + for<'a> SubAssign<&'a Self> diff --git a/src/groups/mod.rs b/src/groups/mod.rs index 08edbd5..7144ee9 100644 --- a/src/groups/mod.rs +++ b/src/groups/mod.rs @@ -1,5 +1,5 @@ use crate::{ - convert::{ToBitsGadget, ToBytesGadget}, + convert::{ToBitsGadget, ToBytesGadget, ToConstraintFieldGadget}, fields::emulated_fp::EmulatedFpVar, prelude::*, }; @@ -41,6 +41,7 @@ pub trait CurveVar: + CondSelectGadget + AllocVar + AllocVar + + ToConstraintFieldGadget + for<'a> GroupOpsBounds<'a, C, Self> + for<'a> AddAssign<&'a Self> + for<'a> SubAssign<&'a Self>