From c30b89a56ce45ccc6276034682a5d86a132f1a8b Mon Sep 17 00:00:00 2001 From: Billy Rennekamp Date: Tue, 9 Apr 2024 22:57:51 +0200 Subject: [PATCH] remove circuits as export --- scripts/circuits.js | 11 +++++++---- src/index.js | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/circuits.js b/scripts/circuits.js index 9fd70c8b..525e1396 100644 --- a/scripts/circuits.js +++ b/scripts/circuits.js @@ -1,10 +1,13 @@ -import { groth16 } from 'snarkjs' +import snarkjs from '../public/snarkjs.min.js' // const groth16 = {} export async function exportCallDataGroth16(input, wasmPath, zkeyPath) { const { proof: _proof, publicSignals: _publicSignals } = - await groth16.fullProve(input, wasmPath, zkeyPath) - const calldata = await groth16.exportSolidityCallData(_proof, _publicSignals) + await snarkjs.groth16.fullProve(input, wasmPath, zkeyPath) + const calldata = await snarkjs.groth16.exportSolidityCallData( + _proof, + _publicSignals + ) const argv = calldata .replace(/["[\]\s]/g, '') @@ -31,7 +34,7 @@ export async function verify(verificationPath, publicSignals, proof) { return res.json() }) - const res = await groth16.verify(vkey, publicSignals, proof) + const res = await snarkjs.groth16.verify(vkey, publicSignals, proof) return res } diff --git a/src/index.js b/src/index.js index 9bbd021b..35acc4cc 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ export { Anybody } from './anybody.js' -export * as circuits from '../scripts/circuits.js' +// export * as circuits from '../scripts/circuits.js' // const utils = require('../scripts/utils') import ProblemsABI from '../contractData/ABI-11155111-Problems.json'