diff --git a/groth16/example/example.nim b/groth16/example/example.nim index fd610f2..ea6f9ca 100644 --- a/groth16/example/example.nim +++ b/groth16/example/example.nim @@ -4,11 +4,11 @@ import groth16/files/export_json #------------------------------------------------------------------------------- -proc exampleProveAndVerify() = +proc exampleProveAndVerify() = let zkey_fname : string = "./build/product.zkey" let wtns_fname : string = "./build/product.wtns" - let proof = testProveAndVerify( zkey_fname, wtns_fname) - + let (_, proof) = testProveAndVerify( zkey_fname, wtns_fname) + exportPublicIO( "./build/nim_public.json" , proof ) exportProof( "./build/nim_proof.json" , proof ) diff --git a/groth16/partial/finish.nim b/groth16/partial/finish.nim index 51fbb26..ad4ec6d 100644 --- a/groth16/partial/finish.nim +++ b/groth16/partial/finish.nim @@ -28,9 +28,6 @@ import groth16/prover/shared proc finishPartialProofWithMask*( zkey: ZKey, wtns: Witness, partialProof: PartialProof, mask: Mask, pool: Taskpool, printTimings: bool): Proof = - when not (defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc)): - {.fatal: "Compile with arc/orc!".} - # if (zkey.header.curve != wtns.curve): # echo( "zkey.header.curve = " & ($zkey.header.curve) ) # echo( "wtns.curve = " & ($wtns.curve ) ) diff --git a/groth16/test_proof.nim b/groth16/test_proof.nim index bdb8474..1523838 100644 --- a/groth16/test_proof.nim +++ b/groth16/test_proof.nim @@ -3,6 +3,8 @@ import std/[times,os] import strformat +import taskpools + import groth16/prover import groth16/verifier import groth16/files/witness @@ -23,7 +25,8 @@ proc testProveAndVerify*( zkey_fname, wtns_fname: string): (VKey,Proof) = echo("generating proof...") let start = cpuTime() - let proof = generateProof( zkey, witness ) + var pool = Taskpool.new() + let proof = generateProof( zkey, witness ,pool) let elapsed = cpuTime() - start echo("proving took ",seconds(elapsed)) @@ -55,7 +58,8 @@ proc testFakeSetupAndVerify*( r1cs_fname, wtns_fname: string, flavour=Snarkjs): let vkey = extractVKey( zkey) let start = cpuTime() - let proof = generateProof( zkey, witness ) + var pool = Taskpool.new() + let proof = generateProof( zkey, witness ,pool) let elapsed = cpuTime() - start echo("proving took ",seconds(elapsed))