Skip to content

Commit

Permalink
ptau final
Browse files Browse the repository at this point in the history
  • Loading branch information
nginnever committed May 13, 2024
1 parent 309237e commit 12f2361
Show file tree
Hide file tree
Showing 5 changed files with 2,812 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/circuits/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"pretest": "tsc -p tsconfig.json",
"precompile": "scripts/prerequisites.sh && mkdir -p zk/circuits zk/zkeys zk/verifiers",
"postbuild": "cp zk/zkeys/main.zkey ../app/public && cp zk/circuits/main_js/main.wasm ../app/public",
"compile": "for circuit in circuits/*.circom; do circom $circuit --r1cs --sym --wasm -o zk/circuits;done && tsc",
"compile": "for circuit in circuits/*.circom; do circom $circuit --r1cs --sym --wasm --O0 -o zk/circuits;done && tsc",
"export:sample-zkey": "for circuit in zk/circuits/*.r1cs; do snarkjs groth16 setup $circuit powersOfTau28_hez_final_15.ptau zk/zkeys/$(basename -- $circuit .r1cs).zkey;done",
"export:verifier": "for zkey in zk/zkeys/*.zkey; do snarkjs zkey export solidityverifier $zkey zk/verifiers/$(basename -- $zkey .zkey | perl -nE 'say ucfirst').sol;done",
"build": "yarn compile && yarn export:sample-zkey && yarn export:verifier"
Expand All @@ -40,6 +40,7 @@
"devDependencies": {
"@types/chai": "^4.3.1",
"@types/mocha": "^9.1.0",
"@types/node": "^20.12.11",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"chai": "^4.3.6",
Expand All @@ -49,4 +50,4 @@
"npm": ">=7.0.0",
"node": ">=14.0.0"
}
}
}
Binary file added packages/circuits/pot12_final.ptau
Binary file not shown.
Empty file modified packages/circuits/scripts/prerequisites.sh
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import buildCalculator from "../zk/circuits/vote_integrity_js/witness_calculator
import * as snarkjs from "snarkjs";

export interface Proof {
a: [int];
a: [bigint, bigint];
b: [[bigint, bigint], [bigint, bigint]];
c: [bigint, bigint];
}

export class ZKPClient {
Expand Down Expand Up @@ -38,7 +40,7 @@ export class ZKPClient {
async prove({
vote,
}: {
vote: int;
vote: number;
}): Promise<Proof> {
const inputs = {
vote,
Expand Down
Loading

0 comments on commit 12f2361

Please sign in to comment.