2025-03-14 12:06:13 +01:00
|
|
|
|
2025-11-13 20:11:31 +01:00
|
|
|
import circom_witnessgen/field
|
|
|
|
|
# import circom_witnessgen/div_mod
|
|
|
|
|
|
2025-03-14 12:06:13 +01:00
|
|
|
import circom_witnessgen/load
|
2025-03-15 13:53:42 +01:00
|
|
|
import circom_witnessgen/input_json
|
2025-03-16 20:09:36 +01:00
|
|
|
import circom_witnessgen/witness
|
2025-03-15 14:06:24 +01:00
|
|
|
import circom_witnessgen/export_wtns
|
|
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
2025-03-15 13:53:42 +01:00
|
|
|
|
2025-03-18 12:52:54 +01:00
|
|
|
const graph_file: string = "../tmp/graph3.bin"
|
|
|
|
|
const input_file: string = "../tmp/input3.json"
|
|
|
|
|
const wtns_file: string = "../tmp/nim3.wtns"
|
2025-03-15 14:06:24 +01:00
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
2025-03-14 12:06:13 +01:00
|
|
|
|
2025-11-13 20:11:31 +01:00
|
|
|
#[
|
|
|
|
|
when isMainModule:
|
|
|
|
|
|
|
|
|
|
debugDivMod()
|
|
|
|
|
# divModSanityCheck()
|
|
|
|
|
]#
|
|
|
|
|
|
2025-03-14 12:06:13 +01:00
|
|
|
when isMainModule:
|
2025-03-15 14:06:24 +01:00
|
|
|
|
2025-03-16 20:09:36 +01:00
|
|
|
echo "loading in " & input_file
|
2025-03-15 13:53:42 +01:00
|
|
|
let inp = loadInputJSON(input_file)
|
2025-03-15 14:06:24 +01:00
|
|
|
# printInputs(inp)
|
2025-03-15 13:53:42 +01:00
|
|
|
|
2025-03-16 20:09:36 +01:00
|
|
|
echo "loading in " & graph_file
|
2025-03-15 13:53:42 +01:00
|
|
|
let gr = loadGraph(graph_file)
|
2025-11-13 20:11:31 +01:00
|
|
|
echo $gr
|
2025-03-15 14:06:24 +01:00
|
|
|
|
2025-03-16 20:09:36 +01:00
|
|
|
echo "generating witness"
|
|
|
|
|
let wtns = generateWitness( gr, inp )
|
2025-11-13 20:11:31 +01:00
|
|
|
exportWitness(wtns_file, wtns)
|
|
|
|
|
|