zkutil/test.sh

22 lines
530 B
Bash
Raw Permalink Normal View History

2022-08-28 21:48:50 +03:00
#!/bin/sh
set -e
# Compile the circuit
npx circom -rw
# Do a local trusted setup, generate params.bin
cargo run --release setup
# Export proving and verifying keys compatible with snarkjs and websnark
cargo run --release export-keys
# generate solidity verifier
cargo run --release generate-verifier
# generate and verify proof
npx snarkjs calculatewitness # witness is still generated by snarkjs
cargo run --release prove
cargo run --release verify
# Double check by verifying the same proof with snarkjs
npx snarkjs verify