cascada.primitives.aes module
AES-128.
A WeakModel is used to model the XOR and linear models of the S-box,
and a BranchNumberModel is used to model the XOR and linear models of MixColumns.
AES source: https://csrc.nist.gov/csrc/media/publications/fips/197/final/documents/fips-197.pdf
- class cascada.primitives.aes.AESKeySchedule(*args, **options)[source]
Bases:
cascada.bitvector.ssa.RoundBasedFunctionKey schedule of AES-128.
- classmethod set_num_rounds(new_num_rounds)[source]
Set
RoundBasedFunction.num_roundsand updateinput_widthsandoutput_widthsif necessary.
- class cascada.primitives.aes.SboxLut(**kwargs)[source]
Bases:
cascada.bitvector.secondaryop.LutOperationThe 8-bit S-box of AES.
- linear_model
alias of
cascada.linear.opmodel.get_weak_model.<locals>.MyWeakModel
- xor_model
alias of
cascada.differential.opmodel.get_weak_model.<locals>.MyWeakModel
- class cascada.primitives.aes.MixColumnsBitMatrix(**kwargs)[source]
Bases:
cascada.bitvector.secondaryop.MatrixOperationThe (32, 32) binary matrix representing MixColumns.
- linear_model
alias of
cascada.linear.opmodel.get_branch_number_model.<locals>.MyBranchNumberModel
- xor_model
alias of
cascada.differential.opmodel.get_branch_number_model.<locals>.MyBranchNumberModel
- class cascada.primitives.aes.AESEncryption(*args, **options)[source]
Bases:
cascada.primitives.blockcipher.Encryption,cascada.primitives.aes_like.AESLikeFunctionEncryption function of AES-128.
- sbox
alias of
cascada.primitives.aes.SboxLut
- mix_columns_bit_matrix
- class cascada.primitives.aes.AESCipher(plaintext, masterkey, **options)[source]
Bases:
cascada.primitives.blockcipher.CipherThe block cipher AES-128.
- key_schedule
- encryption
alias of
cascada.primitives.aes.AESEncryption
- classmethod set_num_rounds(new_num_rounds)[source]
Call
RoundBasedFunction.set_num_roundsofkey_scheduleandencryption(if iterated).