ada 5 tahun lalu
induk
melakukan
f8642572ed
2 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 4 1
      lisp/lisp.rs
  2. 1 0
      lisp/types.rs

+ 4 - 1
lisp/lisp.rs

@@ -544,7 +544,10 @@ pub fn prove(_ast: MalVal, env: Env) -> MalRet {
     let enforce_allocs = get_enforce_allocs(&env);
     let allocs_const = get_allocations(&env, "AllocationsConst");
 
+    // todo some refactor to improve this 
     let params = Some({
+//        todo check if we do need to pass everything like this, its important to 
+//        remember that this function runs after the evaluation, we have all allocs in memory now with all enfores
     let circuit = LispCircuit {
         params: allocs_const.as_ref().clone(),
         allocs: allocs.as_ref().clone(),
@@ -563,7 +566,7 @@ pub fn prove(_ast: MalVal, env: Env) -> MalRet {
     };
 
     let proof = groth16::create_random_proof(circuit, params.as_ref().unwrap(), &mut OsRng)?;
-
+//    todo save the proof and keys on a file
     let mut vec_input = vec![];
     for (k, val) in allocs_input.iter() {
         if let MalVal::ZKScalar(v) = val {

+ 1 - 0
lisp/types.rs

@@ -37,6 +37,7 @@ pub struct LispCircuit {
     pub params: FnvHashMap<String, MalVal>,
     pub allocs: FnvHashMap<String, MalVal>,
     pub alloc_inputs: FnvHashMap<String, MalVal>,
+//    todo change this for a ordered data structure so enforce 
     pub constraints: Vec<EnforceAllocation>,
 }