Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for wtns calc and prover options #517

Merged
merged 12 commits into from
Oct 18, 2024
439 changes: 229 additions & 210 deletions build/browser.esm.js

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions build/cli.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6071,8 +6071,8 @@ async function wtnsCalculate$1(_input, wasmFileName, wtnsFileName, options) {
const wasm = await fdWasm.read(fdWasm.totalSize);
await fdWasm.close();

const wc = await circom_runtime.WitnessCalculatorBuilder(wasm);
if (wc.circom_version() == 1) {
const wc = await circom_runtime.WitnessCalculatorBuilder(wasm, options);
if (wc.circom_version() === 1) {
const w = await wc.calculateBinWitness(input);

const fdWtns = await binFileUtils__namespace.createBinFile(wtnsFileName, "wtns", 2, 2);
Expand Down Expand Up @@ -12257,10 +12257,8 @@ async function wtnsDebug$1(_input, wasmFileName, wtnsFileName, symName, options,
const wasm = await fdWasm.read(fdWasm.totalSize);
await fdWasm.close();


let wcOps = {
sanityCheck: true
};
let wcOps = options || {};
wcOps.sanityCheck = true;
let sym = await loadSymbols(symName);
if (options.set) {
if (!sym) sym = await loadSymbols(symName);
Expand Down Expand Up @@ -12288,7 +12286,7 @@ async function wtnsDebug$1(_input, wasmFileName, wtnsFileName, symName, options,
wcOps.sym = sym;

const wc = await circom_runtime.WitnessCalculatorBuilder(wasm, wcOps);
const w = await wc.calculateWitness(input);
const w = await wc.calculateWitness(input, true);

const fdWtns = await binFileUtils__namespace.createBinFile(wtnsFileName, "wtns", 2, 2);

Expand Down Expand Up @@ -12881,7 +12879,7 @@ async function wtnsCalculate(params, options) {

const input = JSON.parse(await fs__default["default"].promises.readFile(inputName, "utf8"));

await wtnsCalculate$1(input, wasmName, witnessName);
await wtnsCalculate$1(input, wasmName, witnessName, {});

return 0;
}
Expand Down
20 changes: 13 additions & 7 deletions build/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ async function getCurveFromName(name) {

}

var curves = /*#__PURE__*/Object.freeze({
__proto__: null,
getCurveFromR: getCurveFromR,
getCurveFromQ: getCurveFromQ,
getCurveFromName: getCurveFromName
});

/*
Copyright 2018 0KIMS association.

Expand Down Expand Up @@ -1254,8 +1261,8 @@ async function wtnsCalculate(_input, wasmFileName, wtnsFileName, options) {
const wasm = await fdWasm.read(fdWasm.totalSize);
await fdWasm.close();

const wc = await circom_runtime.WitnessCalculatorBuilder(wasm);
if (wc.circom_version() == 1) {
const wc = await circom_runtime.WitnessCalculatorBuilder(wasm, options);
if (wc.circom_version() === 1) {
const w = await wc.calculateBinWitness(input);

const fdWtns = await binFileUtils__namespace.createBinFile(wtnsFileName, "wtns", 2, 2);
Expand Down Expand Up @@ -4010,10 +4017,8 @@ async function wtnsDebug(_input, wasmFileName, wtnsFileName, symName, options, l
const wasm = await fdWasm.read(fdWasm.totalSize);
await fdWasm.close();


let wcOps = {
sanityCheck: true
};
let wcOps = options || {};
wcOps.sanityCheck = true;
let sym = await loadSymbols(symName);
if (options.set) {
if (!sym) sym = await loadSymbols(symName);
Expand Down Expand Up @@ -4041,7 +4046,7 @@ async function wtnsDebug(_input, wasmFileName, wtnsFileName, symName, options, l
wcOps.sym = sym;

const wc = await circom_runtime.WitnessCalculatorBuilder(wasm, wcOps);
const w = await wc.calculateWitness(input);
const w = await wc.calculateWitness(input, true);

const fdWtns = await binFileUtils__namespace.createBinFile(wtnsFileName, "wtns", 2, 2);

Expand Down Expand Up @@ -12388,6 +12393,7 @@ var fflonk = /*#__PURE__*/Object.freeze({
exportSolidityCallData: fflonkExportCallData
});

exports.curves = curves;
exports.fflonk = fflonk;
exports.groth16 = groth16;
exports.plonk = plonk;
Expand Down
Loading
Loading