mirror of
https://github.com/arnaucube/circom.git
synced 2026-02-07 03:06:42 +01:00
Dependencies updated and publish
This commit is contained in:
27
src/cli.js
27
src/cli.js
@@ -1,27 +0,0 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const compiler = require("./compiler");
|
||||
|
||||
const argv = require("yargs")
|
||||
.usage("jaz -s [input source circuit file] -o [output definition circuit file]")
|
||||
.alias("s", "source")
|
||||
.alias("o", "output")
|
||||
.require(["s","o"])
|
||||
.argv;
|
||||
|
||||
const fullFileName = path.resolve(process.cwd(), argv.source);
|
||||
|
||||
compiler(fullFileName).then( (cir) => {
|
||||
fs.writeFileSync(argv.output, JSON.stringify(cir, null, 1), "utf8");
|
||||
}, (err) => {
|
||||
console.error(`ERROR at ${err.errFile}:${err.pos.first_line},${err.pos.first_column}-${err.pos.last_line},${err.pos.last_column} ${err.errStr}`);
|
||||
console.error(JSON.stringify(err.ast, null, 1));
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
Copyright 2018 0kims association
|
||||
|
||||
This file is part of jaz (Zero Knowlage Circuit compiler).
|
||||
|
||||
jaz is 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
@@ -11,7 +29,7 @@ const lc = require("./lcalgebra");
|
||||
|
||||
module.exports = compile;
|
||||
|
||||
const parser = require("../jaz.js").parser;
|
||||
const parser = require("../parser/jaz.js").parser;
|
||||
|
||||
function compile(srcFile) {
|
||||
|
||||
|
||||
21
src/exec.js
21
src/exec.js
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
Copyright 2018 0kims association
|
||||
|
||||
This file is part of jaz (Zero Knowlage Circuit compiler).
|
||||
|
||||
jaz is 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
@@ -6,7 +25,7 @@ const __P__ = new bigInt("218882428718392752222464057452572750885483644004160343
|
||||
const __MASK__ = new bigInt(2).pow(253).minus(1);
|
||||
|
||||
const lc = require("./lcalgebra");
|
||||
const parser = require("../jaz.js").parser;
|
||||
const parser = require("../parser/jaz.js").parser;
|
||||
|
||||
/* TODO: Add lines information
|
||||
|
||||
|
||||
@@ -1,8 +1,26 @@
|
||||
/*
|
||||
Copyright 2018 0kims association
|
||||
|
||||
This file is part of jaz (Zero Knowlage Circuit compiler).
|
||||
|
||||
jaz is 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
const bigInt = require("big-integer");
|
||||
|
||||
module.exports = gen;
|
||||
|
||||
|
||||
function ident(text) {
|
||||
let lines = text.split("\n");
|
||||
for (let i=0; i<lines.length; i++) {
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
Copyright 2018 0kims association
|
||||
|
||||
This file is part of jaz (Zero Knowlage Circuit compiler).
|
||||
|
||||
jaz is 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
NUMBER: a
|
||||
|
||||
27
src/rt.js
27
src/rt.js
@@ -1,27 +0,0 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const calculateWitness = require("./calculateWitness.js");
|
||||
|
||||
const argv = require("optimist")
|
||||
.alias("i", "input")
|
||||
.alias("o", "output")
|
||||
.alias("c", "circuit")
|
||||
.argv;
|
||||
|
||||
const circuit = require(path.resolve(argv.circuit));
|
||||
|
||||
const inputSignals = JSON.parse(fs.readFileSync(argv.input, "utf8"));
|
||||
|
||||
try {
|
||||
const w = calculateWitness(circuit, inputSignals);
|
||||
fs.writeFileSync(argv.output, JSON.stringify(w), "utf8");
|
||||
} catch(err) {
|
||||
console.log("ERROR: " + err);
|
||||
console.log(err.stack);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user