forked from elibensasson/libSTARK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
collectSubsetsumResults.sh
executable file
·65 lines (59 loc) · 1.58 KB
/
collectSubsetsumResults.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
#!/bin/bash
securityList="60 80 120"
function getSeconds {
num=`echo $1 | cut -d" " -f1`
units=`echo $1 | cut -d" " -f2`
if [ "$units" == "Seconds" ]; then
echo $num
elif [ "$units" == "Minutes" ]; then
echo "${num}*60" | bc
elif [ "$units" == "Hours" ]; then
echo "${num}*60*60" | bc
elif [ "$units" == "Days" ]; then
echo "${num}*60*60*24" | bc
else
echo "NA"
fi
}
function getBytes {
num=`echo $1 | cut -d" " -f1`
units=`echo $1 | cut -d" " -f2`
if [ "$units" == "Bytes" ]; then
echo $num
elif [ "$units" == "KBytes" ]; then
echo "${num}*1024" | bc | cut -d. -f1
elif [ "$units" == "MBytes" ]; then
echo "${num}*1024*1024" | bc| cut -d. -f1
elif [ "$units" == "GBytes" ]; then
echo "${num}*1024*1024*1024" | bc| cut -d. -f1
elif [ "$units" == "TBytes" ]; then
echo "${num}*1024*1024*1024*1024" | bc| cut -d. -f1
elif [ "$units" == "PBytes" ]; then
echo "${num}*1024*1024*1024*1024*1024" | bc| cut -d. -f1
else
echo "NA"
fi
}
printf "t,"
for security in ${securityList}
do
printf "prover seconds (security ${security} bits),"
printf "verifier seconds (security ${security} bits),"
printf "argument bytes (security ${security} bits),"
done
printf "\n"
for t in {1..24}
do
printf "${t},"
for security in ${securityList}
do
filename="subsetsum-t${t}-s${security}.txt"
ptime=`grep "Prover time" ${filename} | cut -d= -f2 | cut -d\| -f1`
vtime=`grep "Verifier time" ${filename} | cut -d= -f2 | cut -d\| -f1`
arglen=`grep "Total communication complexity" ${filename} | cut -d= -f2 | cut -d\| -f1`
printf "$(getSeconds "$ptime"),"
printf "$(getSeconds "$vtime"),"
printf "$(getBytes "$arglen"),"
done
printf "\n"
done