Skip to content

Commit

Permalink
Use circom_runtime which supports memSize option. Passing options in …
Browse files Browse the repository at this point in the history
…wtns debug too.
  • Loading branch information
OBrezhniev committed Aug 16, 2024
1 parent 2c570a8 commit 12da614
Show file tree
Hide file tree
Showing 9 changed files with 489 additions and 447 deletions.
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

0 comments on commit 12da614

Please sign in to comment.