cascada.primitives.aes_like module

AES-like functions.

class cascada.primitives.aes_like.LoggingMode(value)[source]

Bases: enum.Enum

Represent the options available for the information to log.

Silent

nothing is logged

RoundOutputs

the plaintext and the output of each round is logged

StepOutputs

the plaintext and the output of each step is logged

Debug

similar as StepOutputs, but also logs debugging information

class cascada.primitives.aes_like.AESLikeFunction(*args, **options)[source]

Bases: cascada.bitvector.ssa.RoundBasedFunction

Base class to implemented AES-like functions.

Subclasses need to set the integer attributes num_rounds, num_rows, num_columns and cell_width.

Subclasses also need to set sbox (resp. mix_columns_bit_matrix) to use sub_cells (resp. mix_columns). See AESEncryption for an example.

Optionally, subclasses can set the attributes logging_mode and name* to customize the information to log (see LoggingMode, BvFunction.get_formatted_logged_msgs and Characteristic.get_formatted_logged_msgs).

By default input/output bit-vector tuples are loaded column-wise.

classmethod set_num_rounds(new_num_rounds)[source]

Set RoundBasedFunction.num_rounds and update input_widths and output_widths if necessary.