Modules#

src.aux_functions.check_estimator_installed()[source]#
src.aux_functions.check_ntru(output_dict)[source]#
src.aux_functions.check_parameters(std_e, logq, lwe_d, l, param)[source]#

Check the validity of the parameters.

Parameters:
  • std_e – Standard deviation of the error.

  • logq – List of log q values.

  • lwe_d – LWE dimension.

  • l – Security parameter.

  • param – Parameter to be checked.

Returns:

List of error messages.

src.aux_functions.closest_power_of_2(n)[source]#

Find the closest power of 2 to a given number.

Parameters:

n – Input number.

Returns:

Closest power of 2.

src.aux_functions.correction_logic(l, lwe_d, lnq, lwe_usvp, lwe_bdd, secret_dist, error_dist, est_usvp_numerical, est_bdd_numerical, param, num_calls_usvp, num_calls_bdd, error_dist_tag=None)[source]#
src.aux_functions.create_explanation_dict(headers)[source]#

Create a dictionary of explanations for the headers.

Parameters:

headers – List of headers.

Returns:

Dictionary of explanations.

src.aux_functions.export_to_csv(data, output_file)[source]#

Export data to a CSV file.

Parameters:
  • data – List of dictionaries containing table rows.

  • output_file – Path to the output CSV file.

src.aux_functions.get_parameters(lwe_d, lnq, secret_dist, error_dist, est_usvp_numerical, est_bdd_numerical, error_dist_tag, param)[source]#
src.aux_functions.get_secret_value(opts)[source]#
src.aux_functions.handle_errors(std_e, logq, lwe_d, l, param)[source]#
src.aux_functions.handle_options(opts)[source]#

Handle the command-line options.

Parameters:

opts – List of options and arguments.

Returns:

Tuple of output dictionary and various parameters.

src.aux_functions.helper()[source]#

Print the helper message and exit.

src.aux_functions.helper_fit()[source]#

Print the helper message for fitting and exit.

src.aux_functions.helper_headers(header)[source]#

Print the headers and their explanations.

Parameters:

header – List of headers.

src.aux_functions.parse_logq(logq_str)[source]#

Parse the logq string into a list of logq values.

Parameters:

logq_str – Logq string.

Returns:

List of logq values.

src.aux_functions.parse_options(argv)[source]#

Parse command-line options.

Parameters:

argv – List of command-line arguments.

Returns:

List of options and arguments.

src.aux_functions.print_table(headers, rows)[source]#

Print a table with headers and rows.

Parameters:
  • headers – List of headers.

  • rows – List of rows.

src.aux_functions.print_warnings(verify, estimator_installed)[source]#
src.aux_functions.set_distribution(dist_type, params, is_error=False)[source]#

Set the secret/error distribution and its parameters.

Parameters:
  • dist_type – Distribution type (e.g., ‘binary’, ‘gaussian’).

  • params – Dictionary of parameters.

  • is_error – Boolean flag to indicate if this is for the error distribution.

Returns:

Distribution object.

src.aux_functions.set_functions_params(secret)[source]#

Set the lambda functions based on the secret distribution.

Parameters:

secret – Secret distribution (binary or ternary).

Returns:

Tuple of lambda functions.