-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
43 lines (39 loc) · 1.24 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const yargs = require("yargs");
const version = require("./package.json").version;
const mset_eq_kzg_grandproduct_prover = require("./src/grandproduct/mset_eq_kzg_prover.js");
const mset_eq_kzg_grandproduct_verifier = require("./src/grandproduct/mset_eq_kzg_verifier.js");
const mset_eq_kzg_grandsum_prover = require("./src/grandsum/mset_eq_kzg_prover.js");
const mset_eq_kzg_grandsum_verifier = require("./src/grandsum/mset_eq_kzg_verifier.js");
yargs
.scriptName("kzg")
.version(version)
.usage("$0 <cmd>")
.command(
"prove",
"generates snark proofs!",
(yargs) => {},
function (argv) {
return _kzg_basic_prover();
}
)
.command(
"verify [proof]",
"verifies snark proofs",
(yargs) => {
yargs.positional("proof", {
type: "object",
default: "{}",
describe: "snark proof",
});
},
function (argv) {
return _kzg_basic_verifier(argv.proof);
}
)
.help().argv;
async function _kzg_basic_prover() {
return await mset_eq_kzg_grandproduct_prover();
}
async function _kzg_basic_verifier(proof) {
return await mset_eq_kzg_grandproduct_verifier(proof);
}