regsd_estimator

class cryptographic_estimators.RegSDEstimator.regsd_estimator.RegSDEstimator(n: int, k: int, w: int, memory_bound=inf, **kwargs)

Bases: BaseEstimator

Construct an instance of RegSDEstimator.

Parameters:
  • n (int) – Code length.

  • k (int) – Code dimension.

  • w (int) – Error weight.

  • memory_bound – Memory bound.

  • **kwargs

    Additional keyword arguments.

    excluded_algorithms - A list/tuple of excluded algorithms (default: None).

    nsolutions - No. of solutions.

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: 0)

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

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

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

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

Examples

>>> from cryptographic_estimators.RegSDEstimator import RegSDEstimator
>>> A=RegSDEstimator(n=954, k=582, w=106)
>>> A.table(show_all_parameters=1)
+----------------+---------------------------------------------------------------------------------------+
|                |                                        estimate                                       |
+----------------+-------+--------+----------------------------------------------------------------------+
| algorithm      |  time | memory |                              parameters                              |
+----------------+-------+--------+----------------------------------------------------------------------+
| RegularISDPerm | 133.4 |   18.8 |                                  {}                                  |
| RegularISDEnum | 114.8 |   31.1 |                         {'p': 6, 'ell': 20}                          |
| RegularISDRep  | 112.7 |   60.3 |             {'p': 24, 'ell': 96, 'eps_x': 4, 'eps_y': 0}             |
| CCJ            | 129.1 |  127.6 |                             {'ell': 118}                             |
| CCJLin         | 148.9 |   18.4 |                                  {}                                  |
| SDAttack       | 155.1 |  118.9 | {'r': 6, 'depth': 2, 'p': 32, 'p1': 19, 'l': 212, 'variant': 'BJMM'} |
+----------------+-------+--------+----------------------------------------------------------------------+
Tests:
>>> from cryptographic_estimators.RegSDEstimator import RegSDEstimator
>>> A=RegSDEstimator(n=2320, k=1210, w=40)
>>> A.table(show_all_parameters=1)
+----------------+-----------------------------------------------------------------------------------+
|                |                                      estimate                                     |
+----------------+------+--------+-------------------------------------------------------------------+
| algorithm      | time | memory |                             parameters                            |
+----------------+------+--------+-------------------------------------------------------------------+
| RegularISDPerm | 72.0 |   21.3 |                                 {}                                |
| RegularISDEnum | 57.4 |   28.5 |                        {'p': 4, 'ell': 15}                        |
| RegularISDRep  | 59.0 |   41.0 |            {'p': 8, 'ell': 34, 'eps_x': 0, 'eps_y': 0}            |
| CCJ            | 75.8 |   74.7 |                            {'ell': 67}                            |
| CCJLin         | 83.4 |   21.3 |                                 {}                                |
| SDAttack       | 59.0 |   27.7 | {'r': 8, 'depth': 2, 'p': 2, 'p1': 1, 'l': 20, 'variant': 'BJMM'} |
+----------------+------+--------+-------------------------------------------------------------------+