nim-groth16/example/example.nim

17 lines
407 B
Nim
Raw Permalink Normal View History

2023-11-11 14:37:31 +01:00
import pkg/results
import ../groth16
2023-11-11 14:37:31 +01:00
proc main(): Result[void, cstring] =
let zkey_fname : string = "./build/product.zkey"
let wtns_fname : string = "./build/product.wtns"
let proof = ? proveAndVerify( zkey_fname, wtns_fname)
2023-11-11 14:37:31 +01:00
exportPublicIO( "./build/nim_public.json" , proof )
exportProof( "./build/nim_proof.json" , proof )
ok()
if main().isErr:
raiseAssert "Error verifying proof"