mirror of
https://github.com/logos-storage/nim-groth16.git
synced 2026-05-18 08:39:36 +00:00
fix tests
This commit is contained in:
parent
afd479e822
commit
7d5826e9c0
@ -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 )
|
||||
|
||||
|
||||
@ -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 ) )
|
||||
|
||||
@ -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))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user