Răsfoiți Sursa

start adding the groth16 constraint circuit and setup method

ada 5 ani în urmă
părinte
comite
b09adcd438
2 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 3 1
      lisp/lisp.rs
  2. 1 0
      lisp/run.sh

+ 3 - 1
lisp/lisp.rs

@@ -372,7 +372,7 @@ impl Circuit<bls12_381::Scalar> for MyCircuit {
     }
 }
 
-pub fn setup(ast: &MalVal) -> Result<String, MalErr> {
+pub fn setup(ast: &MalVal) -> MalRet {
     let start = Instant::now();
     // Create parameters for our circuit. In a production deployment these would
     // be generated securely using a multiparty computation.
@@ -384,6 +384,8 @@ pub fn setup(ast: &MalVal) -> Result<String, MalErr> {
 
     // Prepare the verification key (for proof verification).
     let pvk = groth16::prepare_verifying_key(&params.vk);
+
+    Ok(MalVal::Str("k".to_string()))
 /*
     // Pick a preimage and compute its hash.
     let quantity = bls12_381::Scalar::from(3);

+ 1 - 0
lisp/run.sh

@@ -0,0 +1 @@
+cargo run --bin lisp load new-cs.lisp