Word permutation component¶
- class WordPermutation(current_round_number, current_round_number_of_components, input_id_links, input_bit_positions, output_bit_size, permutation_description, word_size)¶
Bases:
MixColumn- algebraic_polynomials(model)¶
Return a list of polynomials for MIX COLUMN operation.
INPUT:
model– model object; a model instance
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.midori_block_cipher import MidoriBlockCipher sage: from claasp.cipher_modules.models.algebraic.algebraic_model import AlgebraicModel sage: midori = MidoriBlockCipher(number_of_rounds=16) sage: mix_column = midori.get_component_from_id("mix_column_0_20") sage: mix_column.algebraic_polynomials(AlgebraicModel(midori)) [mix_column_0_20_x0 + mix_column_0_20_y0, mix_column_0_20_x1 + mix_column_0_20_y1, mix_column_0_20_x2 + mix_column_0_20_y2, ... mix_column_0_20_y61^2 + mix_column_0_20_y61, mix_column_0_20_y62^2 + mix_column_0_20_y62, mix_column_0_20_y63^2 + mix_column_0_20_y63]
- as_python_dictionary()¶
- check_output_size(available_word_sizes, fixed, word_size)¶
- cms_constraints()¶
Return a list of variables and a list of clauses for MIX COLUMN in CMS CIPHER model.
See also
SAT standard of Cipher for the format.
INPUT:
None
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.midori_block_cipher import MidoriBlockCipher sage: midori = MidoriBlockCipher(number_of_rounds=3) sage: mix_column_component = midori.component_from(0, 23) sage: mix_column_component.cms_constraints() (['mix_column_0_23_0', 'mix_column_0_23_1', 'mix_column_0_23_2', ... '-mix_column_0_23_15 -mix_column_0_20_35 mix_column_0_20_39 -mix_column_0_20_43', '-mix_column_0_23_15 mix_column_0_20_35 -mix_column_0_20_39 -mix_column_0_20_43', 'mix_column_0_23_15 -mix_column_0_20_35 -mix_column_0_20_39 -mix_column_0_20_43'])
- cms_xor_differential_propagation_constraints(model)¶
- cms_xor_linear_mask_propagation_constraints(model=None)¶
Return a list of variables and a list of clauses for LINEAR LAYER in CMS XOR LINEAR model.
See also
SAT standard of Cipher for the format.
INPUT:
model– model object (default: None); a model instance
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.fancy_block_cipher import FancyBlockCipher sage: fancy = FancyBlockCipher(number_of_rounds=3) sage: linear_layer_component = fancy.component_from(0,6) sage: linear_layer_component.cms_xor_linear_mask_propagation_constraints() (['linear_layer_0_6_0_i', 'linear_layer_0_6_1_i', 'linear_layer_0_6_2_i', ... 'x -linear_layer_0_6_21_o dummy_0_linear_layer_0_6_21_o dummy_1_linear_layer_0_6_21_o dummy_2_linear_layer_0_6_21_o dummy_3_linear_layer_0_6_21_o dummy_4_linear_layer_0_6_21_o dummy_5_linear_layer_0_6_21_o dummy_6_linear_layer_0_6_21_o dummy_8_linear_layer_0_6_21_o dummy_9_linear_layer_0_6_21_o dummy_10_linear_layer_0_6_21_o dummy_11_linear_layer_0_6_21_o dummy_12_linear_layer_0_6_21_o dummy_18_linear_layer_0_6_21_o dummy_19_linear_layer_0_6_21_o dummy_23_linear_layer_0_6_21_o', 'x -linear_layer_0_6_22_o dummy_0_linear_layer_0_6_22_o dummy_1_linear_layer_0_6_22_o dummy_2_linear_layer_0_6_22_o dummy_3_linear_layer_0_6_22_o dummy_4_linear_layer_0_6_22_o dummy_6_linear_layer_0_6_22_o dummy_9_linear_layer_0_6_22_o dummy_13_linear_layer_0_6_22_o dummy_14_linear_layer_0_6_22_o dummy_15_linear_layer_0_6_22_o dummy_16_linear_layer_0_6_22_o dummy_19_linear_layer_0_6_22_o dummy_20_linear_layer_0_6_22_o dummy_21_linear_layer_0_6_22_o', 'x -linear_layer_0_6_23_o dummy_1_linear_layer_0_6_23_o dummy_5_linear_layer_0_6_23_o dummy_7_linear_layer_0_6_23_o dummy_8_linear_layer_0_6_23_o dummy_9_linear_layer_0_6_23_o dummy_14_linear_layer_0_6_23_o dummy_17_linear_layer_0_6_23_o dummy_18_linear_layer_0_6_23_o dummy_23_linear_layer_0_6_23_o'])
- cp_constraints()¶
Return lists of declarations and constraints for MIX COLUMN component for the CP cipher model.
INPUT:
None
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.aes_block_cipher import AESBlockCipher sage: aes = AESBlockCipher(number_of_rounds=3) sage: mix_column_component = aes.component_from(0, 21) sage: mix_column_component.cp_constraints() ([], ['constraint mix_column_0_21[0] = (rot_0_17[1] + rot_0_18[0] + rot_0_18[1] + rot_0_19[0] + rot_0_20[0]) mod 2;', ... 'constraint mix_column_0_21[31] = (rot_0_17[0] + rot_0_17[7] + rot_0_18[7] + rot_0_19[7] + rot_0_20[0]) mod 2;'])
- cp_deterministic_truncated_xor_differential_constraints(inverse=False)¶
Return lists declarations and constraints for MIX COLUMN component for the CP deterministic truncated xor differential model.
INPUT:
inverse– boolean (default: False)
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.aes_block_cipher import AESBlockCipher sage: aes = AESBlockCipher(number_of_rounds=3) sage: mix_column_component = aes.component_from(0, 21) sage: mix_column_component.cp_deterministic_truncated_xor_differential_constraints() ([], ['constraint if ((rot_0_17[1] < 2) /\\ (rot_0_18[0] < 2) /\\ (rot_0_18[1] < 2) /\\ (rot_0_19[0] < 2) /\\ (rot_0_20[0]< 2)) then mix_column_0_21[0] = (rot_0_17[1] + rot_0_18[0] + rot_0_18[1] + rot_0_19[0] + rot_0_20[0]) mod 2 else mix_column_0_21[0] = 2 endif;', ... 'constraint if ((rot_0_17[0] < 2) /\\ (rot_0_17[7] < 2) /\\ (rot_0_18[7] < 2) /\\ (rot_0_19[7] < 2) /\\ (rot_0_20[0]< 2)) then mix_column_0_21[31] = (rot_0_17[0] + rot_0_17[7] + rot_0_18[7] + rot_0_19[7] + rot_0_20[0]) mod 2 else mix_column_0_21[31] = 2 endif;'])
- cp_deterministic_truncated_xor_differential_trail_constraints()¶
- cp_xor_differential_propagation_constraints(model)¶
- cp_xor_differential_propagation_first_step_constraints(model)¶
Return declarations and constraints for MIX COLUMN component for the CP xor differential first step model.
INPUT:
model– model object; a model instance
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.aes_block_cipher import AESBlockCipher sage: from claasp.cipher_modules.models.cp.cp_model import CpModel sage: aes = AESBlockCipher(number_of_rounds=3) sage: cp = CpModel(aes) sage: mix_column_component = aes.component_from(0, 21) sage: mix_column_component.cp_xor_differential_propagation_first_step_constraints(cp) (['array[0..3] of var 0..1: mix_column_0_21;', 'array[0..93, 1..8] of int: mix_column_truncated_table_mix_column_0_21 = array2d(0..93, 1..8, [0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,1,1,1,1,0,0,1,1,0,1,1,1,0,0,1,1,1,0,1,1,0,0,1,1,1,1,0,1,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,1,0,0,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,0,1,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,1,0,1,0,1,1,0,1,1,1,0,0,1,1,0,1,1,1,1,0,1,1,1,0,0,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,1,0,0,1,0,1,1,1,1,0,1,0,0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,1,0,1,1,1,1,0,0,1,1,0,1,1,1,0,0,1,1,1,0,1,1,0,0,1,1,1,1,0,1,0,0,1,1,1,1,1,1,0,1,0,0,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,1,0,1,0,1,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,1,0,1,0,1,1,0,1,1,1,1,0,1,1,1,0,0,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,0,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,1,0,1,1,1,1,0,0,1,1,0,1,1,1,0,0,1,1,1,0,1,1,0,0,1,1,1,1,1,1,0,1,0,0,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,1,1,1,0,1,1,1,0,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,1,0,1,1,1,1,0,0,1,1,0,1,1,1,0,0,1,1,1,1,1,1,0,1,0,0,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,1,0,0,1,1,1,1,0,1,0,1,1,1,1,1,0,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1]);'], ['constraint table([rot_0_17[0]]++[rot_0_18[0]]++[rot_0_19[0]]++[rot_0_20[0]]++[mix_column_0_21[0]]++[mix_column_0_21[1]]++[mix_column_0_21[2]]++[mix_column_0_21[3]], mix_column_truncated_table_mix_column_0_21);'])
- cp_xor_linear_mask_propagation_constraints(model=None)¶
Return lists of declarations and constraints for MIX COLUMN component for the CP xor linear model.
INPUT:
model– model object (default: None); a model instance
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.aes_block_cipher import AESBlockCipher sage: aes = AESBlockCipher(number_of_rounds=3) sage: mix_column_component = aes.component_from(0, 21) sage: mix_column_component.cp_xor_linear_mask_propagation_constraints() (['array[0..31] of var 0..1:mix_column_0_21_i;', 'array[0..31] of var 0..1:mix_column_0_21_o;'], ['constraint mix_column_0_21_i[0]=(mix_column_0_21_o[1]+mix_column_0_21_o[2]+mix_column_0_21_o[3]+mix_column_0_21_o[8]+mix_column_0_21_o[9]+mix_column_0_21_o[11]+mix_column_0_21_o[16]+mix_column_0_21_o[18]+mix_column_0_21_o[19]+mix_column_0_21_o[24]+mix_column_0_21_o[27]) mod 2;', ... 'constraint mix_column_0_21_i[31]=(mix_column_0_21_o[0]+mix_column_0_21_o[2]+mix_column_0_21_o[7]+mix_column_0_21_o[9]+mix_column_0_21_o[10]+mix_column_0_21_o[15]+mix_column_0_21_o[18]+mix_column_0_21_o[23]+mix_column_0_21_o[24]+mix_column_0_21_o[25]+mix_column_0_21_o[26]) mod 2;'])
- property description¶
- get_bit_based_c_code(verbosity)¶
- get_bit_based_vectorized_python_code(params, convert_output_to_bytes)¶
- get_byte_based_vectorized_python_code(params)¶
- get_graph_representation()¶
- property id¶
- property input_bit_positions¶
- property input_bit_size¶
- property input_id_links¶
- is_forbidden(forbidden_types, forbidden_descriptions)¶
- is_id_equal_to(component_id)¶
- is_power_of_2_word_based(dto)¶
- milp_bitwise_deterministic_truncated_xor_differential_binary_constraints(model)¶
Returns a list of variables and a list of constraints for linear layer component in deterministic truncated XOR differential model.
INPUT:
model– model object; a model instance
EXAMPLES:
sage: from claasp.ciphers.permutations.ascon_sbox_sigma_permutation import AsconSboxSigmaPermutation sage: from claasp.cipher_modules.models.milp.milp_models.milp_bitwise_deterministic_truncated_xor_differential_model import MilpBitwiseDeterministicTruncatedXorDifferentialModel sage: ascon = AsconSboxSigmaPermutation(number_of_rounds=1) sage: milp = MilpBitwiseDeterministicTruncatedXorDifferentialModel(ascon) sage: milp.init_model_in_sage_milp_class() sage: linear_layer_component = ascon.component_from(0, 68) sage: variables, constraints = linear_layer_component.milp_bitwise_deterministic_truncated_xor_differential_binary_constraints(milp)
- milp_bitwise_deterministic_truncated_xor_differential_constraints(model)¶
Returns a list of variables and a list of constraints for linear layer component in deterministic truncated XOR differential model.
INPUT:
model– model object; a model instance
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.present_block_cipher import PresentBlockCipher sage: from claasp.cipher_modules.models.milp.milp_models.milp_bitwise_deterministic_truncated_xor_differential_model import MilpBitwiseDeterministicTruncatedXorDifferentialModel sage: present = PresentBlockCipher(number_of_rounds=6) sage: milp = MilpBitwiseDeterministicTruncatedXorDifferentialModel(present) sage: milp.init_model_in_sage_milp_class() sage: linear_layer_component = present.component_from(0, 17) sage: variables, constraints = linear_layer_component.milp_bitwise_deterministic_truncated_xor_differential_constraints(milp) sage: variables [('x_class[sbox_0_1_0]', x_0), ('x_class[sbox_0_1_1]', x_1), ... ('x_class[linear_layer_0_17_62]', x_126), ('x_class[linear_layer_0_17_63]', x_127)] sage: constraints [x_64 == x_0, x_65 == x_4, ... x_126 == x_59, x_127 == x_63]
- milp_constraints(model)¶
Return lists of variables and constrains modeling a component of type MIX COLUMN for MILP CIPHER model.
INPUT:
model– model object; a model instance
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.aes_block_cipher import AESBlockCipher sage: from claasp.cipher_modules.models.milp.milp_model import MilpModel sage: aes = AESBlockCipher(number_of_rounds=3) sage: milp = MilpModel(aes) sage: milp.init_model_in_sage_milp_class() sage: mix_column_component = aes.component_from(0, 21) sage: variables, constraints = mix_column_component.milp_constraints(milp) ... sage: variables [('x[rot_0_17_0]', x_0), ('x[rot_0_17_1]', x_1), ... ('x[mix_column_0_21_30]', x_62), ('x[mix_column_0_21_31]', x_63)] sage: constraints[:3] [1 <= 1 - x_1 + x_8 + x_9 + x_16 + x_24 + x_32, 1 <= 1 + x_1 - x_8 + x_9 + x_16 + x_24 + x_32, 1 <= 1 + x_1 + x_8 - x_9 + x_16 + x_24 + x_32]
- milp_wordwise_deterministic_truncated_xor_differential_constraints(model)¶
Returns a list of variables and a list of constraints for mix column component in deterministic truncated XOR differential model.
For MDS matrices, this method implements Model 5 from https://tosc.iacr.org/index.php/ToSC/article/view/8702/8294 INPUTS:
model– model object; a model instance
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.aes_block_cipher import AESBlockCipher sage: aes = AESBlockCipher(number_of_rounds=2) sage: from claasp.cipher_modules.models.milp.milp_models.milp_wordwise_deterministic_truncated_xor_differential_model import MilpWordwiseDeterministicTruncatedXorDifferentialModel sage: milp = MilpWordwiseDeterministicTruncatedXorDifferentialModel(aes) sage: milp.init_model_in_sage_milp_class() sage: mix_column_component = aes.component_from(0, 21) sage: variables, constraints = mix_column_component.milp_wordwise_deterministic_truncated_xor_differential_constraints(milp) sage: variables [('x[rot_0_17_word_0_class_bit_0]', x_0), ('x[rot_0_17_word_0_class_bit_1]', x_1), ... ('x[mix_column_0_21_word_3_class_bit_0]', x_14), ('x[mix_column_0_21_word_3_class_bit_1]', x_15)] sage: constraints [1 <= 1 + x_0 + x_1 + x_2 + x_3 + x_4 + x_5 - x_15, 1 <= 1 + x_0 + x_1 + x_2 + x_3 + x_6 + x_7 - x_15, ... 1 <= 1 - x_11 + x_13, 1 <= 1 - x_9 + x_11] sage: from claasp.ciphers.block_ciphers.midori_block_cipher import MidoriBlockCipher sage: cipher = MidoriBlockCipher(number_of_rounds=2) sage: from claasp.cipher_modules.models.milp.milp_models.milp_wordwise_deterministic_truncated_xor_differential_model import MilpWordwiseDeterministicTruncatedXorDifferentialModel sage: milp = MilpWordwiseDeterministicTruncatedXorDifferentialModel(cipher) sage: milp.init_model_in_sage_milp_class() sage: mix_column_component = cipher.component_from(0, 21) sage: variables, constraints = mix_column_component.milp_wordwise_deterministic_truncated_xor_differential_constraints(milp) ...
- milp_xor_differential_propagation_constraints(model)¶
- milp_xor_linear_mask_propagation_constraints(model)¶
Return lists of variables and constraints for MIX COLUMN component for MILP xor linear.
INPUT:
model– model object; a model instance
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.skinny_block_cipher import SkinnyBlockCipher sage: from claasp.cipher_modules.models.milp.milp_model import MilpModel sage: skinny = SkinnyBlockCipher(block_bit_size=128, number_of_rounds=2) sage: milp = MilpModel(skinny) sage: milp.init_model_in_sage_milp_class() sage: mix_column_component = skinny.component_from(0, 31) sage: variables, constraints = mix_column_component.milp_xor_linear_mask_propagation_constraints(milp) ... sage: variables [('x[mix_column_0_31_0_i]', x_0), ('x[mix_column_0_31_1_i]', x_1), ... ('x[mix_column_0_31_30_o]', x_62), ('x[mix_column_0_31_31_o]', x_63)] sage: constraints [x_32 == x_24, x_33 == x_25, ... 1 <= 3 - x_15 + x_23 - x_31 - x_63, 1 <= 3 + x_15 - x_23 - x_31 - x_63]
- property output_bit_size¶
- output_size_for_concatenate(available_word_sizes, fixed, word_size)¶
- print()¶
- print_as_python_dictionary()¶
- print_values(code)¶
- print_word_values(code)¶
- sat_bitwise_deterministic_truncated_xor_differential_constraints()¶
Return a list of variables and a list of clauses for MIX COLUMN in SAT DETERMINISTIC TRUNCATED XOR DIFFERENTIAL model.
See also
SAT standard of Cipher for the format.
INPUT:
None
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.midori_block_cipher import MidoriBlockCipher sage: midori = MidoriBlockCipher(number_of_rounds=3) sage: mix_column_component = midori.component_from(0, 23) sage: out_ids, constraints = mix_column_component.sat_bitwise_deterministic_truncated_xor_differential_constraints() sage: constraints[7] 'mix_column_0_23_0_0 -inter_0_mix_column_0_23_0_0'
- sat_constraints()¶
Return a list of variables and a list of clauses for MIX COLUMN in SAT CIPHER model.
See also
SAT standard of Cipher for the format.
INPUT:
None
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.midori_block_cipher import MidoriBlockCipher sage: midori = MidoriBlockCipher(number_of_rounds=3) sage: mix_column_component = midori.component_from(0, 23) sage: mix_column_component.sat_constraints() (['mix_column_0_23_0', 'mix_column_0_23_1', 'mix_column_0_23_2', ... '-mix_column_0_23_15 -mix_column_0_20_35 mix_column_0_20_39 -mix_column_0_20_43', '-mix_column_0_23_15 mix_column_0_20_35 -mix_column_0_20_39 -mix_column_0_20_43', 'mix_column_0_23_15 -mix_column_0_20_35 -mix_column_0_20_39 -mix_column_0_20_43'])
- sat_xor_differential_propagation_constraints(model)¶
- sat_xor_linear_mask_propagation_constraints(model=None)¶
Return a list of variables and a list of clauses for MIX COLUMN in SAT XOR LINEAR model.
See also
SAT standard of Cipher for the format.
INPUT:
model– model object (default: None); a model instance
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.midori_block_cipher import MidoriBlockCipher sage: midori = MidoriBlockCipher(number_of_rounds=3) sage: mix_column_component = midori.component_from(0, 23) sage: mix_column_component.sat_xor_linear_mask_propagation_constraints() (['mix_column_0_23_0_i', 'mix_column_0_23_1_i', 'mix_column_0_23_2_i', ... '-mix_column_0_23_15_o -dummy_3_mix_column_0_23_15_o dummy_7_mix_column_0_23_15_o -dummy_11_mix_column_0_23_15_o', '-mix_column_0_23_15_o dummy_3_mix_column_0_23_15_o -dummy_7_mix_column_0_23_15_o -dummy_11_mix_column_0_23_15_o', 'mix_column_0_23_15_o -dummy_3_mix_column_0_23_15_o -dummy_7_mix_column_0_23_15_o -dummy_11_mix_column_0_23_15_o'])
- select_bits(code)¶
- select_words(code, word_size, input=True)¶
- set_description(description)¶
- set_id(id_string)¶
- set_input_bit_positions(bit_positions)¶
- set_input_id_links(input_id_links)¶
- smt_constraints()¶
Return a variable list and SMT-LIB list asserts representing MIX COLUMN for SMT CIPHER model.
INPUT:
None
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.midori_block_cipher import MidoriBlockCipher sage: midori = MidoriBlockCipher(number_of_rounds=3) sage: mix_column_component = midori.component_from(0, 23) sage: mix_column_component.smt_constraints() (['mix_column_0_23_0', 'mix_column_0_23_1', ... 'mix_column_0_23_14', 'mix_column_0_23_15'], ['(assert (= mix_column_0_23_0 (xor mix_column_0_20_36 mix_column_0_20_40 mix_column_0_20_44)))', '(assert (= mix_column_0_23_1 (xor mix_column_0_20_37 mix_column_0_20_41 mix_column_0_20_45)))', ... '(assert (= mix_column_0_23_14 (xor mix_column_0_20_34 mix_column_0_20_38 mix_column_0_20_42)))', '(assert (= mix_column_0_23_15 (xor mix_column_0_20_35 mix_column_0_20_39 mix_column_0_20_43)))'])
- smt_xor_differential_propagation_constraints(model)¶
- smt_xor_linear_mask_propagation_constraints(model=None)¶
Return a variable list and SMT-LIB list asserts for MIX COLUMN in SMT XOR LINEAR model.
INPUT:
model– model object (default: None); a model instance
EXAMPLES:
sage: from claasp.ciphers.block_ciphers.midori_block_cipher import MidoriBlockCipher sage: midori = MidoriBlockCipher(number_of_rounds=3) sage: mix_column_component = midori.component_from(0, 23) sage: mix_column_component.smt_xor_linear_mask_propagation_constraints() (['mix_column_0_23_0_i', 'mix_column_0_23_1_i', ... 'mix_column_0_23_14_o', 'mix_column_0_23_15_o'], ['(assert (= mix_column_0_23_0_i dummy_0_mix_column_0_23_4_o dummy_0_mix_column_0_23_8_o dummy_0_mix_column_0_23_12_o))', '(assert (= mix_column_0_23_1_i dummy_1_mix_column_0_23_5_o dummy_1_mix_column_0_23_9_o dummy_1_mix_column_0_23_13_o))', ... '(assert (= mix_column_0_23_14_o (xor dummy_2_mix_column_0_23_14_o dummy_6_mix_column_0_23_14_o dummy_10_mix_column_0_23_14_o)))', '(assert (= mix_column_0_23_15_o (xor dummy_3_mix_column_0_23_15_o dummy_7_mix_column_0_23_15_o dummy_11_mix_column_0_23_15_o)))'])
- property suffixes¶
- property type¶