Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
benchmark_graph_04.py
Go to the documentation of this file.
1import numpy as np
2import matplotlib.pyplot as plt
3import re
4
5barWidth = 0.25
6fig = plt.subplots(figsize =(12, 8))
7
8pattern = re.compile("(32m)([0-9]+)")
9
10our_solution = []
11qfesta = []
12
13
14# Check for p381
15matching_values = []
16for i, line in enumerate(open('../../c-code/cmake-build-release-cycles-x8664-graph-04/benchmarks_ssec-p381-output.txt')):
17 for match in re.finditer(pattern, line):
18 matching_values.append(int(match.group(2)))
19our_solution.append(matching_values[1])
20
21# Check for p398
22matching_values = []
23for i, line in enumerate(open('../../c-code/cmake-build-release-cycles-x8664-graph-04/benchmarks_ssec-p398-output.txt')):
24 for match in re.finditer(pattern, line):
25 matching_values.append(int(match.group(2)))
26qfesta.append(matching_values[1])
27
28# Check for p575
29matching_values = []
30for i, line in enumerate(open('../../c-code/cmake-build-release-cycles-x8664-graph-04/benchmarks_ssec-p575-output.txt')):
31 for match in re.finditer(pattern, line):
32 matching_values.append(int(match.group(2)))
33our_solution.append(matching_values[1])
34
35# Check for p592
36matching_values = []
37for i, line in enumerate(open('../../c-code/cmake-build-release-cycles-x8664-graph-04/benchmarks_ssec-p592-output.txt')):
38 for match in re.finditer(pattern, line):
39 matching_values.append(int(match.group(2)))
40qfesta.append(matching_values[1])
41
42# Check for p765
43matching_values = []
44for i, line in enumerate(open('../../c-code/cmake-build-release-cycles-x8664-graph-04/benchmarks_ssec-p765-output.txt')):
45 for match in re.finditer(pattern, line):
46 matching_values.append(int(match.group(2)))
47our_solution.append(matching_values[1])
48
49# Check for p783
50matching_values = []
51for i, line in enumerate(open('../../c-code/cmake-build-release-cycles-x8664-graph-04/benchmarks_ssec-p783-output.txt')):
52 for match in re.finditer(pattern, line):
53 matching_values.append(int(match.group(2)))
54qfesta.append(matching_values[1])
55
56
57IT = our_solution
58ECE = qfesta
59
60br1 = np.arange(len(IT))
61br2 = [x + barWidth for x in br1]
62
63plt.bar(br1, IT, color ='r', width = barWidth, edgecolor ='grey', label ='Our Solution')
64plt.bar(br2, ECE, color ='b', width = barWidth, edgecolor ='grey', label ='QFESTA')
65
66plt.xlabel('Primes', fontweight ='bold', fontsize = 15)
67plt.ylabel('CPU Cycles', fontweight ='bold', fontsize = 15)
68plt.xticks([r + barWidth for r in range(len(IT))],
69 ['128-bits: p381 vs p398', '192-bits: p575 vs p592', '256-bits: p765 vs. p783'])
70
71plt.title('Benchmarks for the 3-isogenies walks: Our solution vs. QFESTA')
72
73plt.legend()
74plt.show()