Skip to content

Commit

Permalink
remove circuits as export
Browse files Browse the repository at this point in the history
  • Loading branch information
okwme committed Apr 9, 2024
1 parent 810ac6c commit c30b89a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions scripts/circuits.js
Original file line number Diff line number Diff line change
@@ -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, '')
Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit c30b89a

Please sign in to comment.