1 Introduction

A secure block cipher must follow Shannon’s criteria and provide confusion and diffusion [42]. In most cases, confusion is achieved with small substitution boxes (S-Boxes) operating on parts of the state (usually bytes) in parallel, and diffusion is achieved with linear operations mixing the state. The security of the cipher is then strongly dependent on the cryptographic properties of the S-Boxes. For instance, the AES uses an 8-bit S-Box based on the inversion in the finite field with \(2^8\) elements. This S-Box has the smallest known differential probability and linear correlation, and then allows the AES to be secure with a small number of rounds, and to reach very good performances. However, it is not always the best option for constrained environments. In software, an S-Box can be implemented with a look-up table in memory, but this takes 256 bytes for the AES S-Box, and there might be issues with cache-timing attacks [7]. In hardware, the best known implementation of the AES S-Box requires 115 gates [13]; this hardware description can also be used for a bit-sliced software implementation [25]. For some constrained environments, this cost might be too high. Therefore, the field of lightweight cryptography has produced many alternatives with a smaller footprint, such as Tea [47], Crypton [29, 30], Noekeon [16], PRESENT [11], Katan [17], LBlock [48], Prince [12], Twine [44], the LS-Designs [23], or Pride [2]. In particular, many of those lightweight ciphers use S-Boxes operating on \(4\)-bit words, or even on a smaller alphabet like in [1]. But, reducing the number of variables increases the values of the optimal differential probability and linear correlation. Therefore, more rounds are required in order to achieve the same resistance against differential and linear attacks.

An alternative approach when constructing a lightweight cipher consists in using larger S-Boxes, typically operating on \(8\) bits like in the AES, but with a lower implementation cost. Then, we search for S-Boxes with better implementations than the AES S-Box, at the cost of suboptimal cryptographic properties. Finding \(8\)-bit S-Boxes which offer such an interesting trade-off is a difficult problem: they cannot be classified like in the \(4\)-bit case [18, 27], and randomly chosen S-Boxes have a high implementation cost [46]. Therefore, we focus on constructions based on smaller S-Boxes and linear operations. This general approach has been used in several previous constructions: Crypton v0.5 [29] (3-round Feistel), Crypton v1.0 [30] (2-round SPN), Whirlpool [5] (using five small S-Boxes), Khazad [4] (3-round SPN), Iceberg [43] (3-round SPN), Zorro [21] (4-round Feistel with mixing layer), and the LS-Designs [23] (3-round Feistel and MISTY network). As in [23], we here focus on constructions with a 3-round Feistel network, or a 3-round balanced MISTY network, because they use only 3 smaller S-Boxes, but can still provide good large S-Boxes. And we study the respective merits of these two constructions, since this comparison is raised as an open question in [23].

The Feistel and MISTY structures have been intensively studied in the context of block cipher design, and bounds are known for the maximum expected differential probability (\(\mathsf {MEDP}\)) [3, 32, 38] and maximum expected linear potential (\(\mathsf {MELP}\)) [3, 37]. However, those results are not relevant for the construction of S-Boxes, because they only consider the average value over all the keys, while an S-Box is unkeyed. Therefore, the differential and linear properties of the Feistel and MISTY constructions need to be analyzed in the unkeyed setting. Such a study has been initiated recently by Li and Wang [28] in the case of \(3\) rounds of a Feistel network. In this work, we expand the results of Li and Wang, by giving some more general theoretical results for unkeyed Feistel and MISTY structures, with a particular focus on the construction of \(8\)-bit permutations. Due to the page limitation, some of the results are not detailed here and are presented in the full version of this paper [15] only.

Our contributions. We first explain why the usual \(\mathsf {MEDP}\) and \(\mathsf {MELP}\) notions are meaningless in the unkeyed setting. In particular we exhibit a \(3\)-round MISTY network where there exists a differential with probability higher than the \(\mathsf {MEDP}\) for any fixed key, but this optimal differential depends on the key. Then, Sect. 3 gives some lower bounds on the differential uniformity and linearity of any \(3\)-round balanced MISTY structure, which involve the properties of the three inner S-Boxes. Similar results on \(3\)-round Feistel networks are also detailed in Sect. 5 of [15], which generalize the previous results from [28]. Section 4 then focuses on the construction of \(8\)-bit permutations. Most notably, we show that \(3\) rounds of a Feistel network with appropriate inner S-Boxes provide better cryptographic properties than any \(3\)-round MISTY network, explaining some experimental results reported in [23]. Section 5 then gives an instantiation of such an \(8\)-bit permutation, which offers a very good trade-off between the cryptographic properties and the implementation cost. It can be implemented efficiently in hardware and for bit-sliced software, and has good properties for side-channel resistant implementations with masking. In particular, this S-Box supersedes the S-Boxes considered in many lightweight ciphers including CRYPTON, Robin and Fantomas.

2 From Keyed Constructions to Unkeyed S-Boxes

2.1 Main Cryptographic Properties for an S-Box

In this paper, we focus on S-Boxes having the same number of input and output bits. The resistance offered by an S-Box against differential [10] and linear [31] cryptanalysis is quantified by the highest value in its difference table (resp. table of linear biases, aka linear-approximation table). More precisely, these two major security parameters are defined as follows.

Definition 1

(Differential uniformity [36]). Let \(F\) be a function from \(\mathbb {F}_2^n\) into \(\mathbb {F}_2^n\). For any pair of differences \((a,b)\) in \(\mathbb {F}_2^n\), we define the set

$$D_F(a \rightarrow b) = \{x \in \mathbb {F}_2^n~|~F(x \oplus a) \oplus F(x)= b\}.$$

The entry at position \((a,b)\) in the difference table of \(F\) then corresponds to the cardinality of \(D_F(a \rightarrow b)\) and will be denoted by \(\delta _F(a , b)\).

Moreover, the differential uniformity of F is

$$\delta (F) = \max _{a \ne 0, b} \delta _F(a, b).$$

Obviously, the differential uniformity of an S-Box is always even, implying that, for any \(F\), \(\delta (F) \ge 2\). The functions \(F\) for which equality holds arze named almost perfect nonlinear (APN) functions.

Similarly, the bias of the best linear approximation of an S-Box is measured by its linearity.

Definition 2

(Walsh transform of an S-Box). Let \(F\) be a function from \(\mathbb {F}_2^n\) into \(\mathbb {F}_2^n\). The Walsh transform of \(F\) is the function

$$\begin{aligned} \begin{array}{lcl} \mathbb {F}_2^n \times \mathbb {F}_2^n &{} \rightarrow &{} \mathbb {Z}\\ (a,b) &{} \mapsto &{} \lambda _F(a,b)=\sum \nolimits _{x \in \mathbb {F}_2^n} (-1)^{b \cdot F(x)+a \cdot x}. \end{array} \end{aligned}$$

Moreover, the linearity of \(F\) is

$$\mathcal {L}(F) = \max _{a,b \in \mathbb {F}_2^n, b \ne 0} |\lambda _F(a,b)|.$$

Indeed, up to a factor \(2^{n}\), the linearity corresponds to the bias of the best linear relation between the input and output of \(F\):

$$\begin{aligned} \text{ Pr }_X[b \cdot F(X) + a \cdot X=1] = \frac{1}{2^n} \bigg (2^{n-1} - \frac{1}{2} \sum _{x \in \mathbb {F}_2^n} (-1)^{b \cdot F(x) + a \cdot x}\bigg )= \frac{1}{2} \Big (1 - \frac{\lambda _F(a,b)}{2^n}\Big ). \end{aligned}$$

It is worth noticing that, for any fixed output mask \(b \in \mathbb {F}_2^n\), the function \(a \mapsto \lambda _F(a,b)\), corresponds to the Walsh transform of the \(n\)-variable Boolean component of \(F\): \(x \mapsto b \cdot F(x)\). In particular, it enjoys all properties of a discrete Fourier transform, for instance the Parseval relation.

2.2 Constructing S-Boxes from Smaller Ones

If this paper we focus on the construction of S-Boxes using several smaller S-Boxes. Indeed small S-Boxes are much cheaper to implement that large S-Boxes:

  • for table-based software implementations, the tables are smaller;

  • for hardware implementations, the gate count is lower;

  • for bit-sliced software implementation, the instructions count is lower;

  • for vectorized implementation, small S-Boxes can use vector permutations.

In many cases, implementing several small S-Boxes requires less resources than implementing a large one. Therefore, constructing S-Boxes from smaller ones can reduce the implementation cost.

The Feistel construction is a well-known construction to build a 2n-bit permutation from smaller n-bit functions, introduced in 1971 for the design of Lucifer (which later became DES [34]). It is a good candidate for constructing large S-Boxes from smaller ones at a reasonable implementation cost. In particular, this construction has been used for the S-Boxes of Crypton v0.5 [29], ZUC [20] (for \(S_0\)), Robin [23] and iScream [22]. The MISTY construction introduced by Matsui [32] uses a different structure, but offers a similar level of security. The main advantage of the MISTY network is that it can offer a reduced latency because the first two S-Boxes can be evaluated in parallel. Therefore it is a natural alternative to Feistel networks for the construction of lightweight S-Boxes, and it has been used in the design of Fantomas [23] and Scream [22]. In order to reduce the number of gates used for implementing the construction, we focus on balanced MISTY networks, while the MISTY block cipher proposed in [33] is unbalanced and combines an \((n-1)\)-bit S-Box and an \((n+1)\)-bit S-Box.

The two structures we study are depicted in Figs. 1 and 2. It is worth noticing a major difference between the two: the function resulting from the Feistel construction is always invertible (since one round is an involution, up to a permutation of the outputs), while the function resulting from the MISTY construction is invertible if and only if all the inner S-Boxes are invertible.

Fig. 1.
figure 1figure 1

3-round MISTY network

Fig. 2.
figure 2figure 2

3-round Feistel network

Analysis of Feistel and MISTY Structures. Since these two constructions have been used for the design of many block ciphers (in particular the DES [34] and MISTY [33], respectively), their security properties have been intensively studied. A natural way to measure the resistance of the resulting block cipher against differential and linear cryptanalysis is to study the probabilities of the differentials (respectively the potentials of the linear approximations) averaged over all keys.

Definition 3

( \(\mathsf {MEDP}\) and \(\mathsf {MELP}\) ). Let \(F_K\) be a family of function from \(\mathbb {F}_2^n\) into \(\mathbb {F}_2^n\). The \(\mathsf {MEDP}\) is the maximum probability of a differential, averaged over all keys:

$$\begin{aligned} \mathsf {MEDP}(F_K) = \max _{a \ne 0, b} \frac{1}{2^{k}} \sum _{K \in \mathbb {F}_2^{k}} \frac{\delta _{F_K}(a,b)}{2^n}. \end{aligned}$$

The \(\mathsf {MELP}\) is the maximum potential of a linear approximation, averaged over all keys:

$$\begin{aligned} \mathsf {MELP}(F_K) = \max _{a, b \ne 0} \frac{1}{2^{k}} \sum _{K \in \mathbb {F}_2^{k}} \left( \frac{\lambda _{F_K}(a,b)}{2^n}\right) ^2. \end{aligned}$$

The following theorem shows that the \(\mathsf {MEDP}\) and \(\mathsf {MELP}\) of a Feistel or MISTY network can be bounded.

Theorem 1

(Feistel or MISTY, averaged over all keys, [3, 32, 38]). Given \(S_1\), \(S_2\) and \(S_3\) three n-bit permutations, let \(p=\max _i \delta (S_i)/2^n\) and \(q=\max _i (\mathcal {L}(S_i)/2^n)^2\). Then the family of functions \((F_K)_{K=(K_1,K_2,K_3)\in \mathbb {F}_2^{3k}}\) defined by 3 rounds of a Feistel or of a MISTY network with \(S_i\) as inner functions verifies

$$\mathsf {MEDP}(F_K) \le p^2 \text { and } \mathsf {MELP}(F_K) \le q^2.$$

This theorem is very powerful for the construction of iterated block ciphers: it shows that a big function with strong cryptographic properties can be built from small functions with strong cryptographic properties. However, for the design of an S-Box from smaller S-Boxes, it is of little use. Indeed, we are interested in the properties of a single fixed S-Box, rather than the average properties of a family of S-Boxes. For a fixed (ab) the theorem proves that the average values of \(\delta _{F_K}(a,b)\) and \(\lambda _{F_K}(a,b)\) are bounded, therefore there exists at least one key for which the value is smaller than or equal to the average. However, it might be that the values ab where the maximum is reached are not the same for every key. Therefore if we select a key so that \(\delta _{F_K}(a,b)\) is small for an ab maximizing the average probability, the maximum can be reached for another entry of the differential table.

More strikingly, we discovered some choices of \(S_1\), \(S_2\), \(S_3\) such that the maximum differential probability of the functions in the corresponding family is always higher than the \(\mathsf {MEDP}\).

Example 1

We consider a MISTY structure with three identical S-Boxes:

$$S_i = [\mathtt {A, 7, 9, 6, 0, 1, 5, B, 3, E, 8, 2, C, D, 4, F}].$$

We have \(\mathsf {MEDP}(F_K) \le 16/256\) according to Theorem 1, because \(\delta (S_i) = 4\). However, for any function in this family, there exists a differential with probability 32 / 256. This is not a contradiction, because the differential reaching the maximum depends on the key.

The relevant property for the construction of an S-Box is the maximum differential probability (respectively maximum linear potential). Therefore, we could derive some information on this quantity for \(F_K\) for some fixed keys from the knowledge of the average value of the maximal differential probability, i.e., the \(\mathsf {EMDP}\) (resp. \(\mathsf {EMLP}\)), which may significantly differ from the \(\mathsf {MEDP}\) (resp. \(\mathsf {MELP}\)). We would like to point out that there is a confusion between the two notions in [33]: the definition corresponds to the expected maximum differential probability (respectively expected maximum linear potential), while the theorems apply to the \(\mathsf {MEDP}\) and \(\mathsf {MELP}\).

Analysis of Feistel and MISTY Structures with Fixed Key. In order to study the properties of Feistel and MISTY structures for the construction of lightweight S-Boxes, we must study these structures with a fixed key. Equivalently, we can consider the structures without any key, because a structure with a fixed key is equivalent to an unkeyed one with different S-Boxes. Indeed, using an S-Box \(S_i\) with round key \(k_i\) is equivalent to using \(S'_i: x \mapsto S_i(x + k_i)\) as an S-Box without any key. In the following, we always consider a key-less variant.

In a recent analysis of the fixed-key Feistel structure [28], Li and Wang derive the best differential uniformity and linearity which can be achieved by a 3-round Feistel cipher with a fixed key, and give examples reaching this bound. Their main results are as follows:

Theorem 2

(Feistel unkeyed, [28]). Let \(S_1\), \(S_2\) and \(S_3\) be three n-bit S-Boxes and \(F\) be the \(2n\)-bit function defined by the corresponding \(3\)-round Feistel network. Then, \(\delta (F) \ge 2\delta (S_2)\). Moreover, if \(S_2\) is not a permutation, \(\delta (F) \ge 2^{n+1}\).

If \(n=4\), F satisfies \(\delta (F) \ge 8\). If equality holds, then \(\mathcal {L}(F) \ge 64\).

3 S-Boxes Obtained from 3 Rounds of MISTY or Feistel

3.1 Our Results

In this paper, we generalize the bounds of Li and Wang [28] on Feistel structures, and derive bounds for MISTY structures. The results are very similar for the two structures, but for a MISTY structure, optimal results are only achieved with non-invertible inner functions. Therefore, our work shows that Feistel structures allow better results than MISTY structures for the design of invertible 8-bit S-Boxes.

More precisely, we introduce two new S-Box properties \(\delta _{\min }\) and \(\mathcal {L}_{\min }\) in order to derive our bounds: \(\mathcal {L}_{\min }\) is the smallest linearity we can have for a non-trivial component of the S-Box. Similarly, \(\delta _{\min }\) is the smallest value we can have for the maximum \(\max _{b}\delta (a,b)\) within a row in the difference table. In particular, for any 4-bit function \(S\), \(\delta _{\min }(S) \ge 2\) and \(\mathcal {L}_{\min }(S) \ge 4\). Moreover, if S is a 4-bit permutation, then \(\delta _{\min }(S) \ge 4\) and \(\mathcal {L}_{\min }(S) \ge 8\).

We first present the general lower bounds we obtain on the differential uniformity and linearity of \(3\) rounds of a Feistel and of a MISTY construction.

  1. 1.

    For a Feistel network with inner S-Boxes \(S_1\), \(S_2\) and \(S_3\):

    • \(\delta (F) \ge \delta (S_2) \max \left( \delta _{\min }(S_1), \delta _{\min }(S_3)\right) \)

    • if \(S_2\) is not a permutation, \(\delta (F) \ge 2^{n+1}\).

    • if \(S_2\) is a permutation, \(\displaystyle \delta (F) \ge \max _{i \ne 2, j \ne i,2} \left( \delta (S_i) \delta _{\min }(S_j) , \; \delta (S_i) \delta _{\min }(S_2^{-1}) \right) \).

    • \(\mathcal {L}(F) \ge \mathcal {L}(S_2) \max \left( \mathcal {L}_{\min }(S_1), \; \mathcal {L}_{\min }(S_3)\right) \)

    • if \(S_2\) is a permutation, \(\displaystyle \mathcal {L}(F) \ge \max _{i \ne 2, j \ne i,2} \left( \mathcal {L}(S_i) \mathcal {L}_{\min }(S_j), \; \mathcal {L}(S_i) \mathcal {L}_{\min }(S_2^{-1})\right) \).

  2. 2.

    For a MISTY network with inner S-Boxes \(S_1\), \(S_2\) and \(S_3\):

    • \(\delta (F) \ge \delta (S_1) \max \left( \delta _{\min }(S_2), \delta _{\min }(S_3)\right) \)

    • if \(S_1\) is not a permutation, \(\delta (F) \ge 2^{n+1}\).

    • if \(S_1\) is a permutation, \(\displaystyle \delta (F) \ge \max _{i \ne 1, j \ne 1,i} \left( \delta (S_i) \delta _{\min }(S_j) , \; \delta (S_i) \delta _{\min }(S_1^{-1}) \right) \);

    • \(\mathcal {L}(F) \ge \max \left( \mathcal {L}(S_1)\mathcal {L}_{\min }(S_2), \mathcal {L}(S_2) \mathcal {L}_{\min }(S_1), \; \mathcal {L}(S_3) \mathcal {L}_{\min }(S_1)\right) \);

    • if \(S_3\) is a permutation, \(\mathcal {L}(F) \ge \mathcal {L}(S_1) \mathcal {L}_{\min }(S_3^{-1})\).

    • if \(S_1\) is a permutation, \(\mathcal {L}(F) \ge \mathcal {L}(S_3) \mathcal {L}_{\min }(S_2)\).

    • if \(S_1\) and \(S_3\) are permutations, \(\mathcal {L}(F) \ge \mathcal {L}(S_2) \mathcal {L}_{\min }(S_3^{-1})\).

If \(n=4\) this yields for both constructions:

$$\begin{aligned} \delta (F) \ge 8 \text{ and } \mathcal {L}(F) \ge 48. \end{aligned}$$

Moreover, \(\mathcal {L}(F) \ge 64\) unless \(\delta (F) \ge 32\).

For the MISTY construction with \(n=4\), if F is a permutation, we obtain tighter bounds: \(\delta (F) \ge 16\) and \(\mathcal {L}(F) \ge 64\). This implies that the Feistel construction is more appropriate for constructing \(8\)-bit permutations. We will also show that all these bounds for \(n=4\) are tight. We now detail the results in the case of the MISTY construction, while the results for the Feistel construction are presented in the full version [15].

3.2 Differential Uniformity of 3 Rounds of MISTY

Our lower bound on the differential uniformity of the \(3\)-round MISTY relies on the evaluation of the number of solutions of some differentials for which the input difference of one of the 3 S-Boxes is canceled (see Fig. 3 in [15]).

Proposition 1

Let \(S_1\), \(S_2\) and \(S_3\) be three n-bit S-Boxes and \(F\) be the \(2n\)-bit function defined by the corresponding \(3\)-round MISTY network. Then, for all a, b and c in \(\mathbb {F}_2^n\), we have:

  • (i)  

    $$\delta _F(0\Vert a , b\Vert c) = \delta _{S_1}(a, c) \times \delta _{S_3}(c ,b\oplus c);$$
  • (ii) If \(S_1\) is bijective,

    $$\delta _F(a\Vert 0 ,b\Vert c) = \delta _{S_2}(a , a\oplus c) \times \delta _{S_3}(a , b\oplus c);$$
  • (iii) where \(\gamma _{S_3}(d)\) is 0 if \(\delta _{S_3}(d , 0)=0\) and 1 otherwise. Most notably, if \(S_3\) is bijective,

    $$\delta _F(b\Vert a , c\Vert c) = \delta _{S_1}(a, b) \times \delta _{S_2}(b, c).$$

Proof

Let x be the input of the MISTY network, and let \(x_L\) and \(x_R\) be its left and right parts respectively.

  • (i) \(x=(x_L,x_R)\) satisfies \(F(x_L\Vert x_R) \oplus F(x_L\Vert (x_R\oplus a)) = b\Vert c\) if and only if

    $$\begin{aligned}&\left\{ \begin{array}{rcl} S_3(S_1(x_R) \oplus x_L) \oplus S_3(S_1(x_R \oplus a)\oplus x_L) &{}=&{} b \oplus c,\\ S_2(x_L) \oplus S_1(x_R) \oplus x_L \oplus S_2(x_L) \oplus S_1(x_R \oplus a) \oplus x_L &{}=&{} c \end{array} \right. \\\Leftrightarrow & {} \left\{ \begin{array}{rcl} S_3(S_1(x_R) \oplus x_L)\oplus S_3(S_1(x_R \oplus a) \oplus x_L) &{}=&{} b \oplus c,\\ S_1(x_R) \oplus S_1(x_R \oplus a) &{}=&{} c \end{array} \right. \end{aligned}$$

    or equivalently

    $$\begin{aligned} x_R \in D_{S_1}(a \rightarrow c) \text{ and } x_L \in S_1(x_R) \oplus D_{S_3}(c \rightarrow b\oplus c). \end{aligned}$$

    Hence, we deduce that there are exactly \(\delta _{S_1}(a, c)\) values of \(x_R\), and for each of those, \(\delta _{S_3}(c, b\oplus c)\) values of \(x_L\), such that x verifies the differential.

  • (ii) \(x=(x_L,x_R)\) satisfies \(F(x_L\Vert x_R) \oplus F((x_L\oplus a)\Vert x_R) = b\Vert c\) if and only if

    $$\begin{aligned}&\left\{ \begin{array}{rcl} S_3(S_1(x_R) \oplus x_L) \oplus S_3(S_1(x_R) \oplus x_L \oplus a) &{} = &{} b \oplus c,\\ S_2(x_L) \oplus S_1(x_R) \oplus x_L \oplus S_2(x_L \oplus a) \oplus S_1(x_R) \oplus x_L \oplus a &{} = &{} c \end{array} \right. \\\Leftrightarrow & {} \left\{ \begin{array}{rcl} S_1(x_R) \oplus x_L &{} \in &{} D_{S_3}(a \rightarrow b\oplus c),\\ S_2(x_L)\oplus S_2(x_L \oplus a) &{} = &{} a \oplus c \end{array} \right. \end{aligned}$$

    or equivalently,

    $$\begin{aligned} x_L \in D_{S_2}(a \rightarrow a\oplus c) \text{ and } S_1(x_R) \in x_L\oplus D_{S_3}(a \rightarrow b\oplus c). \end{aligned}$$

    If \(S_1\) is invertible, for any fixed \(x_L\), each one of the \(\delta _{S_3}(a,b\oplus c)\) values defined by the second condition determines a unique value of \(x_R\). Therefore, the number of \((x_L,x_R)\) satisfying the differential is exactly \(\delta _{S_2}(a , a\oplus c)\times \delta _{S_3}(a , b\oplus c)\).

  • (iii) \((x_L,x_R)\) satisfies \(F(x_L\Vert x_R) \oplus F((x_L \oplus b)\Vert (x_R \oplus a)) = c\Vert c\) if and only if

    $$\begin{aligned}&\left\{ \begin{array}{rcl} S_3(S_1(x_R) \oplus x_L) \oplus S_3(S_1(x_R \oplus a) \oplus x_L \oplus b) &{} = &{} 0,\\ S_2(x_L) \oplus S_1(x_R) \oplus x_L \oplus S_2(x_L \oplus b) \oplus S_1(x_R \oplus a) \oplus x_L \oplus b &{} = &{} c \end{array} \right. \\\Leftrightarrow & {} \left\{ \begin{array}{rcl} S_3(S_1(x_R) \oplus x_L) \oplus S_3(S_1(x_R \oplus a) \oplus x_L \oplus b) &{} = &{} 0,\\ S_2(x_L) \oplus S_1(x_R) \oplus S_2(x_L \oplus b) \oplus S_1(x_R \oplus a) &{} = &{} b \oplus c \end{array} \right. \end{aligned}$$

    This equivalently means that there exists some \(d \in \mathbb {F}_2^n\) such that

    $$\begin{aligned} \left\{ \begin{array}{l} x_R \in D_{S_1}(a \rightarrow b \oplus d),\,x_L \in D_{S_2}(b \rightarrow c \oplus d),\\ S_3(S_1(x_R) \oplus x_L) \oplus S_3(S_1(x_R \oplus a) \oplus x_L \oplus b) = 0,\end{array}\right. \end{aligned}$$

    i.e.,

    $$\begin{aligned} x_R \in D_{S_1}(a \rightarrow b \oplus d),\; x_L \in D_{S_2}(b \rightarrow c \oplus d) \text{ and } S_1(x_R)\oplus x_L \in D_{S_3}(d \rightarrow 0). \end{aligned}$$

    Then, for any fixed \(d \in \mathbb {F}_2^n\) such that \(\delta _{S_3}(d , 0)=0\), no pair \((x_L,x_R)\) satisfies the third condition. If \(\delta _{S_3}(d , 0)>0\), then some of the values \((x_L,x_R)\) defined by the first two conditions may also satisfy the third one, and if \(d=0\), the third condition is always satisfied. It then follows that

    $$\begin{aligned} \delta _{S_1}(a, b) \times \delta _{S_2}(b, c) \le \delta _F(b\Vert a , c\Vert c) \le \sum _{d \in \mathbb {F}_2^n}\,\delta _{S_1}(a, b\oplus d) \times \delta _{S_2}(b , c\oplus d) \times \gamma _{S_3}(d) \end{aligned}$$

    where \(\gamma _{S_3}(d)\) is 0 if \(\delta _{S_3}(d , 0)=0\) and 1 otherwise. Moreover, if \(S_3\) is bijective, \(\delta _{S_3}(d,0) > 0\) if and only if \(d=0\), implying that the two previous bounds are equal, i.e.,

    $$\begin{aligned} \delta _F(b\Vert a , c\Vert c) = \delta _{S_1}(a, b) \times \delta _{S_2}(b, c). \end{aligned}$$

   \(\square \)

These three particular types of differentials provide us with the following lower bound on the differential uniformity of any \(3\)-round MISTY network.

Theorem 3

Let \(S_1\), \(S_2\) and \(S_3\) be three n-bit S-Boxes and let \(F\) be the \(2n\)-bit function defined by the corresponding 3-round MISTY network. Then,

$$\begin{aligned} \delta (F) \ge \delta (S_1) \max \left( \delta _{\min }(S_2), \delta _{\min }(S_3)\right) \text{ where } \delta _{\min }(S) = \min _{a \ne 0}\max _{b} \delta _S(a,b). \end{aligned}$$

Moreover,

  • if \(S_1\) is a permutation,

    $$\begin{aligned} \delta (F) \ge \max _{i \ne 1, j \ne 1,i} \max \left( \delta (S_i)\delta _{\min }(S_j) , \; \delta (S_i)\delta _{\min }(S_1^{-1}) \right) , \end{aligned}$$
  • if \(S_1\) is not a permutation, \(\delta (F) \ge 2^{n+1}\).

Proof

The result is a direct consequence of Proposition 1. We here derive the bounds from the first item in Proposition 1; the other cases can be similarly deduced from the other two items. Let us first consider a pair of differences \((\alpha ,\beta )\) which achieves the differential uniformity of \(S_1\), i.e., \(\delta (S_1)=\delta _{S_1}(\alpha , \beta )\). Then, we choose \(a=\alpha \) and \(c=\beta \), and get that, for any \(b \in \mathbb {F}_2^n\),

$$\begin{aligned} \delta _F(0\Vert \alpha , b\Vert \beta ) = \delta (S_1) \times \delta _{S_3}(\beta , \beta \oplus b). \end{aligned}$$

Then, we can choose for \(b\) the value which maximizes \(\delta _{S_3}(\beta , \beta \oplus b)\). This value is always greater than or equal to \(\delta _{\min }(S_3)\). Similarly, we can now consider a pair of differences \((\alpha ,\beta )\) which achieves the differential uniformity of \(S_3\), i.e., \(\delta (S_3)=\delta _{S_3}(\alpha , \beta )\). In this case, we choose \(c=\alpha \) and \(b=\alpha \oplus \beta \), and get that, for any \(a \in \mathbb {F}_2^n\),

$$\begin{aligned} \delta _F(0\Vert a, (\alpha \oplus \beta )\Vert \alpha ) = \delta _{S_1}(a, \alpha ) \times \delta (S_3). \end{aligned}$$

We then choose for \(a\) the value which maximizes \(\delta _{S_1}(a, \alpha )\) which is always greater than or equal to \(\delta _{\min }(S_1^{-1})\) when \(S_1\) is a permutation.

Let us now assume that \(S_1\) is not bijective. This means that there exists some nonzero \(a \in \mathbb {F}_2^n\) such that \(\delta _{S_1}(a,0) \ge 2\). Then, we deduce from the first item in Proposition 1, with \(b=c=0\), that \(F(x_L\Vert x_R)\oplus F_K(x_L\oplus a \Vert x_R) = (0,0)\) has \(\delta _{S_1}(a, 0)\times \delta _{S_3}(0,0) \ge 2\times 2^n = 2^{n+1}\) solutions in \(\mathbb {F}_2^{2n}\).    \(\square \)

3.3 Linearity of 3 Rounds of MISTY

The lower bound on the linearity of a three-round MISTY structure can be derived in a similar way. The proofs of the following results are given in [15].

Proposition 2

Let \(S_1\), \(S_2\) and \(S_3\) be three n-bit S-Boxes and F the \(2n\)-bit function defined by the corresponding \(3\)-round MISTY network. Then, for all a, b and c in \(\mathbb {F}_2^n\), we have:

  • (i) \(\lambda _{F}(a\Vert b, 0\Vert c) = \lambda _{S_1}(b, c) \lambda _{S_2}(a\oplus c, c)\)

  • (ii) \(\lambda _{F}(a\Vert b, c\Vert c) = \lambda _{S_1}(b, a) \lambda _{S_3}(a, c)\)

  • (iii) If \(S_1\) is bijective, \(\lambda _{F}(a\Vert 0, b\Vert c) = \lambda _{S_2}(a, b\oplus c) \lambda _{S_3}(b\oplus c, b)\)

As in the differential case, the previous three linear approximations provide us with a lower bound on the linearity of any 3-round MISTY network. This bound involves both the linearity of the constituent S-Boxes and another quantity denoted by \(\mathcal {L}_{\min }\) computed from the table of linear biases as follows.

Definition 4

( \(\mathcal {L}_{\min }\) ). Let \(F\) be an \(n\)-bit S-Box. We define

$$\mathcal {L}_{\min }(F) = \min _{b\in \mathbb {F}_2^n, b \ne 0}\max _{a \in \mathbb {F}_2^n} |\lambda _F(a,b)|.$$

Most notably, \(\mathcal {L}_{\min }(F) \ge 2^{\frac{n}{2}}\) and this bound is not tight when \(F\) is bijective.

Proof

By definition, \(\mathcal {L}_{\min }(F)\) is the smallest linearity achieved by a component \(F_b: x \mapsto b \cdot F(x)\) of \(F\), when \(b\) varies in \(\mathbb {F}_2^n{\setminus }\{0\}\). Since any \(F_b\) is an \(n\)-variable Boolean function, its linearity is at least \(2^{\frac{n}{2}}\) with equality if and only if \(F_b\) is bent [41]. Since bent functions are not balanced, none of the components of a permutation is bent, implying that \(\mathcal {L}_{\min }(F) > 2^{\frac{n}{2}}\) when \(F\) is a permutation.    \(\square \)

We then derive the following lower bound on the linearity of any 3-round MISTY network. The proof is given in [15].

Theorem 4

Let \(S_1\), \(S_2\) and \(S_3\) be three n-bit S-Boxes and let \(F\) be the \(2n\)-bit function defined by the corresponding 3-round MISTY network. Then,

$$\begin{aligned} \mathcal {L}(F) \ge \max \left( \mathcal {L}(S_1)\mathcal {L}_{\min }(S_2), \; \mathcal {L}(S_2) \mathcal {L}_{\min }(S_1), \; \mathcal {L}(S_3) \mathcal {L}_{\min }(S_1)\right) . \end{aligned}$$

Moreover, if \(S_1\) is a permutation, \(\mathcal {L}(F) \ge \mathcal {L}(S_3) \mathcal {L}_{\min }(S_2)\); if \(S_3\) is a permutation, \(\mathcal {L}(F) \ge \mathcal {L}(S_1) \mathcal {L}_{\min }(S_3^{-1})\), and if both \(S_1\) and \(S_3\) are permutations, then \(\mathcal {L}(F) \ge \mathcal {L}(S_2) \mathcal {L}_{\min }(S_3^{-1})\).

4 Application to 8-Bit S-Boxes

In this section, we investigate the cryptographic properties of 8-bit S-Boxes corresponding to a 3-round MISTY structure with 4-bit inner S-Boxes, with a particular focus on the case where the three inner S-Boxes are bijective, since it corresponds to the case where the resulting function is a permutation.

4.1 Differential Uniformity

The following bound on the differential uniformity of any 3-round MISTY network over \(\mathbb {F}_2^8\) is a direct consequence of Theorem 3.

Corollary 1

Any \(8\)-bit function \(F\) corresponding to a 3-round MISTY network satisfies \(\delta (F) \ge 8\).

Proof

The bound clearly holds when \(S_1\) is not bijective, since we known from Theorem 3 that \(\delta (F) \ge 32\) in this case. If \(S_1\) is bijective, then \(\delta (S_1) \ge 4\) since APN permutations over \(\mathbb {F}_2^4\) do not exist, as proved in [24, Theorem 2.3]. Obviously, any \(4\)-bit S-Box \(S\) satisfies \(\delta _{\min }(S) \ge 2\), implying that

$$\begin{aligned} \delta (F) \ge \delta (S_1) \delta _{\min }(S_2) \ge 8. \end{aligned}$$

   \(\square \)

Besides this general result, we can provide some necessary conditions on the constituent S-Boxes to achieve the previous lower bound.

Theorem 5

Let \(S_1\), \(S_2\) and \(S_3\) be three 4-bit S-Boxes and let \(F\) be the \(8\)-bit function defined by the corresponding 3-round MISTY network. Then, \(\delta (F)=8\) implies that \(S_1\) is a permutation with \(\delta (S_1)=4\) and \(S_2\) and \(S_3\) are two APN functions. Otherwise, \(\delta (F) \ge 12\).

Proof

Since \(\delta (F) \ge 32\) when \(S_1\) is not bijective, we only need to focus on the case where \(S_1\) is a permutation. If any of the constituent S-Boxes \(S_i\) has differential uniformity strictly greater than \(4\), i.e., \(\delta (S_i) \ge 6\), we deduce from Theorem 3 that \(\delta (F) \ge \delta (S_i) \delta _{\min }(S_j) \ge 12\). Therefore, \(\delta (F)=8\) can be achieved only if \(\delta (S_1)=4\), \(\delta (S_2) \le 4\), and \(\delta (S_3) \le 4\). The fact that \(\delta (F) \ge 16\) when at least one of the S-Boxes \(S_2\) or \(S_3\) has differential uniformity \(4\) is proved in Lemma 1 in the full version [15].    \(\square \)

We can then prove that the lower bound in Corollary 1 is tight by exhibiting three \(4\)-bit S-Boxes satisfying the previous conditions which lead to a 3-round MISTY network with differential uniformity \(8\).

Example 2

The following 4-bit S-Boxes yield an 8-bit S-Box with differential uniformity 8 and linearity 64 when used in a MISTY structure:

$$\begin{aligned} S_1&= [\mathtt {4, 0, 1, f, 2, b, 6, 7, 3, 9, a, 5, c, d, e, 8}]\\ S_2&= [\mathtt {0, 0, 0, 1, 0, a, 8, 3, 0, 8, 2, b, 4, 6, e, d}]\\ S_3&= [\mathtt {0, 7, b, d, 4, 1, b, f, 1, 2, c, e, d, c, 5, 5}] \end{aligned}$$

With Bijective Inner S-Boxes. We now focus on the case where the three inner S-Boxes are permutations since this guarantees that the resulting MISTY network is a permutation. We have proved that, in this case, the lowest possible differential uniformity we can obtain is \(12\). Here, we refine this result and show that the differential uniformity cannot be lower than \(16\). This improved bound exploits the following lemma on the difference tables of \(4\)-bit permutations.

Lemma 1

Let \(S_1\), \(S_2\) and \(S_3\) be \(4\)-bit permutations. Then, there exists a nonzero difference \(\gamma \in \mathbb {F}_2^4{\setminus }\{0\}\) such that at least one of the following statements holds:

  • The difference table of \(S_1\) has at least one value greater than or equal to 4 in Column \(\gamma \) and the difference table of \(S_2\) has at least one value greater than or equal to 4 in Row \(\gamma \);

  • The difference table of \(S_1\) has at least one value greater than or equal to 4 in Column \(\gamma \) and the difference table of \(S_3\) has at least one value greater than or equal to 4 in Row \(\gamma \),

  • The difference table of \(S_2\) has at least one value greater than or equal to 4 in Row \(\gamma \) and the difference table of \(S_3\) has at least one value greater than or equal to 4 in Row \(\gamma \).

Proof

This result relies on an exhaustive search over the equivalence classes defined by composition on the left and on the right by an affine transformation, exactly as in the classification of optimal \(4\)-bit S-Boxes in [18, 27]. There are \(302\) equivalence classes for \(4\)-bit permutations. From each of the classes we picked a representative, and checked that its difference table has at least six rows defined by some nonzero input difference \(a\) which contain a value greater than or equal to 4. Let \(\mathcal {R}(S)\) denote the corresponding set (of size at least six):

$$\begin{aligned} \mathcal {R}(S) = \big \{a \in \mathbb {F}_2^4{\setminus } \{0\}~: \exists b \in \mathbb {F}_2^4{\setminus } \{0\}, \delta _S(a,b) \ge 4\big \}. \end{aligned}$$

Therefore, if there exists no difference \(\gamma \in \mathbb {F}_2^4{\setminus }\{0\}\) satisfying one of the three statements in the lemma, then this would mean that the three sets \(\mathcal {R}(S_2)\), \(\mathcal {R}(S_3)\) and \(\mathcal {R}(S_1^{-1})\) are disjoint. In other words, we could find \(18\) distinct values amongst the \(15\) nonzero elements in \(\mathbb {F}_2^4\), which is impossible.    \(\square \)

We then deduce the following refined lower bound on the differential uniformity of a 3-round MISTY network over \(\mathbb {F}_2^8\) with inner permutations.

Theorem 6

Let \(S_1\), \(S_2\) and \(S_3\) be three 4-bit permutations and let \(F\) be the \(8\)-bit function defined by the corresponding 3-round MISTY network. Then, \(\delta (F) \ge 16\).

Proof

The result is a direct consequence of Proposition 1 combined with the previous lemma. Indeed, Lemma 1 guarantees the existence of a, b and c such that at least one of the three following properties holds:

  • \(\delta _{S_1}(a,c) \ge 4 \text { and } \delta _{S_3}(c, b\oplus c) \ge 4\),

  • \(\delta _{S_2}(a, a\oplus c) \ge 4 \text { and } \delta _{S_3}(a , b\oplus c) \ge 4\),

  • \(\delta _{S_1}(a, b) \ge 4 \text { and } \delta _{S_2}(b, c) \ge 4\).

In each of these three situations, Proposition 1 exhibits a differential \((\alpha , \beta )\) for \(F\) with \(\delta _F(\alpha , \beta )=16\).    \(\square \)

4.2 Linearity

In order to apply Theorem 4 to the case of \(8\)-bit MISTY network, we need to estimate the best linearity (and \(\mathcal {L}_{\min }\)) for \(4\)-bit S-Boxes. It is well-known that the lowest linearity for a \(4\)-bit permutation is \(8\). But, this result still holds if the S-Box is not bijective.

Lemma 2

Any \(4\)-bit S-Box \(S\) satisfies \(\mathcal {L}(S) \ge 8\).

Proof

Assume that there exists some \(S\) from \(\mathbb {F}_2^4\) into \(\mathbb {F}_2^4\) with \(\mathcal {L}(S) < 8\), i.e., with \(\mathcal {L}(S) \le 6\). Then, all nonzero Boolean components of \(S\), \(S_c: x \mapsto c \cdot S(x)\) with \(c \ne 0\), satisfy \(\mathcal {L}(S_c) \le 6\). From the classification of all Boolean functions of at most \(5\) variables by Berlekamp and Welch [6], we deduce that any \(S_c\), \(c \ne 0\), is affine equivalent either to \(x_1x_2x_3x_4 + x_1x_2 + x_3x_4\) or to \(x_1x_2+x_3x_4\), because these are the only classes of Boolean functions with linearity at most \(6\). Let \(L_1\) (resp. \(L_2\)) denote the set of all nonzero \(c \in \mathbb {F}_2^4\) such that \(S_c\) belongs to the first (resp. second) class. Since the degree is invariant under affine transformations, \(L_1\) (resp. \(L_2\)) corresponds to the components with degree \(4\) (resp. with degree at most \(2\)). The sum of two components of degree at most \(2\) has degree at most \(2\), implying that \(L_2 \cup \{0\}\) is a linear subspace \(V\) of \(\mathbb {F}_2^4\). It follows that the projection of \(S\) on \(V\) can be seen as a function from \(\mathbb {F}_2^4\) into \(\mathbb {F}_2^{\mathrm {dim}V}\) with linearity \(4\), i.e., a bent function. It has been shown by Nyberg [35] that, if a function \(F\) from \(\mathbb {F}_2^n\) into \(\mathbb {F}_2^m\) is bent, then \(m \le n/2\). Therefore, \(\mathrm {dim} V \le 2\). But, the sum of any two components \(S_c\) of degree \(4\) cannot have degree \(4\) since there is a single monomial of degree \(4\) of \(4\) variables. We deduce that, if \(L_1\) contains \(t\) words of weight \(1\) (i.e., if \(S\) has \(t\) coordinates with linearity \(6\)), then

$$\begin{aligned} \#L_2 \ge \left( {\begin{array}{c}t\\ 2\end{array}}\right) + 2^{4-t}-1 > 3, \end{aligned}$$

for all \(0 \le t \le 4\), a contradiction.    \(\square \)

Combined with the previous lemma and with Definition 4, Theorem 4 provides the following lower bound on the linearity of a 3-round MISTY network over \(\mathbb {F}_2^8\).

Corollary 2

Any \(8\)-bit function \(F\) corresponding to a 3-round MISTY network satisfies \(\mathcal {L}(F) \ge 32\).

This bound is of marginal interest since, up to our best knowledge, \(\mathcal {L}(S)=32\) is the lowest known linearity for an \(8\)-bit S-Box. But, once again, the previous lower bound can be improved when focusing on permutations. Indeed, we can exploit that \(\mathcal {L}_{\min }(S) \ge 8\) for any \(4\)-bit permutation:

Lemma 3

For any \(4\)-bit permutation S, the table of linear biases of S has at least one value greater than or equal to \(8\) on every row and column.

Proof

This result is obtained by an exhaustive search over all affine equivalence classes. The \(302\) representatives have been examined, and we could check the result for each of them.    \(\square \)

Using that any \(4\)-bit permutation \(S\) satisfies \(\mathcal {L}(S)\ge 8\) and \(\mathcal {L}_{\min }(S) \ge 8\), we directly deduce from Theorem 4 the following improved lower bound.

Proposition 3

Let \(S_1\), \(S_2\) and \(S_3\) be three 4-bit S-Boxes and let \(F\) be the \(8\)-bit function defined by the corresponding 3-round MISTY network. If any of the three inner S-Boxes is a permutation, then \(\mathcal {L}(F) \ge 64\). Most notably, if \(\mathcal {L}(F) < 64\), then \(\delta (F) \ge 32\).

The last statement in the previous theorem is deduced from the first item in Theorem 3. While it shows that \(3\)-round MISTY with \(\mathcal {L}(F) < 64\) would be of little interest, we show in [15] the following theorem proving that their linearity is at least \(48\).

Theorem 7

Let \(S_1\), \(S_2\) and \(S_3\) be three 4-bit S-Boxes and let \(F\) be the \(8\)-bit function defined by the corresponding 3-round MISTY network. Then \(\mathcal {L}(F) \ge 48\).

We conjecture that any MISTY network with 4-bit inner functions actually satisfies \(\mathcal {L}(F) \ge 64\), but it seems hard to prove without a full classification of the 4-bit functions.

5 Constructions

We now use the previous results to design concrete 8-bit invertible S-Boxes optimized for lightweight implementations. We use Feistel and MISTY networks, and select 4-bit S-Boxes \(S_i\)’s with a low-cost implementation that provide good cryptographic properties of the resulting 8-bit S-Box. Such S-Boxes have been considered as good candidates for many lightweight constructions (e.g. the LS-designs [23]), but their respective merits and their cryptographic properties remained open.

We focus on implementing functions with a low gate count for hardware implementations, and a low instruction count for bit-sliced implementations (for table-based implementations, the table size is independent of the concrete S-Boxes). Moreover, we focus on implementations with a small number of non-linear gates, because non-linear gates are much harder to implement than linear gates in some dedicated settings such as masking [40], multi-party computation, or homomorphic encryption [1]. Bit-slicing can be used as an implementation technique to take advantage of some platform characteristics (for instance, it yields the fastest known implementation of AES on some Intel processors [25]), but it can also be a design criterion. Indeed, using a bit-sliced S-Box allows compact implementations without tables, and good performances both in software and hardware. In addition, S-Boxes implemented in this way are easier to protect against side-channel attacks with masking. Therefore, this approach is used by many lightweight designs such as Serpent [9], Noekeon [16], Keccak [8], Robin and Fantomas [23], Pride [2], Prøst [26], or Ascon [19]. This makes the construction of S-Boxes with a low gate count particularly relevant for lightweight cryptography.

Following the previous sections, the best results we can achieve for an 8-bit invertible S-Box are:

  • With a MISTY network: \(\delta (F) = 16\) and \(\mathcal {L}(F) = 64\).

  • With a Feistel network: \(\delta (F) = 8\) and \(\mathcal {L}(F) = 64\).

We can provide some examples fulfilling these bounds: Example 2 is optimal for the MISTY construction, and an example for the Feistel construction is now exhibited. It is worth noticing that these results explain the compared properties of the S-Boxes obtained by the simulations reported in [23]. Since Feistel networks can reach a better security, we will mostly consider this construction. In this case, the optimal differential uniformity can be reached only if \(S_1, S_3\) are APN, and \(S_2\) is a permutation with \(\delta (S_2) = 4\), as proved in Th. 9 in the full version [15]. Note that, in some other contexts, the MISTY construction presents some advantages since it offers better performance in terms of throughput and latency because the first two S-Boxes can be evaluated in parallel.

5.1 Feistel Network with Low Gate Count and Instruction Count

Rather than choosing S-Boxes \(S_1\), \(S_2\) and \(S_3\) with good properties first, and then searching for an efficient implementation of these S-Boxes (as in [13, 39] for instance), we take the opposite approach, following Ullrich et al. [45]. We build gate descriptions of S-Boxes, and we test their cryptographic properties until we find a good candidate. Indeed, we do not have to specify in advance the 4-bit S-Boxes \(S_1\), \(S_2\), \(S_3\). Instead, we look for a good implementation of a permutation with \(\delta (S) = 4\) for \(S_2\), a good implementation of an APN function for \(S_1\) and \(S_3\), and we test the properties of the resulting Feistel structure. With good probability, this results in a Feistel network F with \(\delta (F) = 8\) and \(\mathcal {L}(F) = 64\).

Following Ullrich et al., we run a search oriented towards bit-sliced implementations. We consider sequences of software instructions, with instructions AND, OR, XOR, NOT, and MOV, using at most 5 registers. This directly translates to a hardware representation: the MOV instruction becomes a branch while the other instructions represent the corresponding gates. There are 85 choices of instructions at each step, but we use an equivalence relation to restrict the search. For \(S_2\), we can directly reuse the results of [45]: they give an optimal implementation of a 4-bit permutation with \(\delta (S) = 4\). For \(S_1\) and \(S_3\), we implemented a version of their algorithm, and searched for APN functions. We found that there is no construction of an APN function with 9 or fewer instructions. There are solutions with 10 instructions, but they have at least 6 non-linear instructions (AND, OR), which is not efficient for a masked implementation. Finally, with 11 instructions, there are constructions of APN functions with 4 non-linear instructions, 5 XOR instructions, and 2 MOV (copy) instructions. This search requires about 6000 core-hours of computation. The branching factor of our search is close to 10, while Ullrich et al. report a branching factor of less than 7; this is because we do not restrict the search to permutations (indeed, 4-bit APN functions are not permutations). This results in a very efficient 8-bit S-Box with good cryptographic properties, using 12 nonlinear gates, and 26 XORs. According to Theorem 9 in [15] and to the following lemma, this is the optimal number of non-linear gates.

Lemma 4

Let S be a 4-bit permutation with \(\delta (S) \le 4\) or a 4-bit APN function. Any implementation of S requires at least 4 non-linear gates.

Proof

If S can be implemented with 3 non-linear gates or less, then the algebraic expression of the output variables is a linear combination of the input variables, and of the 3 polynomials corresponding to the output of the 3 non-linear gates. Therefore, there exists a linear combination of the input and output variables that sums to a constant, i.e. \(\mathcal {L}(S) = 16\). According to the classification of 4-bit permutation in [18], any permutation with \(\delta (S) = 4\) satisfies \(\mathcal {L}(S) \le 12\). Furthermore, the classification of 4-bit APN functions [14] shows that they satisfy \(\mathcal {L}(S) = 8\), which proves the lemma.    \(\square \)

Fig. 3.
figure 3figure 3

Construction of a lightweight S-Box S with a three-round Feistel \((S_1,S_2,S_1)\) satisfying \(\delta (S) = 8\) and \(\mathcal {L}(S) = 64\).

We give an example of such an implementation in Fig. 3, and we compare our results with previous designs in Table 1. In particular, we reach a better differential uniformity than the S-Boxes used in Robin and Fantomas [23], for a small number of extra gates. For comparing the respective merits of the S-Boxes considered in Table 1, we use the fact that, as a simple approximation, the number of rounds needed to reach a fixed security level against differential attacks is proportional to \(1/\log (\delta (S)/256)\), and the implementation cost per round is proportional to the number of non-linear gates (for a bit-sliced software implementation with masking). This allows to derive a simple implementation cost metric for the S-Boxes presented in the last column, taking \(1\) for the AES, and considering only security against differential attacks.

5.2 Unbalanced MISTY Structure

Finally, we consider an alternative to MISTY structures as studied in this paper. Instead of dividing the input into two halves of equal size, we consider unbalanced networks. The idea is to split the 8 input bits in two unequal parts of 3 and 5 bits. Thus, the MISTY network will use only 3- and 5-bit S-Boxes. The advantage of 3- and 5-bit S-Boxes is that invertible S-Boxes with \(\delta =2\) exist, contrarily to the case of 4-bit S-Boxes. We managed to obtain 8-bit S-Boxes S with \(\delta (S)=8\) using unbalanced MISTY networks, which is better than the lower bound \(\delta (S) \ge 16\) proved for balanced MISTY networks. However, this method uses 5-bit S-Boxes, which are more complicated to implement than 4-bit S-Boxes.

Example 3

We consider a 3-round unbalanced MISTY structure, with 5-bit permutations \(S_1, S_3\) and a 3-bit permutation \(S_2\). After \(S_1\) and \(S_3\), the 3-bit \(x_L\) is xored in the 3 MSB of \(x_R\); after \(S_2\) the 3 MSB of the 5-bit \(x_L\) are xored into \(x_L\). The following S-Boxes define an 8-bit S-Box with \(\delta = 8\) and \(\mathcal {L}= 64\):

$$\begin{aligned} S_1 = [&\mathtt {00,01,02,04,03,08,0d,10,05,11,1c,1b,1e,0e,18,0a,}\\&\mathtt {06,13,0b,14,1f,1d,0c,15,12,1a,0f,19,07,16,17,09}]\\ S_2 = [&\mathtt {2,5,6,4,0,1,3,7}]\\ S_3 = [&\mathtt {00,01,02,04,03,08,10,1c,05,0a,1a,12,11,14,1f,1d,}\\&\mathtt {06,15,18,0c,16,0f,19,07,0e,13,0d,17,09,1e,1b,0b}] \end{aligned}$$

This shows that generalizing our results to the unbalanced case, especially for the MISTY construction, may be of interest.

Table 1. Comparison of some 8-bit S-Boxes. \(\delta \) and \(\mathcal {L}\) respectively denote the differential uniformity and the linearity of the S-Box (see Sect. 2.1 for the definitions), the last column presents the relative overall implementation cost (taking 1 for the AES).

6 Conclusion

Our results give a better understanding of the cryptographic properties of lightweight S-Boxes built from smaller S-Boxes. We give a precise description of the best security achievable with a 3-round balanced Feistel or MISTY structure for an 8-bit S-Box, and necessary conditions to reach the bound. Interestingly, the MISTY network cannot offer the same security as the Feistel network for constructing an invertible 8-bit S-Box. Using those results, we describe an 8-bit S-Box S using only 12 non-linear gates and 26 XOR gates, with \(\delta (S) = 8\) and \(\mathcal {L}(S) = 64\). This is the best security that can be achieved with a 3-round Feistel or MISTY structure, and our construction uses the minimal number of non-linear gates to reach this security. This is an improvement over previous proposals, including the S-Boxes used in CRYPTON, Fantomas and Robin, but further work is required to determine whether different structures can provide better S-Boxes.