Output

class lascar.output.output_method.MultipleOutputMethod(*output_methods)[source]

Bases: lascar.output.output_method.OutputMethod

MultipleOutputMethod is the OutputMethod used when the user want to register multiple OutputMethods.

finalize()[source]

At the end of the Session processing side-channel traces, the OutputMethod finalize() method is called to conclude the ouput strategy :return:

update(engine, results)[source]

update() is the method called by the Session at each output_step. After computing its results, the Session calls its OuptutMethod update() method for the results to be processed.

Parameters:
  • engine – the current engine
  • results – its result
Returns:

None

class lascar.output.output_method.NullOutputMethod(*engines)[source]

Bases: lascar.output.output_method.OutputMethod

class lascar.output.output_method.OutputMethod(*engines)[source]

Bases: object

OutputMethod is an virtual class. Its role is to set up the strategy for outputing results computed by engines.

The Session registers an OutputMethod. The OuputMethod tracks engines, and, at each output_step, it request results to them.

The children inherating from OutputManager implements how to process these results, and how to deliver them to the user.

finalize()[source]

At the end of the Session processing side-channel traces, the OutputMethod finalize() method is called to conclude the ouput strategy :return:

update(engine, results)[source]

update() is the method called by the Session at each output_step. After computing its results, the Session calls its OuptutMethod update() method for the results to be processed.

Parameters:
  • engine – the current engine
  • results – its result
Returns:

None

class lascar.output.console_output_method.ConsoleOutputMethod(*engines, filename=None, max_guesses=3)[source]

Bases: lascar.output.output_method.OutputMethod

ConsoleOuptputMethod is an OutputMethod that will display on the terminal the parsed results from its tracked engines (for each output_step).

For more info about parsing results, see lascar/ouput/parse_results

If a filename is specified, the finalize() method will output all its parsed results inside a txt file.

finalize()[source]

At the end of the Session processing side-channel traces, the OutputMethod finalize() method is called to conclude the ouput strategy :return:

class lascar.output.hdf5_output_method.Hdf5OutputMethod(filename, *engines, prefix='')[source]

Bases: lascar.output.output_method.OutputMethod

Hdf5OutputMethod is an OutputMethod that will store inside a hdf5 file the results from its tracked engines (for each output_step).

For each engine tracked, a hdf5 group is added to the file For each output_step, a hdf5 dataset is added inside the group corresponding to each engine.

A prefix can be specified if you want to store several Hdf5OutputMethod inside the same hdf5 file.

in the end:

hdf5_output_method[prefix + engine_name/output_step] contains engine.results after output_step traces processed.

static load(filename)[source]
class lascar.output.pickle_output_method.DictOutputMethod(*engines, filename=None)[source]

Bases: lascar.output.output_method.OutputMethod

DictOutputMethod is an OutputMethod that will store inside a dict the results from its tracked engines (for each output_step).

For each engine tracked, a key is added to the PickleOuputMethod, containing a sub-dict. For each output_step, a key is added inside the sub-dict corresponding to each engine.

in the end:

pickle_output_method[engine_name][output_step] contains engine.results after output_step traces processed.

If a filename is specified, the finalize() method will store the dict inside a file using pickle.

static load(filename)[source]
class lascar.output.plot_output_method.FullRankProgressionOutputMethod(*engines, number_of_columns=None, number_of_rows=None, single_plot=False, display=True, filename=None, legend=False, bin_width=0.01)[source]

Bases: lascar.output.plot_output_method.ScoreProgressionOutputMethod

FullRankProgressionOutputMethod is an OutputMethod that will plot the progression of the estimated total rank for GroupedEngines containing engines. It will actually plot 3 lines. One for the estimated rank, together with an upper and a lower bound. Right now argmax mode is assumed for all the subengines.

class lascar.output.plot_output_method.MatPlotLibOutputMethod(*engines, number_of_columns=None, number_of_rows=None, single_plot=False, display=True, filename=None, legend=False, solution_only=False)[source]

Bases: lascar.output.output_method.OutputMethod

MatPlotLibOutputMethod is an OutputMethod that will plot the results from its tracked engines (at each output_step).

If a filename is specified, the finalize() method will output all its parsed results inside a txt file.

from_output_method(output_method)[source]
class lascar.output.plot_output_method.RankProgressionOutputMethod(*engines, number_of_columns=None, number_of_rows=None, single_plot=False, display=True, filename=None, legend=False, filters=None, solution_only=False)[source]

Bases: lascar.output.plot_output_method.ScoreProgressionOutputMethod

RankProgressionOutputMethod is an OutputMethod that will plot the progression of the ranks for one (or several) GuessEngine, along all output_steps.

Quite close from MatplotlibOutputMethod, for the constructor arguments, RankOuputMethod will display a figure at the finalize() step instead of at all output_steps

For more info about parsing results, see lascar/ouput/parse_results

class lascar.output.plot_output_method.ScoreProgressionOutputMethod(*engines, number_of_columns=None, number_of_rows=None, single_plot=False, display=True, filename=None, legend=False, filters=None, solution_only=False)[source]

Bases: lascar.output.plot_output_method.MatPlotLibOutputMethod

ScoreProgressionOutputMethod is an OutputMethod that will plot the progression of the results for one (or several) GuessEngine, along all output_steps.

Quite close from MatplotlibOutputMethod, for the constructor arguments, ProgressionOuputMethod will display a figure at the finalize() step instead of at all output_steps

For more info about parsing results, see lascar/ouput/parse_results

get_scores()[source]
get_scores_solution()[source]
get_steps()[source]

parse_results.py

Implement function used by OutputMethod to interpret engines results.

lascar.output.parse_results.apply_parse(engine, results)[source]

Depending on the engine attribute ‘output_parser_mode’, apply_parse points toward the correct parse_output to apply on the engine results. And returns the parsed results. :param engine: the engine whose results need to be parsed :param results: the results to be parsed :return: the parsed results

lascar.output.parse_results.parse_output_argmax(results, guesses)[source]

parse_output_max is the ouput_parser used on GuessEngines for which you want to maximize the the absolute value of results. (eg in Cpa, you want to extract the guess for which the result is the highest, in absolute value)

For each guess, it outputs: (i,j,k) where: - i is the guess value - j is the max of the absolute value of result for guess i - k is the rank of the guess i among all guesses

Parameters:
  • results – the engine results to be parsed
  • guesses – the engines guesses
Returns:

the parsed results

lascar.output.parse_results.parse_output_basic(results)[source]

parse_output_basic is the default output_parser. It takes as an input the results returned by an engine, and returns, for each row, basic statistic: [min, max, mean, var] :param results: the engine results to be parsed :return: the parsed results

lascar.output.parse_results.parse_output_max(results, guesses)[source]

parse_output_max is the ouput_parser used on GuessEngines for which you want to maximize the results. (eg in Dpa, you want to extract the guess for which the result is the highest)

For each guess, it outputs: (i,j,k) where: - i is the guess value - j is the max of the result for guess i - k is the rank of the guess i among all guesses

Parameters:
  • results – the engine results to be parsed
  • guesses – the engines guesses
Returns:

the parsed results

lascar.output.rank_estimation.RankEstimation(p, key_real, binWidth)[source]
class lascar.output.table_output_method.TableOutputMethod(*engines, filename=None, max_guesses=10)[source]

Bases: lascar.output.output_method.OutputMethod

TableOutputMethod is an OutputMethod that will display a table of the ranked results

finalize()[source]

At the end of the Session processing side-channel traces, the OutputMethod finalize() method is called to conclude the ouput strategy :return: