-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.sh
executable file
·80 lines (70 loc) · 1.32 KB
/
demo.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
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
72
73
74
75
76
77
78
79
80
#!/bin/bash
usage_string="usage: ./$(basename "$0") [ARGS] [OPTIONS]
Simulates execution of the Snarky Ceremonies protocol
Arguments:
--shape <m> <n> <l> m, n, l dimensions of constraint system
(default: 50 40 30)
--phases <nr1> <n2> Number of updates (default: 4 3)
Options:
-r, --release Compile in release mode (optimized)
--naive Run non-batched verification (non-optimized)
-h, --help Display help message and exit
Examples:
./$(basename "$0") --shape 50 40 30 --phases 12 10 --release
./$(basename "$0") --phases 50 50 --naive
"
usage() { echo -n "$usage_string" 1>&2; }
MDIM=50
NDIM=40
LDIM=30
PHASE1=4
PHASE2=3
NAIVE=false
cargo_opts=()
while [[ $# -gt 0 ]]
do
arg="$1"
case $arg in
--shape)
MDIM="$2"
NDIM="$3"
LDIM="$4"
shift
shift
shift
shift
;;
--phases)
PHASE1="$2"
PHASE2="$3"
shift
shift
shift
;;
-r|--release)
cargo_opts+=($arg)
shift
;;
--naive)
NAIVE=true
shift
;;
-h|--help)
usage
exit 0
;;
*)
echo "[-] Invalid argument: $arg"
echo
usage
exit 1
;;
esac
done
cargo run --example flow $cargo_opts \
$MDIM \
$NDIM \
$LDIM \
$PHASE1 \
$PHASE2 \
$NAIVE