소스 검색

added dependencies

ada 5 년 전
부모
커밋
94208ee338
1개의 변경된 파일11개의 추가작업 그리고 7개의 파일을 삭제
  1. 11 7
      lisp/types.rs

+ 11 - 7
lisp/types.rs

@@ -1,6 +1,10 @@
-use bellman::Circuit;
-use bellman::ConstraintSystem;
-use bellman::SynthesisError;
+use bellman::{
+    gadgets::{
+        Assignment,
+    },
+    groth16, Circuit, ConstraintSystem, SynthesisError,
+};
+use std::ops::{Add, AddAssign, MulAssign, SubAssign};
 use std::cell::RefCell;
 use std::rc::Rc;
 //use std::collections::HashMap;
@@ -68,9 +72,9 @@ impl Circuit<bls12_381::Scalar> for LispCircuit {
         for alloc_value in &self.constraints {
             println!("{:?}", alloc_value);
             let coeff = bls12_381::Scalar::one();
-            let left = bellman::LinearCombination::<Scalar>::zero();
-            let right = bellman::LinearCombination::<Scalar>::zero();
-            let output = bellman::LinearCombination::<Scalar>::zero();
+            let mut left = bellman::LinearCombination::<Scalar>::zero();
+            let mut right = bellman::LinearCombination::<Scalar>::zero();
+            let mut output = bellman::LinearCombination::<Scalar>::zero();
             for values in alloc_value.left.iter() {
                 let (a, b) = values;
                 println!("{:?} {:?}", a, variables.get(a));
@@ -80,7 +84,7 @@ impl Circuit<bls12_381::Scalar> for LispCircuit {
                 if a == "scalar::one" {
                 //    val_a = coeff;
                 } 
-                left = left + (val_a, val_b);
+                left = left + (coeff, *val_b);
             }
 
             cs.enforce(