leebrickell

class cryptographic_estimators.SDFqEstimator.SDFqAlgorithms.leebrickell.LeeBrickell(problem: SDFqProblem, **kwargs)

Bases: SDFqAlgorithm

Construct an instance of Lee-Brickell’s estimator [LB88].

Expected weight distribution:

<———-+ n - k +———>

w-p

<———-+ k +————>

p

Parameters:

problem (SDFqProblem) – An SDProblem object including all necessary parameters.

Tests:
>>> from cryptographic_estimators.SDFqEstimator.SDFqAlgorithms import LeeBrickell
>>> from cryptographic_estimators.SDFqEstimator import SDFqProblem
>>> LeeBrickell(SDFqProblem(n=961,k=771,w=48,q=31)).time_complexity()
140.31928490910389

Examples

>>> from cryptographic_estimators.SDFqEstimator.SDFqAlgorithms import LeeBrickell
>>> from cryptographic_estimators.SDFqEstimator import SDFqProblem
>>> LeeBrickell(SDFqProblem(n=100,k=50,w=10,q=5))
Lee-Brickell estimator for syndrome decoding problem with (n,k,w) = (100,50,10) over Finite Field of size 5
property attack_type

Returns the attack type of the algorithm.

property complexity_type

Returns the attribute _complexity_type.

get_optimal_parameters_dict()

Returns the optimal parameters dictionary.

has_optimal_parameter()

Return True if the algorithm has optimal parameter.

Tests:
>>> from cryptographic_estimators import BaseAlgorithm, BaseProblem
>>> BaseAlgorithm(BaseProblem()).has_optimal_parameter()
False
property memory_access

Returns the attribute _memory_access.

memory_access_cost(mem: float)

Returns the memory access cost (in logarithmic scale) of the algorithm per basic operation.

Parameters:

mem (float) – Memory consumption of an algorithm.

Returns:

Memory access cost in logarithmic scale.

Return type:

float

Note

memory_access: Specifies the memory access cost model (default: 0, choices: 0 - constant, 1 - logarithmic, 2 - square-root, 3 - cube-root or deploy custom function which takes as input the logarithm of the total memory usage)

memory_complexity(**kwargs)

Return the memory complexity of the algorithm.

Parameters:

**kwargs

Arbitrary keyword arguments.

optimal_parameters - If for each optimal parameter of the algorithm a value is provided, the computation is done based on those parameters.

optimal_parameters()

Return a dictionary of optimal parameters.

Tests:
>>> from cryptographic_estimators import BaseAlgorithm, BaseProblem
>>> BaseAlgorithm(BaseProblem()).optimal_parameters()
{}
p()

Returns the optimal parameter $p$ used in the algorithm optimization.

Examples

>>> from cryptographic_estimators.SDFqEstimator.SDFqAlgorithms import LeeBrickell
>>> from cryptographic_estimators.SDFqEstimator import SDFqProblem
>>> A = LeeBrickell(SDFqProblem(n=100,k=50,w=10,q=5))
>>> A.p()
2
parameter_names()

Return the list with the names of the algorithm’s parameters.

Tests:
>>> from cryptographic_estimators import BaseAlgorithm, BaseProblem
>>> BaseAlgorithm(BaseProblem()).parameter_names()
[]
property parameter_ranges

Returns the set ranges for optimal parameter search.

Returns the set ranges in which optimal parameters are searched by the optimization algorithm (used only for complexity type estimate).

reset()

Resets internal state of the algorithm.

set_parameter_ranges(parameter: str, min_value: float, max_value: float)

Set range of specific parameter.

If optimal parameter is already set, it must fall in that range.

Parameters:
  • parameter (str) – Name of parameter to set

  • min_value (float) – Lowerbound for parameter (inclusive)

  • max_value (float) – Upperbound for parameter (inclusive)

set_parameters(parameters: dict)

Set optimal parameters to predifined values.

Parameters:

parameters (dict) – Dictionary including parameters to set (for a subset of optimal_parameters functions)

time_complexity(**kwargs)

Return the time complexity of the algorithm.

Parameters:

**kwargs

Arbitrary keyword arguments.

optimal_parameters - If for each optimal parameter of the algorithm a value is provided, the computation is done based on those parameters.