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
andcell_width
.Subclasses also need to set
sbox
(resp.mix_columns_bit_matrix
) to usesub_cells
(resp.mix_columns
). SeeAESEncryption
for an example.Optionally, subclasses can set the attributes
logging_mode
andname*
to customize the information to log (seeLoggingMode
,BvFunction.get_formatted_logged_msgs
andCharacteristic.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 updateinput_widths
andoutput_widths
if necessary.