Benchmark

class benchmark.algebraic_attack_benchmark.ExperimentRecord(folder_results: str, id: int, algo_gb: str, options: dict[str, list[dict[str, any]]], algo_order_change: str, field_size: int, monomial_order: str, permutation: str, cico: int, round: int, number_test: int, branch: int, seed: int, constant_sparsity: int)

Class for the generation of system(s) of equations corresponding to an algebraic attack over a primitive and its solving.

Parameters:
  • folder_results (str) – Path of the folder containing the results of the generation

  • id (int) – ID of the files containing log and results of the experiment

  • field_size (int) – size of the prime finite field

  • monomial_order (str) – monomial order to use to define the multivariate polynomial ring

  • permutation (str) – permutation (modelling)

  • cico (int) – number of the CICO problem to solve

  • round (int) – Number of rounds

  • branch (int) – Number of branches

  • constant_sparsity (int) – Sparsity of the constant

  • number_test – Number of systems to generate

  • seed (int) – seed for randomness

  • algo_gb (str) – Algorithm to compute the Gröbner basis

  • options (dict[str, list[dict[str, any]]]) – Options for the Gröbner basis algorithm

  • algo_order_change (str) – Algorithm to use for the term order change

generate_systems(system_generation_timeout: float, state: str)

Generate the system of equations from the permutation.

Parameters:
  • system_generation_timeout (float) – Timeout for the generation of the system

  • state (str) – State of the experiment. At the initialisation it is either “skipped” if it is in the forbidden zone or “failed”

solve_systems(system_generation_timeout: float, full_computation_timetout: float)

Solve systems of equations generated

Parameters:
  • system_generation_timeout (float) – Timeout for the generation of the system

  • full_computation_timeout (float) – Timeout for the algebraic attack

benchmark.algebraic_attack_benchmark.system_of_equation_shape(system_of_equation: list)

Return the system of equations shape, that is a tuple of a number of monomials, a list of indices of the variables to use and a total degree.

Parameters:

system_of_equation (list) – The system of equations

benchmark.generate_parameters.generate_set_of_parameters(json_file: str, permutation: str, version: str)

Generate all the parameters dictionnaries

Parameters:
  • json_file (str) – JSON file with the description of the parameters for the benchmark

  • permutation (str) – Permutation/modelling name

  • version (str) – Version of the tool

benchmark.perform_experiments.perform_experiments(folder_results: str, parameters: list[dict], system_generation_timeout: float, full_computation_timeout: float)

Perform the list of experiments in parameters.

This list contains experiments with the same parameter for the permutation except the number of branches or rounds. The time to perform an algebraic attack increases with these variables. Then, we use a forbidden zone that contains timed out experiments. If an experiment is treated with a higher number of rounds or branches than one from the forbidden zone then it is immediatly skipped as we know it will we be timed out.

Parameters:
  • folder_results (str) – folder with the results of the benchmark

  • parameters (list[dict]) – list of dictionnaries of parameters to treat

  • system_generation_timeout (float) – Timeout for the generation of the system

  • full_computation_timeout (float) – Timeout for the algebraic attack