sdfq_estimator

class cryptographic_estimators.SDFqEstimator.sdfq_estimator.SDFqEstimator(n: int, k: int, w: int, q: int, memory_bound=inf, **kwargs)

Bases: BaseEstimator

Initializes the SDFqEstimator class.

Parameters:
  • n (int) – Code length.

  • k (int) – Code dimension.

  • w (int) – Error weight.

  • q (int) – Base field size.

  • memory_bound (float, optional) – Memory bound. Defaults to ‘inf’.

  • excluded_algorithms (list or tuple, optional) – A list or tuple of excluded algorithms. Defaults to None.

  • nsolutions (int, optional) – Number of solutions. Defaults to 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) – Whether to show quantum time complexity (default: 0).

  • show_tilde_o_time (int) – Whether to show Ō time complexity (default: 0).

  • show_all_parameters (int) – Whether to show all optimization parameters (default: 0).

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

  • truncate (int) – Whether to truncate rather than round the output (default: 0).

Examples

>>> from cryptographic_estimators.SDFqEstimator import SDFqEstimator
>>> A = SDFqEstimator(n=100,k=50,w=10,q=5)
>>> A.table()
+-------------+---------------+
|             |    estimate   |
+-------------+------+--------+
| algorithm   | time | memory |
+-------------+------+--------+
| Prange      | 29.9 |   13.5 |
| Stern       | 24.3 |   23.9 |
| LeeBrickell | 25.4 |   13.5 |
+-------------+------+--------+
Tests:
>>> from cryptographic_estimators.SDFqEstimator import SDFqEstimator
>>> A = SDFqEstimator(961,771,48,31)
>>> A.table(precision=3, show_all_parameters=1)
+-------------+-------------------------------------+
|             |               estimate              |
+-------------+---------+--------+------------------+
| algorithm   |    time | memory |    parameters    |
+-------------+---------+--------+------------------+
| Prange      | 151.310 | 19.794 |        {}        |
| Stern       | 129.059 | 42.016 | {'p': 2, 'l': 7} |
| LeeBrickell | 140.319 | 21.808 |     {'p': 2}     |
+-------------+---------+--------+------------------+