-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdoc.sh
320 lines (274 loc) · 8.46 KB
/
doc.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
print_filename () {
local filename=`basename $2 .v`
local dir=$1
local dirwithdot=${dir//\//.}
# the coqtop of Coq-8.2pl1 used to output filenames named after their directory
# echo "<a class=\"file\" href=\"$dirwithdot.$filename.html\">"$filename"</a>"
echo "<a class=\"file\" href=\"$filename.html\">"$filename"</a>"
}
cryptoasm_cond () {
local i=$1
if [[ "$i" == *_prg.v ]] || [[ "$i" == *_termination.v ]] ||
[[ "$i" == *_triple.v ]] || [[ "$i" == *bbs* ]] ||
[[ "$i" == *goto* ]] || [[ "$i" == *compile* ]]; then
return 0
else
return 1
fi
}
begcd_cond () {
local i=$1
if [[ "$i" == simu.v ]] ; then
return 1
else
return 0
fi
}
C_cond () {
local i=$1
if [[ "$i" == POLAR*.v ]] || [[ "$i" == rfc5246.v ]]; then
return 0
else
return 1
fi
}
POLAR_cond () {
local i=$1
if [[ "$i" == POLAR*.v ]]; then
return 1
else
return 0
fi
}
print_function_begcd () {
echo "<li>"$2
echo "<ul>"
echo "<li>"
echo "<ul class=\"simu\">"
for i in *.v; do
if [[ "$i" == *"$3"*simu* ]]; then
echo "<li>"
print_filename $dir $i
echo "</li>"
fi
done
echo "</ul>"
echo "</li>"
echo "<li>"
echo "<ul class=\"misc\">"
for i in *.v; do
if [[ "$i" == *"$3"*safe_termination* ]]; then
echo "<li>"
print_filename $dir $i
echo "</li>"
fi
done
echo "</ul>"
echo "</li>"
echo "</ul>"
echo "</li>"
}
print_function_begcd_special () {
echo "<li>"$2
echo "<ul>"
echo "<li>"
echo "<ul class=\"simu\">"
for i in *.v; do
if [[ "$i" == "$3" ]]; then
echo "<li>"
print_filename $dir $i
echo "</li>"
fi
done
echo "</ul>"
echo "</li>"
echo "</ul>"
echo "</li>"
}
print_function () {
echo "<li>"$2
echo "<ul>"
echo "<li>"
echo "<ul class=\"prg\">"
for i in *.v; do
if [[ "$i" == *"$3"*prg* ]]; then
echo "<li>"
print_filename $dir $i
echo "</li>"
fi
done
echo "</ul>"
echo "</li>"
echo "<li>"
echo "<ul class=\"triple\">"
for i in *.v; do
if [[ "$i" == *"$3"*triple* ]]; then
echo "<li>"
print_filename $dir $i
echo "</li>"
fi
done
echo "</ul>"
echo "</li>"
echo "<li>"
echo "<ul class=\"misc\">"
for i in *.v; do
if [[ "$i" == *"$3"* ]] && [[ "$i" != *"$3"*prg* ]] && [[ "$i" != *"$3"*triple* ]]; then
echo "<li>"
print_filename $dir $i
echo "</li>"
fi
done
echo "</ul>"
echo "</li>"
echo "</ul>"
echo "</li>"
}
echo "<p class=\"p_title\">A Library for Formal Verification of Low-level Programs</p>"
echo "<dl class=\"dl_main\">"
for dir in $*; do
currentdir=`pwd`
cd $dir
echo "<dt class=\"dt_main\"><span class=\"bfont\">"$dir/"</span>: "
cat README.doc
echo "</dt>"
echo "<dd class=\"dd_main\">"
if [ $dir == 'lib' ]; then
for i in *.v; do
if [[ "$i" != *goto* ]] && [[ "$i" != *while* ]] && [[ "$i" != *compile* ]]; then
print_filename $dir $i
fi
done
echo "<p class=\"sublib\">Hoare logic modules:</p>"
for i in *.v; do
if [[ "$i" == *goto* ]] || [[ "$i" == *while* ]] || [[ "$i" == *compile* ]] ; then
print_filename $dir $i
fi
done
fi
if [ $dir == 'seplog' ]; then
echo "<p class=\"sublib\">Standard separation logic:</p>"
for i in *.v; do
if [[ "$i" != *topsy* ]] && [[ "$i" != *frag* ]] && [[ "$i" != *expr_b_dp* ]] && [[ "$i" != *LSF* ]]; then
print_filename $dir $i
fi
done
echo "<p class=\"sublib\">A certified verifier for a fragment of separation logic:</p>"
for i in *.v; do
if [[ "$i" == *frag* ]] || [[ "$i" == *expr_b_dp* ]] || [[ "$i" == *LSF* ]]; then
print_filename $dir $i
fi
done
echo "<p class=\"sublib\">Formal verification of the heap manager of an operating system:</p>"
for i in *.v; do
if [[ "$i" == *topsy* ]] ; then
print_filename $dir $i
fi
done
fi
if [ $dir == 'cryptoasm' ]; then
echo "<p class=\"sublib\">Separation logic for SmartMIPS:</p>"
for i in *.v; do
cryptoasm_cond $i
if [ $? -eq 1 ]; then
print_filename $dir $i
fi
done
echo "<p class=\"sublib\">Illustrative example of SGoto:</p>"
for i in *.v; do
if [[ "$i" == *goto* ]] || [[ "$i" == *compile* ]] ; then
print_filename $dir $i
fi
done
echo "<p class=\"sublib\">Formal verifications of cryptographic functions: <span class=\"prg\">program</span> <span class=\"triple\">functional correctness</span> <span class=\"misc\">other properties</span></p>"
echo "<div id=\"functions\">"
echo "<ul class=\"crypto_list\">"
echo "<div id=\"kamoku\">Multi-precision unsigned arithmetic</div>"
print_function $dir 'Initialization to 0 →' 'multi_zero_u'
print_function $dir 'Initialization to 1 →' 'multi_one_u'
print_function $dir 'Parity check →' 'multi_is_even_u'
print_function $dir 'Zero testing →' 'multi_is_zero_u'
print_function $dir 'Array copy →' 'copy_u_u'
print_function $dir 'Additions →' 'multi_add_u_u'
print_function $dir 'Subtractions →' 'multi_sub_u_u'
print_function $dir 'Multiplication →' 'multi_mul_u_u'
print_function $dir 'Halving →' 'multi_halve_u'
print_function $dir 'Doubling →' 'multi_double_u'
print_function $dir 'Comparison (<, >, =) →' 'multi_lt'
print_function $dir 'Montgomery multiplication →' 'mont_mul'
print_function $dir 'Montgomery squaring →' 'mont_square'
print_function $dir 'Montgomery exponentiation →' 'mont_exp'
print_function $dir 'BBS pseudorandom bit generator →' 'bbs'
echo "<div id=\"kamoku\">Multi-precision signed arithmetic</div>"
print_function $dir 'Initialization to 0 →' 'multi_zero_s'
print_function $dir 'Initialization to 1 →' 'multi_one_s'
print_function $dir 'Negation →' 'multi_negate'
print_function $dir 'Sign testing →' 'pick_sign'
print_function $dir 'Array copy →' 'copy_s_'
print_function $dir 'Signed addition →' 'multi_add_s_'
print_function $dir 'Signed subtractions →' 'multi_sub_s'
print_function $dir 'Signed halving →' 'multi_halve_s'
echo "</ul>"
echo "</div>"
fi
if [ $dir == 'begcd' ]; then
echo "<p class=\"sublib\">Simulation between assembly programs and pseudo-code:</p>"
for i in *.v; do
begcd_cond $i
if [ $? -eq 1 ]; then
print_filename $dir $i
fi
done
echo "<p class=\"sublib\">Simulation for arithmetic functions: <span class=\"simu\">simulation</span> <span class=\"misc\">other properties</span></p>"
echo "<div id=\"functions\">"
echo "<ul class=\"crypto_list\">"
# echo "<div id=\"kamoku\">Multi-precision unsigned arithmetic</div>"
print_function_begcd $dir 'Initialization to 0 →' 'multi_zero_'
print_function_begcd $dir 'Initialization to 1 →' 'multi_one_'
print_function_begcd $dir 'Comparison (<, >, =) →' 'multi_lt'
print_function_begcd $dir 'Sign testing →' 'pick_sign'
print_function_begcd $dir 'Array copy →' 'copy_s_'
print_function_begcd $dir 'Signed addition →' 'multi_add_s_'
print_function_begcd $dir 'Signed subtractions →' 'multi_sub_s'
print_function_begcd $dir 'Doubling →' 'multi_double_u'
print_function_begcd $dir 'Halving →' 'multi_halve_'
print_function_begcd $dir 'Parity check →' 'multi_is_even_'
# print_function_begcd_special $dir 'In progress →' 'library_interfaces.v'
echo "</ul>"
echo "</div>"
echo "<p class=\"sublib\">Application to the binary extended gcd algorithm algorithm:</p>"
for i in *.v; do
if [[ "$i" == begcd*.v ]]; then
print_filename $dir $i
fi
done
fi
# if [ $dir == 'bbs_unpredictable' ]; then
# echo "<p class=\"sublib\">Certifying Assembly with Formal Cryptographic Proofs: the Case of BBS:</p>"
# for i in *.v; do
# print_filename $dir $i
# done
# fi
if [ $dir == 'seplogC' ]; then
echo "<p class=\"sublib\">Formalization of a subset of the C programming language and its Separation logic:</p>"
for i in *.v; do
C_cond $i
if [ $? -eq 1 ]; then
print_filename $dir $i
fi
done
echo "<p class=\"sublib\">Formal specification of TLS network packets (see <a href=\"http://tools.ietf.org/html/rfc5246\">RFC 5246</a>):</p>"
print_filename $dir "rfc5246.v"
echo "<p class=\"sublib\">Application to the formal verification of network packet decoder functions taken from <a href=\"http://polarssl.org\">PolarSSL</a>:</p>"
for i in *.v; do
POLAR_cond $i
if [ $? -eq 1 ]; then
print_filename $dir $i
fi
done
fi
echo "</dd>"
cd $currentdir
done
echo "</dl>"
echo ""