mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
added todo
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user