-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (60 loc) · 2.82 KB
/
integration-test.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Circuit Test
on:
pull_request:
push:
branches:
- master
jobs:
check-test-circuit:
name: Check the Schnorr prove, verify algorithm circuit
runs-on: ubuntu-latest
env:
TEST_MODE: false
steps:
- name: checkout
uses: actions/checkout@v3
- name: install dependencies
run : npm install
- name: install circom
uses: addnab/docker-run-action@v3
with:
image: onthertech/amd64-circom:2.0.5
shell: bash
options: -v ${{ github.workspace }}:/var/workspace
run: |
source "$HOME/.cargo/env"
/var/workspace/resource/subcircuits/compile.sh
# - name: build
# run : npm run buildcli
- name: build QAP
run : node cli.js qap-all bn128 12 18 -v
- name: setup
run : node cli.js setup resource/subcircuits/param_12_18.dat rs_18 resource/subcircuits/QAP_12_18 -v
- name: derive
run : |
node cli.js derive resource/universal_rs/rs_18.urs crsSchnorr_prove resource/circuits/schnorr_prove resource/subcircuits/QAP_12_18 -v
node cli.js derive resource/universal_rs/rs_18.urs crsSchnorr_verify resource/circuits/schnorr_verify resource/subcircuits/QAP_12_18 -v
- name: decode
run : |
node cli.js decode resource/circuits/schnorr_prove 1 -v
node cli.js decode resource/circuits/schnorr_prove 2 -v
node cli.js decode resource/circuits/schnorr_verify 1 -v
- name: prove
run : |
node cli.js prove resource/subcircuits/QAP_12_18 resource/circuits/schnorr_prove/crsSchnorr_prove.crs proof1 resource/circuits/schnorr_prove 1 -v
node cli.js prove resource/subcircuits/QAP_12_18 resource/circuits/schnorr_prove/crsSchnorr_prove.crs proof2 resource/circuits/schnorr_prove 2 -v
node cli.js prove resource/subcircuits/QAP_12_18 resource/circuits/schnorr_verify/crsSchnorr_verify.crs proof resource/circuits/schnorr_verify 1 -v
- name: verify
run : |
node cli.js verify resource/circuits/schnorr_prove/proof1.proof resource/circuits/schnorr_prove/crsSchnorr_prove.crs resource/circuits/schnorr_prove 1 -v | tee output1
node cli.js verify resource/circuits/schnorr_prove/proof2.proof resource/circuits/schnorr_prove/crsSchnorr_prove.crs resource/circuits/schnorr_prove 2 -v | tee output2
node cli.js verify resource/circuits/schnorr_verify/proof.proof resource/circuits/schnorr_verify/crsSchnorr_verify.crs resource/circuits/schnorr_verify 1 -v | tee output3
echo "VALID" > expect
- name: check the final results
run : |
for f in output*; do
if grep -q INVALID "$f"; then
echo "The proofs are not valid"
exit 1
fi
done