forked from AleoNet/aleo-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
e2e_inner.sh
executable file
·39 lines (27 loc) · 1.39 KB
/
e2e_inner.sh
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
#!/bin/bash -e
rm -f challenge* response* new_challenge* processed*
POWER=19
BATCH=10000
CURVE="bls12_377"
phase1="cargo run --bin phase1 --release -- --curve-kind $CURVE --batch-size $BATCH --power $POWER"
phase2="cargo run --release --bin prepare_phase2 -- --curve-kind $CURVE --batch-size $BATCH --power $POWER --phase2-size $POWER"
snark="cargo run --release --bin setup2 --"
####### Phase 1
$phase1 new --challenge-fname challenge
yes | $phase1 contribute --challenge-fname challenge --response-fname response
$phase1 verify-and-transform --challenge-fname challenge --response-fname response --new-challenge-fname new_challenge
rm challenge new_challenge # no longer needed
###### Prepare Phase 2
$phase2 --response-fname response --phase2-fname processed --phase2-size $POWER
###### Phase 2
$snark new --phase1 processed --output initial_ceremony --phase1-size $POWER --is-inner
cp initial_ceremony contribution1
yes | $snark contribute --data contribution1 --is-inner
$snark verify --before initial_ceremony --after contribution1 --is-inner
# a new contributor contributes
cp contribution1 contribution2
yes | $snark contribute --data contribution2 --is-inner
$snark verify --before contribution1 --after contribution2 --is-inner
$snark verify --before initial_ceremony --after contribution2 --is-inner
# done! since `verify` passed, you can be sure that this will work
# as shown in the `mpc.rs` example