-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
38 lines (27 loc) · 1.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.PHONY: circuits/nzcp.circom circuits/cbor.circom test clean
all: node_modules circuits/nzcp.circom circuits/nzcp_exampleTest.wasm circuits/nzcp_liveTest.wasm
circuits/nzcp_exampleTest.wasm:
circom circuits/nzcp_exampleTest.circom --r1cs --wasm
circuits/nzcp_liveTest.wasm:
circom circuits/nzcp_liveTest.circom --r1cs --wasm
test: node_modules circuits/nzcp.circom
yarn exec mocha
sha256-var-circom.zip:
curl -Lo $@ https://github.com/noway/sha256-var-circom/archive/refs/heads/main.zip
sha256-var-circom-main/: sha256-var-circom.zip
unzip $<
cd $@ && make
circuits/nzcp.circom: circuits/cbor.circom sha256-var-circom-main
cpp -P circuits/nzcptpl.circom > $@
circuits/cbor.circom: sha256-var-circom-main
cpp -P circuits/cbortpl.circom > $@
node_modules/:
yarn
plonk:
snarkjs plonk setup nzcp_exampleTest.r1cs powersOfTau28_hez_final_22.ptau nzcp_exampleTest_final.zkey
snarkjs zkey export verificationkey nzcp_exampleTest_final.zkey verification_key.json
snarkjs zkey export solidityverifier nzcp_exampleTest_final.zkey contracts/VerifierExample.sol
clean:
rm -rf sha256-var-circom.zip
rm -rf sha256-var-circom-main
rm -rf node_modules