Split witness calculation step for circom 2
This commit is contained in:
parent
4583d3c3b0
commit
e2bcb9f96a
718
build/main.cjs
718
build/main.cjs
File diff suppressed because it is too large
Load Diff
@ -29,11 +29,19 @@ export default async function wtnsCalculate(input, wasmFileName, wtnsFileName, o
|
||||
await fdWasm.close();
|
||||
|
||||
const wc = await WitnessCalculatorBuilder(wasm);
|
||||
if (wc.circom_version() == 1) {
|
||||
const w = await wc.calculateBinWitness(input);
|
||||
|
||||
const fdWtns = await binFileUtils.createBinFile(wtnsFileName, "wtns", 2, 2);
|
||||
|
||||
await wtnsUtils.writeBin(fdWtns, w, wc.prime);
|
||||
await fdWtns.close();
|
||||
} else {
|
||||
const fdWtns = await fastFile.createOverride(wtnsFileName);
|
||||
|
||||
const w = await wc.calculateWTNSBin(input);
|
||||
|
||||
await fdWtns.write(w);
|
||||
await fdWtns.close();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user