Skip to content

Commit

Permalink
refactor(proof): replace groth16 functions with groth16 pkg
Browse files Browse the repository at this point in the history
Former-commit-id: dd08ba1
  • Loading branch information
cedoor committed Oct 12, 2023
1 parent 78dcb70 commit 2fc40bf
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 535 deletions.
20 changes: 5 additions & 15 deletions packages/proof/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
"license": "MIT",
"main": "dist/index.node.js",
"exports": {
"node": {
"import": "./dist/index.node.mjs",
"require": "./dist/index.node.js"
},
"browser": "./dist/index.browser.mjs",
"default": "./dist/index.browser.mjs"
"import": "./dist/index.node.mjs",
"require": "./dist/index.node.js"
},
"types": "dist/types/index.d.ts",
"files": [
Expand All @@ -26,21 +22,16 @@
},
"scripts": {
"build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
"build": "rimraf dist && yarn build:browser && yarn build:node",
"build:browser": "rollup -c rollup.browser.config.ts --configPlugin typescript",
"build:node": "rollup -c rollup.node.config.ts --configPlugin typescript",
"build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
"prepublishOnly": "yarn build"
},
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@iden3/binfileutils": "0.0.11",
"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-json": "^5.0.1",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-virtual": "^3.0.2",
"fastfile": "0.0.20",
"poseidon-lite": "^0.2.0",
"rimraf": "^5.0.5",
"rollup": "^4.0.2",
Expand All @@ -56,8 +47,7 @@
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/keccak256": "^5.7.0",
"@ethersproject/strings": "^5.5.0",
"@zk-kit/incremental-merkle-tree": "0.4.3",
"circom_runtime": "0.1.24",
"ffjavascript": "0.2.60"
"@zk-kit/groth16": "0.1.0",
"@zk-kit/incremental-merkle-tree": "0.4.3"
}
}
58 changes: 0 additions & 58 deletions packages/proof/rollup.browser.config.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ export default {
input: "src/index.ts",
output: [
{
file: pkg.exports.node.require,
file: pkg.exports.require,
format: "cjs",
banner,
exports: "auto"
},
{
file: pkg.exports.node.import,
file: pkg.exports.import,
format: "es",
banner
}
Expand Down
4 changes: 2 additions & 2 deletions packages/proof/src/generateProof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { BigNumber } from "@ethersproject/bignumber"
import { BytesLike, Hexable } from "@ethersproject/bytes"
import { Group } from "@semaphore-protocol/group"
import type { Identity } from "@semaphore-protocol/identity"
import { prove } from "@zk-kit/groth16"
import { MerkleProof } from "@zk-kit/incremental-merkle-tree"
import type { NumericString } from "snarkjs"
import hash from "./hash"
import packProof from "./packProof"
import { SemaphoreProof, SnarkArtifacts } from "./types"
import groth16Prove from "./groth16/prove"

/**
* Generates a Semaphore proof.
Expand Down Expand Up @@ -46,7 +46,7 @@ export default async function generateProof(
}
}

const { proof, publicSignals } = await groth16Prove(
const { proof, publicSignals } = await prove(
{
identityTrapdoor: trapdoor,
identityNullifier: nullifier,
Expand Down
226 changes: 0 additions & 226 deletions packages/proof/src/groth16/prove.ts

This file was deleted.

14 changes: 0 additions & 14 deletions packages/proof/src/groth16/utils.ts

This file was deleted.

Loading

0 comments on commit 2fc40bf

Please sign in to comment.