Skip to content

Commit c0c8151

Browse files
Merge pull request #54 from qec-codes/plot-disclaimer
Plot disclaimer
2 parents 5b71576 + 6a8e3a4 commit c0c8151

File tree

4 files changed

+237
-7
lines changed

4 files changed

+237
-7
lines changed

assets/qtt-output.png

4.38 KB
Loading

assets/rsa-threat-over-time.png

22 Bytes
Loading

notebooks/development/demo_plots.ipynb

Lines changed: 220 additions & 0 deletions
Large diffs are not rendered by default.

src/quantumthreattracker/lifespan_estimator/lifespan_estimator.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,29 @@ def estimate_threats(self, protocol: str, key_size: int) -> dict:
8080
"threats": threats,
8181
}
8282

83-
def generate_report(self, protocols: list[dict]) -> None:
83+
def generate_report(
84+
self, protocols: list[dict], print_progress: bool = False
85+
) -> None:
8486
"""Predict the threats against several cryptographic protocols.
8587
8688
Parameters
8789
----------
8890
protocols : list[dict]
8991
List of cryptographic protocols.
92+
print_progress : bool, optional
93+
Whether to print the progress of the report generation, by default False.
9094
"""
91-
threat_report = [
92-
self.estimate_threats(
93-
protocol_and_key_size["algorithm"],
94-
protocol_and_key_size["keySize"],
95+
threat_report = []
96+
for protocol_and_key_size in protocols:
97+
algorithm = protocol_and_key_size["algorithm"]
98+
key_size = protocol_and_key_size["keySize"]
99+
if print_progress:
100+
print(f"Estimating threats for {algorithm}-{key_size}")
101+
threat = self.estimate_threats(
102+
algorithm,
103+
key_size,
95104
)
96-
for protocol_and_key_size in protocols
97-
]
105+
threat_report.append(threat)
98106

99107
self._threat_report = threat_report
100108

@@ -163,6 +171,8 @@ def get_report(
163171
if soonest_threat_only:
164172
simplified_report_output = []
165173
for protocol in report_output:
174+
if not protocol["threats"]:
175+
continue
166176
lowest_timestamp = protocol["threats"][0]["timestamp"]
167177
soonest_threat = protocol["threats"][0]
168178
for threat in protocol["threats"]:

0 commit comments

Comments
 (0)