-
Notifications
You must be signed in to change notification settings - Fork 3
/
data-summarize
executable file
·71 lines (63 loc) · 1.8 KB
/
data-summarize
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
#!/bin/sh
# supercop/data-summarize
# D. J. Bernstein
# Public domain.
. ./data-vars
(
cat OPERATIONS \
| while read o
do
[ -d "$o" ] || continue
ls "$o" \
| sort \
| while read p
do
okabi \
| while read abi
do
[ -d "$o/$p" ] || continue
find "$o/$p" -follow -name "api.h" \
| sort \
| while read doth
do
implementationdir=`dirname $doth`
cfiles=`ls "$implementationdir" | grep '\.c$' || :`
sfiles=`ls "$implementationdir" | grep '\.[sS]$' || :`
ccfiles=`ls "$implementationdir" | grep '\.cc$' || :`
cppfiles=`ls "$implementationdir" | grep '\.cpp$' || :`
language=c
[ "x$cppfiles" = x ] || language=cpp
[ "x$ccfiles" = x ] || language=cpp
ok${language}-$abi \
| while read compiler
do
(
if [ -f "$implementationdir/goal-constbranch" ] && [ -f "$implementationdir/goal-constindex" ]
then
echo constbranchindex
fi
echo timingleaks
) | while read security
do
compilerword=`echo "$compiler" | tr ' ' '_'`
if [ -f "$top/$abi/try/$language/$compilerword/$security/$implementationdir/data" ]
then
grep . < "$top/$abi/try/$language/$compilerword/$security/$implementationdir/data"
fi
done
done
done
for m in 1 2 3
do
if [ -f "$top/$abi/measure$m/$o/$p/data" ]
then
grep . < "$top/$abi/measure$m/$o/$p/data"
fi
done
done
done
done
sed 's/^/+ /' < "$top/log"
) | gzip -9 > "$top/data.gz.tmp"
mv "$top/data.gz.tmp" "$top/data.gz"
touch "$top/done-$version"