bike_estimator

class cryptographic_estimators.BIKEEstimator.bike_estimator.BIKEEstimator(r: int, w: int, t: int, memory_bound=inf, **kwargs)

Bases: BaseEstimator

Construct an instance of BIKEEstimator.

Parameters:

excluded_algorithm – A list/tuple of excluded algorithms (default: None)

algorithm_names()

Return a list of the name of considered algorithms.

algorithms()

Return a list of considered algorithms.

property bit_complexities

Returns a list of bit_complexities attributes of included algorithms.

property complexity_type

Returns a list of complexity_type attributes of included algorithms.

estimate(**kwargs)

Returns dictionary describing the complexity of each algorithm and its optimal parameters.

property estimator_type

Returns the type of the estimator.

Either problem or scheme

excluded_algorithms_by_default = []
fastest_algorithm(use_tilde_o_time=False)

Return the algorithm with the smallest time complexity.

Parameters:

use_tilde_o_time (bool) – Use Ō time complexity, i.e., ignore polynomial factors. Default is False.

property memory_access

Returns a list of memory_access attributes of included algorithms.

nalgorithms()

Return the number of considered algorithms.

reset()

Resets the internal states of the estimator and all included algorithms.

table(show_quantum_complexity=0, show_tilde_o_time=0, show_all_parameters=0, precision=1, truncate=0)

Print table describing the complexity of each algorithm and its optimal parameters.

Parameters:
  • show_quantum_complexity (int) – Show quantum time complexity (default: False)

  • show_tilde_o_time (int) – Show Ō time complexity (default: False)

  • show_all_parameters (int) – Show all optimization parameters (default: False)

  • precision (int) – Number of decimal digits output (default: 1)

  • truncate (int) – Truncate rather than round the output (default: False)

Examples

>>> from cryptographic_estimators.BIKEEstimator import BIKEEstimator
>>> A = BIKEEstimator(100, 10, 10)
>>> A.table()
+-------------+------------------+---------------+
|             |                  |    estimate   |
+-------------+------------------+------+--------+
| algorithm   |   attack_type    | time | memory |
+-------------+------------------+------+--------+
| SDKeyAttack |   key-recovery   | 20.2 |   15.5 |
| SDMsgAttack | message-recovery | 21.2 |   17.4 |
+-------------+------------------+------+--------+
>>> from cryptographic_estimators.BIKEEstimator import BIKEEstimator
>>> A = BIKEEstimator(150, 12, 11)
>>> A.table(show_all_parameters=1)
+-------------+------------------+--------------------------------------------------------------------+
|             |                  |                              estimate                              |
+-------------+------------------+------+--------+----------------------------------------------------+
| algorithm   |   attack_type    | time | memory |                     parameters                     |
+-------------+------------------+------+--------+----------------------------------------------------+
| SDKeyAttack |   key-recovery   | 21.8 |   16.6 | {'r': 5, 'p': 1, 'l': 9, 'SD-algorithm': 'Stern'}  |
| SDMsgAttack | message-recovery | 22.8 |   20.7 | {'r': 5, 'p': 2, 'l': 13, 'SD-algorithm': 'Stern'} |
+-------------+------------------+------+--------+----------------------------------------------------+
Tests:
>>> if skip_long_doctests:
...     pytest.skip()
>>> from cryptographic_estimators.BIKEEstimator import BIKEEstimator
>>> A = BIKEEstimator(3000, 50, 45)
>>> A.table(show_all_parameters=1) # long time
+-------------+------------------+--------------------------------------------------------------------+
|             |                  |                              estimate                              |
+-------------+------------------+------+--------+----------------------------------------------------+
| algorithm   |   attack_type    | time | memory |                     parameters                     |
+-------------+------------------+------+--------+----------------------------------------------------+
| SDKeyAttack |   key-recovery   | 57.0 |   33.7 | {'r': 9, 'p': 2, 'l': 41, 'SD-algorithm': 'Stern'} |
| SDMsgAttack | message-recovery | 58.3 |   33.7 | {'r': 9, 'p': 2, 'l': 41, 'SD-algorithm': 'Stern'} |
+-------------+------------------+------+--------+----------------------------------------------------+