This repository was archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_attack.sh
More file actions
executable file
·59 lines (41 loc) · 1.6 KB
/
test_attack.sh
File metadata and controls
executable file
·59 lines (41 loc) · 1.6 KB
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
#! /bin/bash
#cargo build --release
for i in {32..500} #{35..60}
do
echo "Running with $i"
sudo ./target/release/kyber-not-it attack -p 0.95 -n $i > ./attack_results/out_$i.txt 2>&1
python3 check_flips.py ./attack_results/out_$i.txt > ./number_flips.txt
number_flips=$(wc -l < ./number_flips.txt)
if [ $number_flips -gt "0" ]; then
echo "$i pages needed for flip, found $number_flips" >> attack_results.txt
else
echo "Found no flips at $i, got $number_flips" >> attack_results.txt
fi
sudo rm number_flips.txt
done
for i in {501..1000} #{35..60}
do
echo "Running with $i"
sudo ./target/release/kyber-not-it attack -p 0.95 -n $i > ./attack_results/out_$i.txt 2>&1
python3 check_flips.py ./attack_results/out_$i.txt > ./number_flips.txt
number_flips=$(wc -l < ./number_flips.txt)
if [ $number_flips -gt "0" ]; then
echo "$i pages needed for flip, found $number_flips" >> attack_results.txt
else
echo "Found no flips at $i, got $number_flips" >> attack_results.txt
fi
sudo rm number_flips.txt
done
#for i in {633..1199}
#do
# echo "Running with $i"
# sudo ./target/release/kyber-not-it attack -p 0.95 -n $i > ./attack_results/out_$i.txt 2>&1
# python3 check_flips.py ./attack_results/out_$i.txt > ./number_flips.txt
# number_flips=$(wc -l < ./number_flips.txt)
# if [ $number_flips -gt "0" ]; then
# echo "$i pages needed for flip, found $number_flips" >> attack_results.txt
# else
# echo "Found no flips at $i, got $number_flips" >> attack_results.txt
# fi
# sudo rm number_flips.txt
#done