added todo

This commit is contained in:
ada
2021-02-11 22:14:21 +01:00
parent 45b407b09c
commit f8642572ed
2 changed files with 5 additions and 1 deletions

View File

@@ -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 {

View File

@@ -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>,
}