add a "makeWitness" convenience function

This commit is contained in:
Balazs Komuves 2026-01-16 11:50:33 +01:00
parent 3ddf4948f9
commit 7a610c2217
No known key found for this signature in database
GPG Key ID: F63B7AEF18435562
2 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
skipDirs = @["groth16/example"]
binDir = "build"
namedBin = {"cli/cli_main": "nim-groth16"}.toTable()
installExt = @["nim"]
requires "nim >= 2.0.0"
requires "https://github.com/status-im/nim-taskpools >= 0.0.5"

View File

@ -32,6 +32,14 @@ type
nvars* : int
values* : seq[Fr[BN254_Snarks]]
func makeWitnessBN254*(vals: seq[Fr[BN254_Snarks]]): Witness =
return Witness(
curve : "bn128"
, r : primeR
, nvars : vals.len
, values : vals
)
#-------------------------------------------------------------------------------
proc parseSection1_header( stream: Stream, user: var Witness, sectionLen: int ) =