From 54a4be447f3fafc33af663b061f051d7f732d7cf Mon Sep 17 00:00:00 2001 From: Jordi Baylina Date: Sun, 21 Oct 2018 18:24:49 +0200 Subject: [PATCH] Rename to snarkjs, cli and some fixes --- cli.js | 352 ++++++++++++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 12 +- sha256_2_vk_proof.json | 1 - sha256_2_vk_verifier.json | 1 - src/bigint.js | 2 +- src/calculateWitness.js | 4 +- src/circuit.js | 52 ++++++ src/gcurve.js | 137 +++++++------- src/prover.js | 4 +- src/setup.js | 2 +- src/stringifybigint.js | 36 ++++ templates/verifier.sol | 243 +++++++++++++++++++++++++ templates/verifier_abi.json | 65 +++++++ test/zksnark.js | 33 +--- vk_proof.json | 2 +- vk_verifier.json | 2 +- 17 files changed, 841 insertions(+), 109 deletions(-) create mode 100644 cli.js delete mode 100644 sha256_2_vk_proof.json delete mode 100644 sha256_2_vk_verifier.json create mode 100644 src/stringifybigint.js create mode 100644 templates/verifier.sol create mode 100644 templates/verifier_abi.json diff --git a/cli.js b/cli.js new file mode 100644 index 0000000..06c482d --- /dev/null +++ b/cli.js @@ -0,0 +1,352 @@ +#!/usr/bin/env node + +/* + Copyright 2018 0KIMS association. + + This file is part of jaz (Zero Knowledge Circuit Compiler). + + jaz is a free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + jaz is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with jaz. If not, see . +*/ + +/* eslint-disable no-console */ + +const fs = require("fs"); +const path = require("path"); + +const zkSnark = require("./index.js"); +const {stringifyBigInts, unstringifyBigInts} = require("./src/stringifybigint.js"); + + +const version = require("./package").version; + +const argv = require("yargs") + .version(version) + .usage(`snarkjs + +setup command +============= + + snarkjs setup