Add ToConstraintFieldGadget for ProjectiveVar (#13)

This commit is contained in:
Weikeng Chen
2020-11-12 01:41:59 -08:00
committed by GitHub
parent 8dca325042
commit f4691621ee
14 changed files with 52 additions and 32 deletions

View File

@@ -103,17 +103,17 @@ macro_rules! make_uint {
for b in bits.iter().rev() {
value.as_mut().map(|v| *v <<= 1);
match b {
&Boolean::Constant(b) => {
match *b {
Boolean::Constant(b) => {
value.as_mut().map(|v| *v |= $native::from(b));
}
&Boolean::Is(ref b) => match b.value() {
Boolean::Is(ref b) => match b.value() {
Ok(b) => {
value.as_mut().map(|v| *v |= $native::from(b));
}
Err(_) => value = None,
},
&Boolean::Not(ref b) => match b.value() {
Boolean::Not(ref b) => match b.value() {
Ok(b) => {
value.as_mut().map(|v| *v |= $native::from(!b));
}