Skip to content

Commit

Permalink
[tests] fix paths in Zkey and Groth16 prover tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar committed Jan 25, 2025
1 parent 34812a1 commit 53209ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/proof_systems/t_groth16_prover.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import std/[os, unittest, strutils, importutils],
constantine/named/algebras



const TestDir = currentSourcePath.rsplit(DirSep, 1)[0]

#[
For information about the data files used in this test case, see
Expand Down Expand Up @@ -38,9 +38,9 @@ suite "Groth16 prover":
test "Proving 3-factorization example":
const T = BN254_Snarks
# parse binary files
let wtns = parseWtnsFile("./groth16_files/witness.wtns").toWtns[:T]()
let zkey = parseZkeyFile("./groth16_files/three_fac_final.zkey").toZkey[:T]()
let r1cs = parseR1csFile("./groth16_files/three_fac.r1cs").toR1CS()
let wtns = parseWtnsFile(TestDir / "groth16_files/witness.wtns").toWtns[:T]()
let zkey = parseZkeyFile(TestDir / "groth16_files/three_fac_final.zkey").toZkey[:T]()
let r1cs = parseR1csFile(TestDir / "groth16_files/three_fac.r1cs").toR1CS()
# construct mutable prover (to overwrite r, s)
var ctx = Groth16Prover[T].init(zkey, wtns, r1cs)
# definition of `r` and `s` values that produced expected proof
Expand Down
6 changes: 3 additions & 3 deletions tests/proof_systems/t_zkey_parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ proc `%`(c: char): JsonNode = % ($c)
proc `%`(c: SecretWord): JsonNode = % (c.uint64)

const UpdateTestVectors = false
const RawVec = "groth16_files/t_zkey_bin.json"
const TypedVec = "groth16_files/t_zkey.json"

const TestDir = currentSourcePath.rsplit(DirSep, 1)[0]
const RawVec = TestDir / "groth16_files/t_zkey_bin.json"
const TypedVec = TestDir / "groth16_files/t_zkey.json"

suite "Zkey (.zkey) binary file parser":


Expand Down

0 comments on commit 53209ae

Please sign in to comment.