mirror of
https://github.com/arnaucube/snarkjs.git
synced 2026-02-28 05:56:44 +01:00
Fix Variables and test example
This commit is contained in:
@@ -62,9 +62,13 @@ function unstringifyBigInts(o) {
|
||||
describe("zkSnark", () => {
|
||||
it("Load a circuit, create trusted setup, create a proof and validate", () => {
|
||||
|
||||
const cirDef = JSON.parse(fs.readFileSync(path.join(__dirname, "circuit", "sum.json"), "utf8"));
|
||||
const cirDef = JSON.parse(fs.readFileSync(path.join(__dirname, "circuit", "sum_old.json"), "utf8"));
|
||||
const cir = new Circuit(cirDef);
|
||||
|
||||
console.log("Signals: " + cir.nSignals);
|
||||
console.log("Vars: " + cir.nVars);
|
||||
console.log("Constants: " + cir.nConstants);
|
||||
|
||||
const setup = zkSnark.setup(cir);
|
||||
const strSetup = stringifyBigInts(setup);
|
||||
fs.writeFileSync("vk_proof.json", JSON.stringify(strSetup.vk_proof), "utf-8");
|
||||
|
||||
Reference in New Issue
Block a user