Linearly equivalent S-boxes and the division property

Division property is a cryptanalysis method that proves to be very efficient on block ciphers. Computer-aided techniques such as MILP have been widely and successfully used to study various cryptanalysis techniques, and it especially led to many new results for the division property. Nonetheless, we claim that the previous techniques do not consider the full search space. We show that even if the previous techniques fail to find a distinguisher based on the division property over a given function, we can potentially find a relevant distinguisher over a linearly equivalent function. We show that the representation of the block cipher heavily influences the propagation of the division property, and exploiting this, we give an algorithm to efficiently search for such linear mappings. As a result, we exhibit a new distinguisher over 10 rounds of RECTANGLE, while the previous best was over 9 rounds, and rule out such a distinguisher over more than 9 rounds of PRESENT. We also give some insight about the construction of an S-box to strengthen a block cipher against our technique. We prove that using an S-box satisfying a certain criterion is optimal in term of resistance against classical division property. Accordingly, we exhibit stronger variants of RECTANGLE and PRESENT, improving the resistance against division property based distinguishers by 2 rounds.


Introduction
Division property is a distinguishing property which was first presented by Todo at Eurocrypt '15 [15].This cryptanalysis technique quickly became a hot topic in the community, especially since it led to the first theoretical attack against full MISTY1 [14].This property can be seen as a generalization of integral and higher-order differential distinguishers.At Crypto'16, Boura et al. [4] provided a simpler formulation of the division property, especially for the construction of the division trails of S-boxes.Recently, division property was used to improve cube attacks and allowed to improve the best known results against several stream ciphers including ACORN, Trivium, Grain-128a and Kreyvium [17].The idea of the division property is the same as in integral, higher-order differential and cube-attacks, namely, proving that if one encrypts a set of plaintexts with a certain structure, then the resulting set of ciphertexts will have some balanced bits, i.e. bits which sum to zero with probability 1 when going through the whole set of ciphertexts.The main difference between these different techniques comes from how one can prove this property.Division property is a more fine-grained property: it mainly comes down to tracking which monomials may or may not appear in the Algebraic Normal Form (ANF) of the whole block cipher, so that, for a set of ciphertexts X, we can predict with probability 1 the result of x∈X x k , where k represents the indicator vector defining the value of the monomial x k = i x k i i .The distinguisher begins by generating a set of plaintexts where c bits are fixed to an arbitrary constant, resulting in n − c variables which then take all possible values (thus generating an affine space of dimension n − c).We want to know whether a monomial of degree n − c, i.e. implying all variables, exists in each coordinate of the ANF of the block cipher.If no such monomials appear in the i-th coordinate, this coordinate is of degree < n − c.Consequently, when we sum the i-th bit through the whole corresponding set of ciphertexts, the sum will be zero, as we compute the sum of a function of degree < n − c over a space of dimension n − c.Essentially, the division property defines a set K ⊂ F n 2 of monomials which divides F n 2 into two parts.For one part K = {k|∃ k ∈ K s.t.k k}, for the usual preceding order, we cannot predict the result of this sum.However, for any k ∈ F n 2 \ K, we know that x∈X x k = 0, i.e. we track which monomials we know to be summing to zero.Automatic tools Studying the propagation of an initial division property through a block cipher is a challenging task requiring to be computer-aided.At Asiacrypt'16, Xiang et al. [18] showed how to model the division property propagation of the three basic operations copy, AND and XOR, as well as the propagation through an S-box, by a system of linear inequalities.Hence they built MILP models for several block ciphers which they efficiently solved using a third-party MILP solver.As a result they obtained the best known division property distinguishers on SIMON, SIMECK, PRESENT and RECTANGLE.In [20], Zhang et al. gave a new way to model the propagation of division property through linear diffusion layers by the smallest amount of inequalities which are generated from linear combinations of row vectors of the diffusion matrix.Using this new description, they found the best known distinguishers for both PRINCE and MIDORI.Finally, at Asiacrypt'17, Sun et al. [12] presented two new automatic search tools: one dedicated to ARX ciphers based on a SAT solver and one dedicated to word-based division property based on SMT (Satisfiability Modulo Theories) solver.Those tools are much faster than previous MILP-based works and were able to study primitives with large internal state such as CLEFIA, WHIRLPOOL and RIJNDAEL.

Our contributions
In this paper we show that the search space considered by previous automatic search tools dedicated to division property is incomplete as they do not exhaust all the search space.More precisely, propagating an initial division property through a block cipher requires decomposing the block cipher into small components such as AND, XOR, S-boxes, . . .for which we can compute division property propagation.However, contrary to differential and linear cryptanalysis, the result highly depends on how the block cipher is represented.Indeed, linearly equivalent Sboxes do not change the propagation of differentials, while it is not the case for the division property.For instance, in Sect.3.1 we give two S-boxes S 1 and S 2 such that S 2 = S 1 • L, where L is linear, such that propagating division property through L then S 1 leads to a completely different result than propagating it directly through S 2 .Hence, given an S-box based block cipher, it is not clear which representation should be preferred since replacing any internal S-box with a linearly equivalent one could possibly lead to a different result.The main issue is that the number of distinguishers is significantly higher than one can be thinking and looking efficiently for the best distinguisher boils down to efficiently finding the best decomposition.
In this paper we solved a sub-case of this problem.Mounting an attack against a block cipher E most often requires to split E in three parts as E = E 2 • E 1 • E 0 and to find a distinguisher on E 1 .Usually, E 0 , E 1 and E 2 are round-reduced versions of E. However it is not the only way to split E and, for any linear operations L in and L out , E can be split as: This kind of carving was for instance used in [6] by Derbez et al. to provide several new meet-in-the-middle attacks against AES.However, the division property is different from differential and linear cryptanalysis.Hence, one of the main problems we solved in this paper is to answer the question of how to find L in and L out such that there exists a division property distinguisher through L out • E 1 • L in .We focused on linear mappings L in , L out which are block diagonal, of block size m, where m is the size of the S-box.In a nutshell, we first show how to highly reduce the number of candidates for both L in and L out , and then present how to efficiently check the remaining candidates without performing a complete search on each of them.We severely reduce the complexity of the search.Indeed, to search for a distinguisher over r rounds, a naive algorithm would need about ms 3 2 2m 2 (where s in the number of S-boxes) calls to the MILP solver with a model representing r rounds of the block-cipher.However in our case, we only need about s 2 2 2m calls to the solver, on a model representing r − 2 rounds which is thus much more efficient to solve.As a result we improve the best known division property distinguisher against RECTANGLE by one round and show that the previous best known distinguisher against PRESENT cannot be improved with this technique.We emphasize that this is an advantage of our algorithm, as it allows us to prove that a given cipher is resistant to our technique, as proving negative results is in general harder than findings attacks since we have to check all such attacks.The second result presented in this paper concerns the design of S-boxes that would offer maximal resistance against division property.In [4], Boura et al. provide new insights into the division property, presenting a new approach to it.In particular they show several interesting results concerning the resistance of S-box-based block ciphers against division property.Here we prove that if an S-box satisfies a specific criterion (which is close to the one in [4]), then this S-box is optimal in term of resistance against classical division property (i.e.without our extension technique).We define optimality in the sense that if one uses such a perfect S-box and can find a distinguisher on at most r rounds, then using any other S-box will lead to a distinguisher on r rounds with r ≤ r .To our knowledge, this is the first time that such a result is given for division property, and could be considered as a new criterion for designing S-boxes.Our criterion is the following : if each coordinate of the ANF of an n-bit S-box contains all monomials of degree n − 1, then this S-box is optimal.Note that our criterion is equivalent to a very specific structure for the division property propagation table, and this table is a major component in the existing search algorithms [18,20].Compared to the criterion in [4], we have two major differences.The first is that any S-box satisfying our criterion does not satisfy the one in [4].Indeed, their criterion is that any non-trivial linear combination of the coordinates of the ANF must be of degree n − 1.In our case, since all monomials of degree n − 1 appear in each coordinate, the sum of any two coordinates will be of degree n − 2. Nonetheless, the second difference is that our criterion leads to an optimality proof, whereas their criterion is more of an indication that an S-box satisfying it should be good enough.
According to this criterion on S-boxes, we try to strengthen both RECTANGLE and PRESENT against our technique.Note that when considering our technique, the criterion mentioned above does not seem to guarantee optimality.However, in regards to our experiments, it still seems to be the best choice.Indeed, to preserve some differential and linear property of the original S-boxes, we chose to only consider S-boxes which are linearly equivalent to the original ones.Unfortunately, for both RECTANGLE and PRESENT, it was not possible to generate a perfect S-box from linearly equivalent S-boxes, however, we found many almost perfect S-boxes.Trying all of them allowed us to find a linearly equivalent S-box for RECTANGLE such that the best distinguisher is over 7 rounds for classical division property, and 8 rounds when using our technique, while the best distinguisher we found with our technique is over 10 rounds of RECTANGLE when using the original S-box.Doing the same for PRESENT, we found an S-box such that the classical division property could only lead to a distinguisher on up to 6 rounds, and up to 7 rounds with our technique, while the best know division property based distinguisher for PRESENT is over 9 rounds.Furthermore, on non-table-based implementations, the extra cost of the new S-boxes is only 2 extra XORs per S-box for PRESENT and 5 extra XORs per S-box for RECTANGLE.These experiments show that our new search process finds distinguishers against one extra round than classical search, highlighting again its interest, and also confirms that our strategy to choose these new S-boxes seems promising, as it improves the resistance of both algorithms by 2 rounds.We made our implementation available at https://github.com/ExtendDivProp/ExtendDivProp.

Notations
We will use the following notations in the paper.We denote x = (x 0 , . . ., x n−1 ) ∈ F n 2 an n-bit vector over F 2 , where x 0 is the least significant bit.We will often write x 0 x 1 . . .x n−1 instead of (x 0 , . . ., x n−1 ).We denote w(x) the hamming weight of x ∈ F n 2 .We denote e i the i-th unit vector, and E m denotes the set of all unit vectors of size m, i.e. vectors of hamming weight 1.For x, u ∈ F n 2 , we denote by x u the bit product For x, y ∈ F n 2 , we define x y if x i ≥ y i for all i, where x i and y i are considered as integers.We denote P m the set of all permutations over m elements.We denote G L m (F 2 ) the set of all invertible matrices of size m × m over F 2 .

Division property and division trails
The division property was introduced by Todo [15] as a generalization of integral cryptanalysis, and later at FSE'16 [16], Todo and Morii defined a more refined version of it, called bit-based division property.Here, we only consider the bit-based division property, and will often refer to it directly as division property.As it is not relevant for this paper, we refer the reader to the original articles for further details about the differences.
Definition 1 (Bit-based division property [16]) A set X ⊂ F n 2 has the division property D n K , where K ⊂ F n 2 is a set, if for all u ∈ F n 2 , we have Note that if there are some vectors k, k ∈ K such that k k , then k can be removed from K because it is redundant.
A common way to study division property for a block cipher is to study the division trails of this cipher, which show the propagation of the division property through the basic operations composing the block cipher.
Definition 2 (Division trails [18]) Let f denote the round function of an iterated block cipher.Assume the input set to the block cipher has initial division property D n {k} , and denote the division property after propagating through i rounds of the block cipher (i.e.i applications of f ) by D n K i .Thus, we have the following chain of division property propagations : Moreover, for any vector k i in K i (i ≥ 1), there must exist a vector k i−1 in K i−1 such that k i−1 can propagate to k i by the division property propagation rules.Furthermore, for can propagate to k i for all i ∈ {1, 2, . . ., r }, we call (k 0 , k 1 , . . ., k r ) an r -round division trail.
In the rest of the paper, we will denote k f → k if the vector k ∈ F n 2 can propagate to a vector k ∈ F n 2 through the function f .In the same way, k f → K denotes that for all k ∈ K, we have k f → k .Given the set K r resulting of the propagation of an initial division property D n {k} , we can find whether D n {k} allows to build an integral distinguisher using the following proposition.We recall that a given set X ⊂ F n 2 has an integral property if there exists 0 ∈ K, as it would otherwise mean that the ith bit is in an unknown state, which contradicts the fact that the i-bit is balanced.
For example, we can make a parallel with the well known Square attack on AES [5].In this attack, the set of plaintexts has one byte taking all possible values while the others are constant.In term of division property, this would translate to the set of plaintexts having a division property D 128 k , where k = 11111111 8 bits 0 . . .0.
Then, it is shown in [5] that after 3 rounds of AES, such a set of plaintexts has all its bits balanced.According to Proposition 1, this means that the resulting set has a division property D 128 K , where K does not contain any unit vector.
Hence, to study whether we can build an integral distinguisher over a block cipher from a given initial division property K 0 , we need to propagate K 0 through the different operations of the block cipher.Fortunately, propagation rules were defined in [16] for most basic operations in a block cipher, namely Copy, AND and XOR.However, for SPN block ciphers, there are two main components that, while they can be described using only these operations, should have their own way to propagate the division property vectors.These components are linear layers and S-boxes.For linear layers, while [11] proposed to use only the Copy and XOR operations to propagate division property vectors, it has been shown in [20] that this is actually not the right way to propagate through linear layers, as it looses some information and is not able to recover all possible integral distinguishers.We thus refer the reader to [20] for the correct way to propagate division property vectors through a given linear layer.
For S-boxes, again using only the basic operations might result in a loss of information.Hence, [18] proposed an algorithm of complexity O 2 2m to compute all possible pairs k S → k for a given m-bit S-box S.

Searching for division property based integral distinguishers
While Todo and Morii proposed a way to search for integral distinguishers based on the division property [16], its complexity is quite hard to estimate, and the authors gave an upper bound of 2 n , where n is the block size of the block cipher.In practice, they said that their algorithm is not suitable for block ciphers with block size over 32 bits, and thus especially for standard block size of 64 and 128 bits.However, a lot of work has been done towards efficiently searching such distinguishers, based on either MILP [10,18,20] or SAT/SMT solvers [7,12].We refer the reader to these papers for further details about the modeling, and will only give a brief description of the idea behind it for MILP.Note that using SAT/SMT solvers is very similar to using MILP, and mostly differs in efficiency when considering different primitives.For example searching division property based integral distinguishers on ARX ciphers seems to be easier with SAT solvers.First we briefly recall what is MILP.

Definition 3 An MILP problem is formulated as follows. Given a matrix
Here, f is called the objective function of the MILP problem.

Modelizing division property propagation with MILP
The idea of using MILP to search for integral distinguishers is first to modelize the set of all possible division trails by an MILP problem.That is, building a set of linear inequalities such that [18]: 1. each division trail must satisfy all linear inequalities in the linear equality system, i.e. each division trail corresponds to a feasible solution of the linear inequality system; 2. each feasible solution of the linear inequality system corresponds to a division trail, i.e. the set of all feasible solutions of the linear inequality system does not contain any impossible division trail.
We can thus build an MILP model satisfying the previous conditions using [18] for basic operations and S-boxes, [20] for linear layers and [10] for ARX block ciphers.Note that this step is not totally free.
For S-boxes, we first compute the set of all possible propagations through a given m-bit S-box, which has complexity O 2 2m .Then, we need to compute a set of linear inequalities which represents these possible propagations, according to the two previous rules.To do so, [18] proposed to first use the function inequality_generator() from the Sagemath [13] software to get such a set of inequalities, and then use a greedy algorithm to reduce their number.While this works for small S-boxes (e.g.4-bit S-boxes), this approach fails when considering bigger S-boxes (e.g.8-bit S-boxes) as the complexity of generating the initial set of inequalities is too high.However, Abdelkhalek et al. showed a new method in [1] to tackle this problem, and thus proposed a way to modelize 8-bit S-boxes in MILP.Note that while this allows us to modelize 8-bit S-boxes, it often leads to a lot of inequalities, thus the resulting model can be quite huge and this can result in a high solving time.
For linear layers, Zhang et al. [20] showed that the previous method [11] proposed to modelize linear layers does not actually fulfill the above rules, as it introduces some impossible propagations, resulting in some integral distinguishers being omitted.Hence, they proposed a new way to modelize such layers, and proved that their way was optimal, i.e. removing any one inequality will result in some fraudulent propagations.To modelize a given linear layer L, the number of inequalities generated is given by n(2 s − 1), where s is the size of the smallest square matrix M such that M is the representation of L over the field F 2 n and M is binary.For example, the matrix used in SKINNY64 [2] is a binary matrix of size 4 over F 2 4 , thus needs 4(2 4 − 1) = 60 inequalities.However, if we take the matrix used in AES, which is described as a non-binary matrix of size 4 over F 2 8 , the amount of inequalities is much higher.Indeed, since the multiplication over F 2 8 corresponds to a linear operation over F 8  2 , the matrix used in AES can be represented as a matrix of size 32 over F 2 , which is obviously binary.This is the smallest way to represent this operation with a binary matrix, and thus, it would need 2 32 − 1 inequalities to modelize only one propagation through this linear layer, which would result in a very huge model which cannot be solved in practical time.Hence, not all linear layers can be modelized in an exact way, and complex linear layers may lead to a model which is much harder to solve.Note however that if the linear layer is only a permutation, such as in PRESENT [3] or RECTANGLE [19], then the above formula does not apply, as we can just reorder the different variables, and thus we can always modelize such kind of linear layers.

Searching for a distinguisher
As a result of the previous section, when modelizing an n-bit block cipher over r rounds, we have a set of variables {k for a given solution of the MILP problem, the corresponding values of these variables give a division trail (k 0 , k 1 , . . ., k r ) with k i = (k i 0 , . . ., k i n−1 ).In particular, this allows us to see whether each unit vector belongs to K r .Indeed, once we have the MILP model for r rounds of a given block cipher, we can set the objective function to Then we set the initial division property using equality constraints, i.e. if the initial division property is a ∈ F n 2 , we add the constraints ∀i ∈ {0, . . ., n − 1}, and then ask the solver (e.g.Gurobi [8]) to solve this problem by minimizing the value of the objective function.If the solver finds a solution of value 1, there is a vector k r of weight 1 (i.e. a unit vector) that belongs to K r .We can then add a linear constraint to remove this vector k r from the set of solutions, and solve the problem again.Once there are no more solutions of value 1, we found all unit vectors belonging to K r , hence we can easily see whether or not there are some balanced bits using Proposition 1.Note that we do not need to stop after finding all solutions of value 1.Indeed, we can keep going until the problem does not have any remaining solutions, and we will thus have computed the whole K r set.This will be useful later in the paper, and will be accompanied with a bit more details.
3 Extended division property using linear mappings

First observations
Several integral distinguishers were found using the previously described method.However, we claim that this method does not actually search through the whole space of all possible integral distinguishers based on the division property.Indeed, we show that for a given block cipher E, we can instead consider L out • E •L in , where both L out and L in are linear mappings, and this results in integral distinguishers previously unknown.We now explain the main idea behind using L out and L in .For L out , while all bits could be unbalanced after E, it might occur however that a linear combination of some bits is balanced.This was already mentioned by Todo and Morii in [16] when they introduced the division property using three subsets.
For L in , the idea is very close.The initial division property k 0 basically sets some constant bits.That is, if the set X has division property D n k 0 , through all the set, each bit i such that k 0 i = 0 has a constant value, and if k 0 i = 1, the bit i takes all possible values through the set.For example, the following set has division property D 4 0011 X = {0100, 0101, 0110, 0111}.
Hence, the idea behind L in is to get a set such that a linear combination of some bits is constant, while those bits are not necessarily constant.
Finally, we can see that considering L out • E • L in instead of E is still meaningful.Classically, when an attacker uses a distinguisher to mount an attack, he basically splits the cipher where he has a distinguisher over E 1 .In that case, E 1 can be seen as a reduced version of E, containing only a certain number of rounds of E. However, we could also rewrite E as In that case, the attacker would search a distinguisher over L out • E 1 • L in , and could still use it to mount an attack.Indeed, the attacker starts with a set X respecting a given initial division property (according to the distinguisher over by guessing part of the key.He then asks for the encryption of X through E to get a set of ciphertexts Y, compute Y = L out • E −1 2 (Y) using some other key guesses and check whether Y has some balanced bits (according to the distinguisher over If that is the case, the key guesses are supposed to be correct.Note that this idea was already successfully used in the past, for example in [6].
So considering E = L out • E • L in instead of E could lead to some new integral distinguishers.In the following, E is an SPN block cipher, i.e. the round function of E is f = L•S, where L is linear and S is the parallel application of an S-box S over the state.Note that we omit L in the last round.Now our goal is to search if E has an integral distinguisher based on the division property using MILP.Classically, we study the following propagation chain K 0 Basically, we model independently the propagation through the linear layers and the S-box layers, especially for L in and the first S-box layer, and for L out and the last S-box layer.However, this might actually not be the best way to modelize this, and we see this through an example.

Merging linear mappings and S-boxes
Let S 1 and S 2 be two S-boxes over F where S 2 is obtained as We can use the algorithm from [18] to compute all possible propagations through S 1 , S 2 and L. Using this, if we look at the propagation of x = 0111 through L and S 1 independently, we have the following trail 0111 However, if we now consider L and S 1 together, i.e. by looking at the propagation of 0111 through S 2 = S 1 • L, then we have the trail 0111 As we can see, the resulting division property set is completely different, yet comes from the same initial division property, and goes through the same function.Moreover, this is not just a local change, and not only K is a set which was not reachable through only S 1 , but the whole propagation tables of S 1 and S 2 are different, as we can see in Fig. 1.This clearly shows that considering both the S-box and the linear mapping together gives way more information about the propagation of the division property.Note that we give this example by putting a linear mapping at the input of the S-box, but similar observations can be made when considering S and L • S for some S-box S and linear mapping L.Moreover, not only this gives more information about the propagation, but this could, and will, actually help us to find new distinguishers when considering We can see that, except when we have either the full zero or the full one vector, if we consider a division property chain K 0 → • • • → K r of a block cipher, the weight of the vectors in each K i can only decrease (or remain constant, but in practice, this is rarely the case, see Fig. 1).Recall that if the set K r contains all unit vectors (i.e. of weight 1), no integral distinguisher can be built from it.Thus, intuitively, if we want to find an integral distinguisher, we would like to have vectors of relatively high weight in each set K i as long as possible.
Now consider a block cipher E such that the first layer of S-boxes contains only S 1 as defined previously.Then from the propagation table in Fig. 1, we can see that the output of each S-box will always be of weight 1 (except for 0000 and 1111).So after the first round, if the weight at the input of any S-box is different from 0 and 4, we will already only have vectors of weight 1 at the output of the S-box.However, if we now consider E • M, where M = (M, . . ., M) apply the linear mapping M on all S-box's input before the first round, then this is the same as considering the first layer of S-boxes to be built as (S 2 , . . ., S 2 ).This time, if one carefully chooses the input division property of the S-box, he can now only have vectors of weight 2, which could result in a better propagation through the remaining layers of the cipher.
Clearly, considering L out • E • L in instead of E, and considering the propagation of the division property vectors through M • S (or S • M) as a whole instead of independently through M and S, could result in better distinguishers, and thus in the next section, we focus on the search of such distinguishers.

Searching for extended division property
In this paper, we will only consider SPN block ciphers, i.e. the round function is f = L • S, where L is linear and S is built as the concatenation of s S-boxes of size m applied in parallel on the state, hence the block cipher has block size n = s • m.Moreover, we will consider that all S-boxes are the same.This is to get an easier analysis, but we can extend this with different S-boxes.

Reducing the search space of L in and L out .
Given a block cipher E which does not have any integral distinguisher based on the division property, we want to find two linear mappings L in and L out such that L out • E • L in has an integral distinguisher based on the division property which is supported by the previous observations.Moreover, we also would like to exploit the fact that we have a more precise propagation when considering the propagation of division property vectors through S • M as a single function, instead of independently through M then S. Note that, theoretically, we could consider the whole round function of the block cipher as a single function (or even the whole block cipher), and thus get more precise information about the propagation of division property vectors.However, computing the propagation table of division vectors needs O(2 2n ) operations, where n is the size of the function.Hence for classical block ciphers with 64 or 128 bits block size, this is clearly impractical.
This also means that we cannot choose any L in and L out , as we want to somehow merge L in with the first S-box layer and, respectively, merge L out with the last S-box layer.Hence, we will focus our search on linear maps L in and L out which are block diagonal, of block size m.Consequently we want to put an invertible linear map L i in (resp.L i out ) before (resp.after) each S-box of the first (resp.last) round.By doing so, we will denote by S i in = S • L i in and S i out = L i out • S the modified S-boxes.First, we give the following proposition to show that we do not need to consider every possible choice for each block L i in and L i out .Proof This directly comes from the fact that S 1 is obtained by just permuting the input variables of S, and respectively S 2 is obtained by permuting the output bits of S.

Proposition 2 Let S be an invertible m-bit S-box and P an m-bit permutation. Let S
Hence, if we search an integral distinguisher for any given block L i in , we do not need to do the search for all L i in • P where P goes through all possible permutations, as we could obtain the same result from the search using L i in by just permuting the initial division property with P. For example, if we have the set K r from a given initial division property k through L out • E • L in , and we consider L out • E • L in where L in = L in • (P 0 in , . . ., P s−1 in ) and L out = (P 0 out , . . ., P s−1 out ) • L out , where each P i in and P i out is a permutation over m bits, we directly have that the initial division property (P 0 in , . . ., P s−1 in ) −1 (k) propagates to the set (P 0 out , . . ., P s−1 out )(K r ).In particular, if we have an integral distinguisher for This allows us to restrict the search space for each block L i in to a set L in containing a representative of each equivalence class and in the same way, to restrict the search space of each L i out to a set L out containing a representative of each equivalence class The size of these spaces L in and L out can be obtained by as it is the total number of invertible matrices of size m divided by the number of permutations over m elements.Note that this is much lower than the total number of matrices of size m × m over F 2 which is 2 m 2 , and for example if m = 4, then there are only 840 matrices to consider.

Reducing the amount of work for L in
Let us focus on finding a distinguisher over E • L in .We will see later that we can use the idea of this section together with the next section to search for a distinguisher over Note that our goal is to exhibit a distinguisher on E • L in , not necessarily the best one.As such, we focus on finding a distinguisher requiring 2 n−1 data, i.e. the initial division property will be K 0 = k 0 with w(k 0 ) = n − 1.By doing so, we focus our search on only one modified S-box S i in and set the others to S. Indeed, if w(k 0 ) = n − 1, there is only one specific S-box S i in which has an input of weight m − 1, while all the others S-boxes S j in with j = i have 1 . . . 1 has input.Note that if a set X has division property k = 1 . . . 1, all bits takes all possibles values through the set, i.e.X = F m 2 .Hence, since we are considering bijective S-boxes, we have S j in (X) = F m 2 for all j = i, and thus the resulting division property set is K = {1 . . .1}.
From the previous remark, we only need to look at each matrix from L in .However, we can reduce even further the amount of propagation we need to compute.Since the input of the S-box S i in is k 0 i with w(k 0 i ) = m − 1, we know that this can only result in at most 2 m − 2 possible vectors (by excluding the full-zero and full-one vectors) after the application of S i in .Thus, to search for a distinguisher over E = E • L in with E containing r rounds with round function f = L • S, we first decompose E as

This leads to the following chain of division property propagation
where We first define the set K S in as Computing K S in allows to build all possible K 0 since there exists a set K ∈ K S in such that every vector k0 of K 0 is of the form Hence, instead of trying all possible L i in ∈ L in , we skip the first propagation through S in and directly consider that the propagation starts at K 0 .
We now need to test each set in K S in .Recall that K 0 can only be built from 2 m − 2 vectors k0 . We propagate each of those vectors through the remaining layers of the cipher, i.e. the following chain of propagation Thus, for each k0 , we deduce a set S k0 of balanced bits using MILP.We then consider each set K 0 ∈ K S in , and compute If there is one non-empty S K 0 , K 0 will lead to a set of balanced bits, given by S K 0 .Finally, using a precomputed table T S in defined as we deduce a linear map L i in ∈ L in and a vector k 0 such that we get an integral distinguisher over E • L in starting from the initial division property k 0 .
In summary, we first propagate each of the 2 m − 2 vectors through f Then, for each set K 0 ∈ K S , we check if each vector of K 0 lead to the same balanced bits through If so, then using T S in we can easily deduce a linear map L in and an initial division property which results in an integral distinguisher.

Reducing the amount of work for L out
Again, we first only consider L out • E, and will see in the next part how to combine this with the previous section to get a distinguisher over L out • E • L in .For L out , if we search naively, we need to try each possible matrix from L out .However, this is actually not necessary.Indeed, recall that there is an integral distinguisher if and only if the last division property set K r does not contain all unit vectors, and thus we only need to check if each unit vector belongs to K r .Now consider a division property vector k which is sent to such a unit vector e i through the last (modified) S-box layer.That is, we have k S out −→ e i where S out = (S 0 out , . . ., S s−1 out ).In that case, all S-boxes except one have an output division property vector equal to 0 . . .0. Again, since we are using bijective S-boxes, this means that the output set is constant, and thus the input set is also constant, leading to a corresponding input vector 0 . . .0. Hence, k will be of the form where k is a non-zero vector of F m 2 .Consequently, we first compute, for each L out ∈ L out , all possible sets K such that K S out −→ K , with S out = L out • S and K does not contain all unit vectors over m bits.According to those notations, denote by K S out the set We can write the division property propagation chain However, we do not know which L out to use, and thus cannot propagate through S out .But instead, we compute a subset K of K r −1 such that for every vector k of K, the non-zeros elements of k all belong to a single S-box block, i.e. k is of the form −→ e where e is a unit vector, then we must have k ∈ K. Now from K, build the following sets for each i ∈ {0, . . ., s − 1} These sets K r −1 i allow us to see if we can get a distinguisher.Indeed, if for at least one i ∈ {0, . . ., s − 1} we have K r −1 i ∈ K S out , then we can get a distinguisher over L out • E.Then, using a precomputed table T S out defined as we know that there exists a linear map ] and a unit vector e ∈ F m 2 such that K r −1 i S i out −→ K where e / ∈ K .Hence, the unit vector 0 . . .0|e|0 . . .0 ∈ F n 2 will not belong to K r , which means that we have at least one balanced bit.In summary, to search for each block L i out , we just need to compute all sets K r −1 i and check if at least one of them belongs to K S out .If so, we can deduce from T S out which block L i out to use such that this results in an integral distinguisher.

Putting everything together
We can now combine the two previous sections to search for a distinguisher over L out •E •L in .The overall idea is given in Fig. 2. We first write and get the following propagation chain where w(k 0 ) = n − 1.According to the two previous sections, we first start by computing where there are r − 2 applications of f .We denote by K j k0 i these sets to tie them with k0 i .Next for each set K 0 ∈ K S in , we compute the following union for each j ∈ {0, . . ., s − 1} : Now if at least one K j K 0 belongs to K S out , then we can get a distinguisher.Indeed, K j K 0 is the set of division property vectors that can lead to a unit vectors after the application of S j out .Thus by definition of K S out , if K j K 0 ∈ K S out we know that at least one unit vector will not appear after the application of S j out , i.e.K r does not contains all unit vectors.We then put any map from T S out [K j K 0 ] after the j-th S-box in the last layer, and any map from T S in [ K 0 ] before the i-th S-box in the first layer, which thus gives us our new distinguisher.Note that we can easily see that Indeed, a linear mapping lead to at least one balanced bit from K 0 if and only if it lead to at least one balanced bit from each k0 i ∈ K 0 .This will be used later on to even further reduce the work needed with an early-abort strategy.The whole procedure is summarized in Algorithm 1. Complexity Overall, the number of calls to the MILP solver can be upper bounded as follow.can contain at most 2 m vectors, and getting one vector of any of these sets cost one call to the MILP solver.Since there are s of those sets, we need s2 m calls to the MILP solver.Note however that in practice, this is much lower, as we do not need to recover the redundant vectors.This means that for example, the sets {0001, 0011} and {0001} are considered to be equivalent, as 0011 is redundant in the first set and thus can be removed.If we go through all sets with m = 4, the maximum size of any set K j k0 i is 6, and there are only 167 possible sets (compared to, in theory, a maximum size of 16, and 2 16 possible sets).In total, we need at most s 2 (2 m − 2)2 m calls to the MILP solver for a model over r − 2 rounds, and the factor 2 m is actually much lower in practice.
This can be compared to the complexity of a naive algorithm.In such an algorithm, one would need to try every possible invertible matrix for each S-box at the first round, so about s2 m 2 cases (a bit less as there are less than 2 m 2 invertible matrices).For each of those case, we need to try again every possible matrix for each S-box at the last round, so this add another factor s2 m 2 .This generate s 2 2 2m 2 models, and then for each of those, we need to check if there is a distinguisher.At most, it costs n = sm calls to the MILP solver, as one call can retrieve one vector of weight 1, and there are n of them.So in total, a naive algorithm would need about ms 3 2 2m 2 calls to the MILP solver, and each model is over r rounds which is much more expensive to solve.Moreover for our technique, if we go through each of the 2 m − 2 vectors k0 i in a clever way, we can often reduce further the number of calls to the MILP solver.Indeed, if we first go through all vectors of weight m − 1 and compute all corresponding K j k0 i , we are left with two cases : for all vectors k0 i of weight m −1 are empty, and thus we do not need to go further.Indeed, this means that no linear mapping lead to at least one balanced bit from any initial vector of weight m − 1.Moreover, for any vector k such that w(k) < m − 1, we know that there is a vector k0 i of weight m − 1 such that k0 i k.Hence, since there is no balanced bit from all vectors k0 i of weight m − 1, then we cannot have any balanced bit from any vector of weight strictly lower than m − 1 (see [12,Proposition 2]).
• Otherwise, we first check if there is any set K 0 ∈ K in built only from vectors of weight m − 1.If so, we apply Algorithm 1 from line 11 to line 22 to check if we can find a distinguisher.If no distinguisher exists, or if none of the set of K in are built only from vectors of weight m − 1, then we go through all vectors of weight m − 2 and do the same procedure and so on.
We can even go further by looking at all the possible transitions k S i in −→ K with w(k) = m − 1 when we go through all linear mappings in L in .Suppose that the two following transitions are possible (and possibly with different linear mappings), k Indeed, in that case, if S i in would lead to a distinguisher, then so would S i in .Such a transition k S i in −→ K is thus redundant and does not need be examined.We can thus build all possible transitions k S i in −→ K which are not redundant.If there is a vector k which never belongs to K among all such non-redundant transitions, we never have to examine the propagation of this vector.This essentially reduces even further the space of all the vectors k0 i we need to consider.In practice, this allows to significantly reduce the time required to find a distinguisher, or even prove that no such distinguisher exists, and this will be detailed in the next section.

Division property against 10-round RECTANGLE
RECTANGLE [19] is a lightweight block cipher designed for fast implementation using bitslice techniques.It is a 64-bit block cipher, using 4-bit S-boxes and a permutation as the linear layer.There are 80-bit and 128-bit key sizes, and the total number of rounds in 25 in both cases.The best known division property based integral distinguisher is from [18] over 9 rounds, using 2 60 data and resulting in 16 balanced bits.By applying the previous algorithm, we were able to find a distinguisher over 10 rounds, using 2 63 data and resulting in 1 balanced bit.The distinguisher is built on L out • E • L in , where the block 0 of L in is and L out is the identity.This results in the following distinguisher, where c denotes a constant bit, a denotes a bit taking all possible values through the set, b denotes a balanced bit and ?denotes a bit in an unknown state.
Overall, the time needed to compute all K j k0 i for a given k0 i is about 400 seconds in average.The reason this distinguisher exists is that when considering S = S • L 0 in where S is the S-box of RECTANGLE, the transition 1101 S −→ {0101, 1110} is now possible, while the set {0101, 1110} was not reachable from the original S-box S. Note that this distinguisher does not depend on the key size, and thus is applicable to both the 80-bit and the 128-bit key variants.

Strengthening RECTANGLE
According to our observations in Sect.3.1, it is natural to think that the resistance of an Sbox-based cipher against division property is highly related to the number of weight 1 vectors in the division property propagation table of the S-box.As such we study how the choice of the S-box affects the resistance of RECTANGLE against division property.We first give some generic insights about the design of an S-box to resist classical division property (i.e.without using our extension technique).Before going further, let us recall how the division property propagation table is built.Proposition 3 ([18]) Let S be an n-bit S-box with y = (y 0 , . . ., y n−1 ) the ANF of S , where each y i is a polynomial in the input variables x = (x 0 , . . ., x n−1 ) of S. For some k ∈ F n 2 , let Intuitively, an S-box such that all vectors in the propagation table are of weight 1 should provide a good resistance against division property.This leads us to define a perfect S-box, where the choice of the word perfect will be justified in Theorem 1.

Definition 4
Let S be an n-bit S-box.We say that S is perfect (w.r.t division property) if its division property propagation table is of the following form : Note that, from Proposition 3 this also means that if S is a perfect S-box, for any k ∈ Proposition 4 Let S be an n-bit S-box with y = (y 0 , . . ., y n−1 ) the ANF of S, where each y i is a polynomial in the input variables x = (x 0 , . . ., x n−1 ) of S. S is perfect if and only if each y i contains all monomials of degree n − 1.An example of such an S-box over 4 bits is the following : S = [1, 4,3,5,13,7,12,10,8,0,11,15,6,14,9,2] Proof Let S be an n-bit S-box satisfying the characterization above.Since S is invertible, we know that we already have We first study the case k S −→ K where w(k) = n − 1.In that case, we have U k = {k, 1 . . .1} and thus F k = {x k , x 0 . . .x n−1 }.Then if k ∈ K, from Proposition 3 this means that either x k or x 0 . . .x n−1 appears in the expression of y k .Especially, for S to be perfect, this needs to hold for every k ∈ E n , thus for every i ∈ {0, . . ., n − 1}, x k or x 0 . . .x n−1 must appear in the expression of y i .
However, since S must be invertible, it is well known that each component of its ANF must have a degree at most n − 1, hence x 0 . . .x n−1 cannot appear in any y i .To summarize, to have k S −→ K = E n for every k such that w(k) = n − 1, then for every such k, x k must appear in the expression of each and every y i , i ∈ {0, . . ., n − 1}, which exactly means that each y i contains all monomials of degree n − 1.Now for every remaining case, i.This characterization is very similar to the property that an S-box should verify to have a good resistance against division property given in [4].However, their representation is a bit different, and we show that choosing a perfect S-box for an SPN block cipher is actually the optimal choice when considering classical division property.First, we need the two following lemmas.

Lemma 1 Let S be an n-bit S-box, and k
• Otherwise, since S is perfect, we can choose k i = e, where e is a unit vector such that e k i .
By building k i as described, it is clear that for all i we have k i We are now ready to prove the following theorem, which shows that using a perfect Sbox is the optimal choice for classical division property (i.e.without using our extension technique).
Theorem 1 For a given n-bit block-cipher where only the S-box remained to be determined (i.e. the linear layer L is fixed), using an S-box layer S built with a perfect S-box S is optimal in terms of resistance against classical division property.We define optimal in the sense that if we denote by r (resp.r ) the smallest number of round such that K r = E n (resp.K r = E n ) when using a perfect S-box S (resp.any other S-box S), then we always have r ≤ r .This basically means that using a perfect S-box always gives the best resistance against classical division property.
Proof Let the following be a division trail when using a non-perfect S-box : where k r ∈ E n .We can build the following division trail when using a perfect S-box : For this division trail to be valid, we use the two previous lemma : Hence, for any unit vector e, there is a valid division trail over r rounds which ends with e when using a perfect S-box, i.e. we have K r = E n .By definition, r is the smallest number of rounds which should verify this condition, thus r ≤ r .Moreover, by definition, the best distinguisher we can build when using a perfect S-box (resp.any other S-box) is over r − 1 rounds (resp.r −1 rounds).Hence why using a perfect S-box gives the best resistance against division property.Thus when considering classical division property, choosing the best S-box in regards to security is pretty clear.Note however that such an S-box has a very peculiar behavior with our technique.Indeed, since every monomial of degree n − 1 appears in every coordinate of the ANF, this property cannot still hold when we consider either L • S or S • L where L is a linear mapping (different from a permutation).As such, if a perfect S-box is used, when considering our technique, the first and last round will be somewhat weaker, as the S-box will not be perfect for these rounds.However, every other round will still use this perfect S-box, thus in a way, the behavior "in the middle" of the cipher would still be good.
We decided to search for a better S-box to use for RECTANGLE, in the hope that it would lead to a better resistance against our technique.Since the rational behind S-box design highly depends on potential applications of the resulting block cipher, we restrict the search space to S-boxes linearly equivalent to the original RECTANGLE S-box.Indeed, linearly equivalent S-boxes have similar structures regarding differential and linear properties.Given two m-bit S-boxes S and S such that holds with probability p, then since A and B are linear and invertible, there is a differential (Δ i , Δ o ) = (A −1 .Δ i , B.Δ o ) of the same probability for S .Hence the DDT is essentially the same, and we expect that it should not drastically change the resistance against differential attacks compared to using the original S-box, and the same kind of observations can be made for linear attacks.
For 4-bit S-boxes, as there are about 2 14.3 invertible matrices of size 4, the main issue we are facing is the high complexity of trying all the 2 28.6 candidates for (A, B).Indeed, many hours are required to search for a division property distinguisher, making the whole search infeasible.Hence, we propose to use several heuristics to select which pairs (A, B) to try.
Selecting good S-boxes Our first idea was to compute the division property propagations tables of all candidates (A, B).This required to perform 2 28.6 × 2 2×4 = 2 36.6 non trivial operations and took approximately 80h on a Xeon E5-2695 (72 cores).Among all those linearly equivalent S-boxes, none of them were perfect.However we found 56 almost perfect S-boxes, i.e. with 13 (instead of 14) transitions k → {1000, 0100, 0010, 0001}.Note that many pairs lead to the same table but the division property only depends on the table.Hence it is enough to try only one representative per table.Since some implementations of block ciphers do not use a table to store the S-box, we believe it makes sense to select the representative which would add less extra XORs.Hence, for each of the 56 tables we selected the couple (A, B) with the lower XOR count and ran our new automated search tool.As a result, we found that by using A = 1 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 and B = 1 0 1 0 0 1 1 0 0 0 1 0 0 0 0 1 which results in only 5 XOR, and replacing all S-boxes of RECTANGLE by S = B • S • A where S is the original S-box of RECTANGLE, then even when using our technique, there is no distinguisher over 9 rounds of this variant of RECTANGLE.We were however able to find a distinguisher over 8 rounds of this variant, using our technique where L in is built with L 0 in as defined below, others L i in for i = 0 are the identity, and each block L i out of L out are the same This results in a distinguisher of data complexity 2 63 resulting in 14 balanced bits.Note that the classic search algorithm for division property distinguishers lead to no distinguisher even over 8 rounds, which shows again that our extension technique can find new distinguishers.Moreover, even when using a perfect S-box (such as the one given in Proposition 4), the best distinguisher using the classic search algorithm is also over 7 rounds, which shows that our choice of S-box, even though it is not a perfect one, is optimal with respect to the classic division property.We believe that this could lead to a new criterion when designing S-boxes, as for the case of RECTANGLE, it improves the resistance against division property based distinguishers by 2 rounds.We would thus first build the S-box according to classical criteria (differential and linear resistance, etc.), then look at the linear equivalent S-boxes and take the one with the best division property propagation table.According to our experiment, while we do not have the same optimality proof as for classical division property, using an S-box with a division property propagation table as close as possible to the one of a perfect S-box seems to be the best choice.About golden S-boxes In 2007, Leander and Poschmann [9] analyzed all 4-bit S-boxes up to linear equivalence and exhibited a set of 16 equivalence classes leading to optimal Sboxes (called golden S-boxes) with respect to both differential and linear cryptanalysis.We went through all members of each of these equivalences classes to see if any of them is a perfect S-box.Indeed, recall that division property is not invariant through linear equivalence.As a result, it turns out that there is no S-box among all of these that is a perfect S-box, thus we cannot have an S-box which is optimal for both linear, differential and division property based cryptanalysis .However, four of these classes have some almost perfect Sboxes among them, i.e. with 55 transitions k → k with w(k ) = 1 (instead of the maximum of 4 × 14 = 56), namely classes G 0 , G 1 , G 2 and G 8 .We give one example for each of these classes in "Appendix", as well as an example with the maximum number of such transitions for each other class.We also give the number of S-boxes reaching that maximum number of transitions across each class.We want to emphasize that this clearly show that using an S-box satisfying our criterion will not lead to the best resistance against different kinds of attacks, and more research is needed in that area.However as mentioned at the end of the previous paragraph, it turns out that using S-boxes which are very close to our criterion can still reach the same security against division property as an S-box satisfying our criterion.

Division property against PRESENT
PRESENT [3] is a 64-bit lightweight block cipher, using either 80 bits or 128 bits keys, with a round function very similar to RECTANGLE and using 4-bit S-boxes.The best known division property based integral distinguisher is from [18] over 9 rounds, requiring 2 60 data and resulting in 1 balanced bit.We applied our previous algorithm to this block cipher, and were actually able to show that our technique cannot lead to a distinguisher over 10 rounds of PRESENT.Indeed, as mentioned at the end of the previous section, if we go through all vectors k0 i of weight 2, then all of the resulting sets T S out [K j k0 i ] are empty, meaning that if there is at least one vector of weight 2 or lower in K 0 , then this cannot result in some balanced bits after 10 rounds.Moreover, if we go through all linear mappings L ∈ L in and compute all possibles propagations k S −→ K where w(k) = 3 and S = S • L with S the S-box of PRESENT, then K will always contains at least one vector of weight 2, or at least one vector of weight 1.Hence, no matter which linear map we take from L in , after the first S-box layer, there will always be a vector of weight either 1 or 2, which lead to a set K 10 containing all unit vectors, and thus no distinguisher over 10 rounds can be built using our technique.

Strengthening PRESENT
As for RECTANGLE, we search for another S-box to use which is linear equivalent to the S-box of PRESENT such that it would improve the resistance against division property based distinguishers.By using S = B • S • A with A = 1 1 0 0 1 0 0 0 0 0 1 0 0 0 0 1 and B = 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 instead of S for all S-boxes of PRESENT, we do not have any division property based distinguisher over 8 rounds of this variant of PRESENT even when using our extension technique.However, we found a distinguisher over 7 rounds with data complexity 2 63 and with all 64 bits being balanced using our technique, with L out being the identity and L in being built with L 0 in = 1 1 0 0 1 0 0 0 0 0 1 0 0 0 0 1 and L i in as the identity for i = 0.The classical search algorithm was only able to find a distinguisher on up to 6 rounds, and again, this choice is optimal for classic division property, as a perfect S-box also gives a classic division property based distinguisher over 6 rounds.This again highlights that our extension technique allows to find better distinguishers than the classical search.Note that, for non table-based implementation, the new S-box we propose only requires two extra XORs compared to the original S-box of PRESENT.

Conclusion
We studied further the division property and the distinguishers that are built from it.We show that while the previous search methods were able to efficiently find some integral distinguishers based on the division property, the search space explored by these methods does not actually cover all possibilities.As such, we show that for r rounds of a block cipher E, considering E = L out • E • L in instead of E, where L out and L in are block diagonal linear maps, can lead to some integral distinguisher over E , while E does not have any.We provide an algorithm to find such distinguisher, and successfully apply it to the block cipher RECTANGLE, on which we found an integral distinguisher over 10 rounds, requiring 2 63 data and leading to 1 balanced bit.This is one more round than the previously known distinguishers.The design of our algorithm also allows us to prove that our technique cannot extend the best distinguisher on PRESENT over one more round.Finally, we give a criterion on S-boxes which allows to prove that if an S-box verifies this criterion, it will provide the best resistance against division property.To our knowledge, this is the first time that such an optimality result is given and formally proven for division property.According to our observations, we were able to exhibit some variants of RECTANGLE and PRESENT which have a better resistance against integral distinguisher based on the division property.Namely the maximum number of round on which we could find an integral distinguisher over our variant of RECTANGLE and PRESENT is 2 rounds lower than when using the original S-box.This might give a new design criterion for S-boxes and further research about this criterion and its interaction with criteria for the design of S-boxes will be needed.
We believe that overall, this technique could open up a lot of questions and possibilities.Indeed, we basically decomposed a block cipher E as , and merged L in and L out with the first S-box layer.But could we use the same technique at a lower level, i.e. decomposing the round function as f = L • L −1 • L • S, merging L with S for example?In a more general view, the question is : what is the best representation of a block cipher to propagate the division property?Also, our algorithm focuses on finding any distinguisher over an SPN block cipher.Thus, how could we find an optimal distinguisher (in terms of data) using this technique, as applying our algorithm when more than one S-box has an input division property which differs from 1 . . . 1 seems quite hard in term of complexity.The same issue comes up when considering 8-bit S-boxes, as we need more calls to the solver, and the resulting MILP models are way more complicated, and thus takes a longer time to be solved.Finally, could this also apply to other constructions such as Feistel block ciphers or permutation based block ciphers?Indeed, our algorithm is efficient because we can basically only study the propagation from after the first S-box layer to before the last S-box layer.

1 −→ k and k S 2 −
1 = S • P and S 2 = P • S, and k S → k be any valid division property propagation through S with k, k ∈ F m 2 .Then both propagations P −1 (k) S → P(k ) are always valid.

m 0 .
. .0 | m 0 . . .0 | . . .| k| . . .| m 0 . . .0 with k a non-zero vector of F m 2 .Thus, if there is a propagation k S out and T S out .Then, for each S-box block i of the first layer, and for each of the 2 m − 2 initial division property vectors k0 i , we use an MILP solver to compute all the sets

Fig. 2
Fig. 2 Overall framework of our search algorithm, where we search for L 0 in k} and F k = {x k| k ∈ U k }.Then we have the transition k S −→ k if and only if y k contains a monomial in F k .

F n 2 \
{0 . . .0, 1 . . .1}, the transition k S −→ k is always valid for any k ∈ F n 2 \ {0 . . .0}.However, most vectors will be redundant, i.e. vectors k , k ∈ F n 2 such that k S −→ k , k S −→ k and k k .Since we do not need to consider redundant vectors in the division property propagation table, we still write k S −→ E n .One can wonder whether such S-box exists, and consequently, we give a clear characterization for perfect S-boxes.
e. 1 ≤ w(k) ≤ n − 2, U k always contains at least one k such that w( k) = n − 1, and thus F k contains at least one monomial of degree n − 1.If we want to have k S −→ E n , this means that every y i must contain at least one monomial from F k .However, each y i contains all monomials of degree n − 1, and F k contains at least one such monomial, and thus k S −→ E n holds, which leads to the fact that S is then a perfect S-box.

sum x∈X x e i = x∈X x i 123 is unknown since e i e i and e i
Proof Suppose that the vector e i belongs to K. Then according to the definition of the division property, this implies that the result of the ∈ K, i.e. the i-th bit is not balanced.On the other hand, if we suppose that the ith bit is balanced, i.e.
Fig. 1 Propagation tables of S 1 and S 2 .Vectors of weight 2 are in bold and as such, F k ⊆ F k .Since k we know that y k contains a monomial in F k .However, since F k ⊆ F k , we also have that y k .Note that k k is equivalent to k i k i for all i.We can build each block k i of k such that S −→ k, S −→ k .Then we can always find k ∈ F n 2 such that k S ⊥ −→ k and k k .Proof Denote by k i the i-th block of k which goes through the i-th S-box, i.e. k i S −→ k i