ranksd_problem

class cryptographic_estimators.RankSDEstimator.ranksd_problem.RankSDProblem(q: int, m: int, n: int, k: int, r: int, **kwargs)

Bases: BaseProblem

Construct an instance of RankSDProblem.

Parameters:
  • q (int) – Base field order.

  • m (int) – Extension degree.

  • n (int) – Code length.

  • k (int) – Code dimension.

  • r (int) – Target rank.

  • theta (float, optional) – Exponent of the conversion factor. Defaults to 2.

  • memory_bound (float, optional) – Maximum allowed memory to use for solving the problem. Defaults to inf.

Note

  • If 0 <= theta <= 2, every multiplication in GF(q) is counted as log2(q) ^ theta binary operation.

  • If theta = None, every multiplication in GF(q) is counted as 2 * log2(q) ^ 2 + log2(q) binary operation.

Construct an instance of BaseProblem.

Parameters:
  • parameters (dict) – Parameters of the problem.

  • nsolutions (int) – Number of solutions of the problem.

  • memory_bound (float, optional) – Maximum allowed memory to use for solving the problem. Defaults to inf.

base_field_order()

Return the order of the base finite field.

Tests:
>>> from cryptographic_estimators.RankSDEstimator.ranksd_problem  import RankSDProblem
>>> RSDP = RankSDProblem(q=2, m=127, n=118, k=48, r=7)
>>> RSDP.base_field_order()
2
code_dimension()

Return the dimension of the code.

Tests:
>>> from cryptographic_estimators.RankSDEstimator.ranksd_problem  import RankSDProblem
>>> RSDP = RankSDProblem(q=2, m=127, n=118, k=48, r=7)
>>> RSDP.code_dimension()
48
code_length()

Return the dimension of the vector space.

Tests:
>>> from cryptographic_estimators.RankSDEstimator.ranksd_problem  import RankSDProblem
>>> RSDP = RankSDProblem(q=2, m=127, n=118, k=48, r=7)
>>> RSDP.code_length()
118
degree_extension()

Return the degree of the field extension.

Tests:
>>> from cryptographic_estimators.RankSDEstimator.ranksd_problem  import RankSDProblem
>>> RSDP = RankSDProblem(q=2, m=127, n=118, k=48, r=7)
>>> RSDP.degree_extension()
127
expected_number_solutions()

Return the logarithm of the expected number of existing solutions to the problem.

get_parameters()

Return the optimizations parameters.

set_operations_on_base_field(value)

Set operations_on_base_field to value.

Parameters:

value (boolean) – True if operations are performed on Fq. False if operations are performed on Fq^m.

target_rank()

Return the target rank.

Tests:
>>> from cryptographic_estimators.RankSDEstimator.ranksd_problem  import RankSDProblem
>>> RSDP = RankSDProblem(q=2, m=127, n=118, k=48, r=7)
>>> RSDP.target_rank()
7
property theta

Returns the value of theta.

to_bitcomplexity_memory(elements_to_store: float)

Return the memory bit-complexity associated to a given number of elements to store.

Parameters:

elements_to_store – number of memory operations (logarithmic).

to_bitcomplexity_time(basic_operations: float)

Return the bit-complexity corresponding to a certain amount of basic_operations.

Parameters:

basic_operations (float) – Number of basic operations (logarithmic).

Tests:
>>> from cryptographic_estimators.RankSDEstimator.ranksd_estimator import RankSDProblem
>>> RSDP = RankSDProblem(q=2, m=127, n=118, k=48, r=7)
>>> RSDP.set_operations_on_base_field(True)
>>> RSDP.to_bitcomplexity_time(200)
200.0
>>> RSDP.set_operations_on_base_field(False)
>>> RSDP.to_bitcomplexity_time(200)
213.97736937354432