sboxUv2.ccz.affine_equivalence package
This module contains tools to study affine equivalence (and its particular case, linear equivalence).
Submodules
sboxUv2.ccz.affine_equivalence.cython_functions module
- sboxUv2.ccz.affine_equivalence.cython_functions.affine_equivalence(f, g)
- sboxUv2.ccz.affine_equivalence.cython_functions.affine_equivalence_permutations(f, g)
Returns, if it exists, the tuple A, a, B, b where A and B are matrices and where a and b are integers such that, for all x:
f(x) = (B o g o A)(x + a) + b,
where “o” denotes functional composition and “+” denotes XOR. If no such affine permutations exist, returns an empty list.
Internally calls a function written in C++ for speed which returns the “Linear Representative” using an algorithm from [EC:BDCBP03].
- sboxUv2.ccz.affine_equivalence.cython_functions.le_class_representative(s)
Computes the smallest member of the linear-equivalence class of the S_boxable object s.
It is assumed that s corresponds to a permutation since this function relies on the algorithm presented in [EC:BDCBP03]. A dedicated implementation for the case where s.get_input_length() is at most 8 enables a very computation in this case. Otherwise, defaults to a much slower implementation.
- Parameters:
s (-) – an S_boxable object.
- Returns:
An S_box instance corresponding to the smallest function in the linear equivalence class of s, where “smallest” is in the sense of the lexicographic order.
- sboxUv2.ccz.affine_equivalence.cython_functions.linear_equivalence(f, g, all_mappings=False)
- sboxUv2.ccz.affine_equivalence.cython_functions.linear_equivalence_permutations(f, g, all_mappings=False)
Returns, if it exists, the tuple A, a, B, b where A and B are matrices such that, for all x:
f = B o g o A
where “o” denotes functional composition. If no such linear permutations exist, returns an empty list.
The algorithm used is specified in [EC:BDCBP03].