mirror of
https://github.com/logos-storage/nim-groth16.git
synced 2026-01-03 22:23:08 +00:00
measure proof time
This commit is contained in:
parent
2047e7e476
commit
4a814ee050
@ -1,4 +1,7 @@
|
||||
|
||||
|
||||
import std/[times, os]
|
||||
|
||||
import ./groth16
|
||||
import ./witness
|
||||
import ./r1cs
|
||||
@ -18,7 +21,11 @@ proc testProveAndVerify*( zkey_fname, wtns_fname: string): Proof =
|
||||
|
||||
echo("generating proof...")
|
||||
let vkey = extractVKey( zkey)
|
||||
|
||||
let start = cpuTime()
|
||||
let proof = generateProof( zkey, witness )
|
||||
let elapsed = cpuTime() - start
|
||||
echo("proving took ",elapsed)
|
||||
|
||||
echo("verifying the proof...")
|
||||
let ok = verifyProof( vkey, proof )
|
||||
@ -42,7 +49,11 @@ proc testFakeSetupAndVerify*( r1cs_fname, wtns_fname: string, flavour=Snarkjs):
|
||||
|
||||
echo("generating proof...")
|
||||
let vkey = extractVKey( zkey)
|
||||
|
||||
let start = cpuTime()
|
||||
let proof = generateProof( zkey, witness )
|
||||
let elapsed = cpuTime() - start
|
||||
echo("proving took ",elapsed)
|
||||
|
||||
echo("verifying the proof...")
|
||||
let ok = verifyProof( vkey, proof )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user