Differential and Linear properties of vectorial boolean functions based on chi

To evaluate the security of a cryptographic primitive, investigating its resistance against differential and linear cryptanalysis is required. Many modern cryptographic primitives repeatedly apply similar round functions alternated with the addition of round keys or constants. A round function usually consists of a non-linear mapping and a number of linear mappings. The non-linear mapping \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi$$\end{document}χ is used in different cryptographic primitives such as Keccak and Subterranean. An alternative version of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi$$\end{document}χ is used in Ascon and the non-linear layer of Simon has the same differential and linear properties of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi$$\end{document}χ. The mapping \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi$$\end{document}χ can be applied to strings with different lengths. For instance, it can be parallelly applied to small-length strings as in Keccak, where it works on 5-bit strings, or it can be applied to big-length strings as in Subterranean, where it works on a string of length 257. Investigating the differential and linear properties of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi$$\end{document}χ working on alternative lengths of strings, provides useful information to designers to make a better choice for the non-linear layer. Some differential properties of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi$$\end{document}χ have been analyzed in [8] and in this work we provide a revised presentation of them. We then extend this study and we analyze linear propagation properties of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi$$\end{document}χ. Thanks to these additional results, we extend the comparison between the application of parallel instances of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi$$\end{document}χ on small-length strings and the application of a single instance of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi$$\end{document}χ on a big-length string. We show how we can apply the results of this study also to the non-linear layers of Ascon and Simon thanks to their affine-equivalence with \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\chi$$\end{document}χ.


Introduction
Modern ciphers and cryptographic permutations consist of the repeated application of a round function alternated with the addition of round keys or constants.A round function can usually be divided into a non-linear layer and a linear layer.The non-linear layer provides confusion, while the linear layer mixes different parts of the state and provides diffusion.
The design of modern cryptographic primitives like AES [10] and Keccak-f permutation [2] is motivated by the wide trail strategy, that underlies the design of round functions with good resistance against differential and linear cryptanalysis.In a nutshell, it requires the absence of high-probability differential propagation patterns, called differential trails, and high-correlation propagation patterns, called linear trails.
When analyzing differential and linear trails, the differential and linear propagation properties of the non-linear layer play an important role.In particular, one is interested in the probability of the propagation of a difference b at the input of the non-linear layer to a difference a at its output.The same holds for linear cryptanalysis where one exploits the probability of the propagation of an input mask u to an output mask v.An ordered pair of input-output differences (b, a) is called a differential and an ordered pair of input-output masks (u, v) is called a linear approximation.
For a non-linear map f : F n 2 → F n 2 there exist 2 2n differentials and 2 2n linear approximations.The number of input pairs satisfying each differential and linear approximation are usually arranged in a 2 n by 2 n array, called the difference distribution table (DDT) and linear approximation table (LAT), respectively.For small domains the DDT and LAT have manageable sizes so one can build them by brute-force, but it is not the case when the map works on a large dimension.
Keccak-f and some other cryptographic primitives, like Xoodoo [6] and Subterranean [7], make use of the non-linear mapping χ.In the case of χ, one can compute the probability of a differential or a linear approximation, without forming the DDT and LAT but using the method introduced in [5].It means that even if χ works on a big-length string, computing the probability of a differential or linear approximation is still practical.
In addition to the computation of the probability of differentials and linear approximations, determining the number of differentials and linear approximations with a given probability gives useful information about how a non-linear layer may perform in the wide trail strategy: fewer differentials (resp.linear approximations) with high probability results in less opportunity to form differential (resp.linear) trails with high probability over multiple rounds.Therefore, when designing a cipher, it is useful to have the histograms with the number of high probability differentials and linear approximations for the alternative choices of the non-linear layer.While one can easily generate this histogram for the case where χ is applied to small-length strings in parallel, it is challenging when χ is applied to a big-length string.
In [8], we presented a method to compute the number of differentials over χ with a given probability and for arbitrary string lengths.In this work, we complement these results with an analysis of the linear propagation properties through χ and we investigate the differential properties of χ given a specific output difference and the linear properties of χ given a specific input mask.For the sake of completeness, we include in this work a revised explanation of the method and results presented in [8], since we will use them to compare the differential and linear propagation properties of χ.

Our contribution
In this work, we first present a method to compute the number of linear approximations over χ with a given correlation and for arbitrary string lengths.Using this method and the method in [8], we provide a comparison between the distribution of differen-tials and linear approximations in some well known permutations whose non-linear layer is based on χ.For the permutations based on the parallel application of χ on short strings, we provide a comparison with χ applied on a single string whose length is the state size.Then, we provide a comparison between the number of 2-round differential and linear trail cores in Ascon and in Xoodoo and discuss how the results on differentials and linear approximations reflect also on 2-round trail cores.Finally, we study the propagation of 1-bit output differences to input differences and the propagation of 1-bit input masks to output masks.We discuss how this study can be applied to the non-linear layers of Simon [1] and Ascon [12], due to their similarity with the mapping χ.

Organization of the paper
In Section 2, we first provide our terminology and recall the specification of the mapping χ and the non-linear layers of Simon and Ascon.We then recall the main concepts of differential and linear cryptanalysis and explain why we can examine the properties of the non-linear layers of Simon and Ascon in the same way as we do for χ.In Section 4, we give a revised explanation of the results presented in [8] on how to compute distribution of differentials over χ.In Section 5, we investigate the distribution of linear approximations over χ.In Section 6, we first present a comparison between differential and linear properties of χ and the number of 2-round differential and linear trail cores.Then we investigate the propagation of 1-bit output differences and input masks.Finally, in Section 7, we provide some final remarks.

Preliminaries
In this section, we first briefly introduce the terminologies that we use in this paper.Then, we recall the specification of the non-linear mapping χ, the round function and non-linear layer of Simon, and the non-linear layer of Ascon.

Terminology
Let s be a binary string, we denote its i-th bit by s i , where we start indexing from 0. Therefore, i ∈ {0, 1, . . ., |s| − 1} when |s| denotes the length of s.
Indexing of bits in a string outside the range [0, |s| − 1] is allowed by reducing the index modulo |s|.This allows us to consider circular strings, that means the first bit s 0 and last bit s |s|−1 are neighbors.We call such strings circles.A string s is a sub-string of circular string As an example, we say s = 100011 is a sub-string of circular string s = 0111100 since s j = s j+4 for all j ∈ [0, 5].
We use s ≪ t to indicate the circular rotation of a string s that moves bit in position i to position i + t.This notation is commonly used when s is seen as a CPU word where the bit at index 0 is the right-most bit.Notice that in our figures, we depict bits as disposed on a Cartesian axis with the origin on the left.Therefore, in our figures bit 0 is on the left, unless otherwise specified.
We write s s for the concatenation of two strings s and s , and we use (s) m for the concatenation of m copies of s: s s . . .s. Hence, the notation (1) m represents an all-one string of length m that we call a 1-run.A 1-run in a string should be preceded and followed by a 0-bit, except when there is no zero in the string.In this case, we say that the string contains a single 1-run.Let s i ∈ F 2 be a bit of a string s, then we say s i is an active bit if s i = 1, and is a passive bit otherwise.Then, the Hamming weight of a string s ∈ F n 2 , denoted by h, is the number of active bits in s.

Specification of
The mapping χ is used as non-linear layer in different cryptographic ciphers, like Keccak, Xoodoo, and Subterranean.
The mapping χ can be seen as the application of parallel instances of the mapping χ to an n-bit state partitioned in n circles of length .We refer to such non-linear mapping as a composite χ mapping when < n.This is the case for Keccak-f , where = 5, and Xoodoo, where = 3.Otherwise, we refer to it as a single-circle χ mapping, that is when a single instance of χ operates on the whole state and = n.This is the case for Subterranean, where = n = 257.
Due to the fact that χ is translation-invariant [5], it is possible to define it as a local map.
Definition 1 (χ ) The mapping χ is a transformation of F 2 with local map where x denotes the input of χ , y = χ (x) its output, and all indices are taken modulo .
An illustration of χ is given in Fig. 1.
Equivalently, the mapping χ can be written as: (2)

Simon's non-linear layer
The Simon cipher is a balanced Feistel network operating on a block of length 2n, where n ∈ {32, 48, 64, 96, 128}.The round function R k of Simon, illustrated in Fig. 2, operates on a state consisting of two parts x and w, each of length n, in the following way: with the function g defined as

Ascon's non-linear layer
The Ascon permutation [11] is at the basis of all members of the Ascon cipher suite and is also used in the authenticated encryption scheme Isap.
The non-linear layer of the Ascon permutation is a composite mapping that consists in the parallel application of a 5-bit S-box S, which is depicted in Fig. 3.The non-linear part of the S-box S is based on χ 5 .It has the same expression of χ 5 but with opposite bit ordering compared to what is used in Keccak.In fact, using the Ascon notation, bit x 0 denotes the Fig. 3 Ascon's S-box S most significant bit in the 5-tuple of bits.We denote the version of χ using such opposite ordering as χ .More in details, we have: Therefore, S can be described as χ 5 preceded and followed by two linear mappings A and B, both consisting of 3 bitwise additions:

Propagation through non-linear layers
In this section, we first recall the main concepts used in differential and linear cryptanalysis.Then, we show that χ and the non-linear layers of Simon and Ascon are extended-affine equivalent, which allows us to investigate their differential and linear properties in a similar way.
In what follows, we make use of the extended-affine equivalence property [3,17].
Definition 2 (Extended-affine equivalence) Two functions f : 2 are extended-affine equivalent (EA-equivalent) if there exist two affine permutations The differential spectrum over a function f is defined as the number of occurrences of each number in the DDT, and is denoted by D f .Equivalently, the differential spectrum can be defined as the graph representing the number of differentials with a given DP for each DP.Definition 4 (Differential spectrum) The differential spectrum of a function f : Based on [4,13], the following lemma holds.
Lemma 1 Two EA-equivalent functions have the same differential spectrum.123

Linear propagation
A pair of masks (u, v) with u at the input and v at the output of a vectorial boolean function f : F n 2 → F n 2 is called linear approximation and satisfies the following relation: Linear cryptanalysis exploits the correlation of linear approximations.
Definition 5 (Correlation) The correlation of a linear approximation (u, v) over a function f : and is defined as The correlations of all linear approximations over a vectorial boolean function f are usually arranged in a 2 n by 2 n array, called the linear approximation table (LAT).Clearly, correlation can be a positive or negative number.The extended Walsh spectrum of a function f is defined as the number of occurrences of the absolute value of each number in the LAT and is denoted by W f .Definition 6 (Extended Walsh spectrum) The extended Walsh spectrum of a function f : Based on [4,13], the following lemma holds.
Lemma 2 Two EA-equivalent functions have the same extended Walsh spectrum.

Implications for , SIMON and ASCON
The mapping χ is EA-equivalent to the map f (x) = x(x ≪ −1).Using Definition 2, we can take Similarly, we can show that also the map g of Simon is EA-equivalent to the map f .First, we can observe that g is EA-equivalent to the map g (x) = x(x ≪ 7) with C(x) = x ≪ 2 and B(x) = x ≪ −1.We can convert the shift by 7 in g to the shift by -1 in f , by taking for A a multiplicative shift and for B its inverse.This is only possible if the length of the circular state is not a multiple of 7, which is the case for the state sizes used in Simon.
Based on Eq. 4, the S-box S of Ascon is EA-equivalent to χ 5 .Similarly to what we observed for χ and g, we can convert χ 5 into f .It follows that for all these maps, it is sufficient to investigate the differential spectrum and the extended Walsh spectrum of one of them.

Distribution of differentials over
In this section, we report the method presented in [8] to build the differential spectrum of the mapping χ, which is based on counting the number of differentials with a given weight.To this end, we first recall the definition of restriction weight of a differential and the method to compute it over χ as introduced in [5, Sect.6.9.1].Then, we present the method to compute the number of differentials with a given weight w over χ.In what follows, we use the term weight instead of restriction weight when it is clear from the context that we are talking about differentials.
As shown in [5, Sect.6.9], since the mapping χ has algebraic degree 2, the weight of any differential (b, a) over χ is fully determined by b.Therefore, we talk about the weight of a difference at the input of χ.When the mapping χ is composed, the weight of a differential can be computed as the sum of the weights of the differentials over the mappings χ composing χ.A method to compute the weight over χ is given in the following proposition.
Proposition 1 [5,Sect. 6.9] Let b ∈ F 2 be a difference at the input of χ , and r the number of sub-strings 001 in b.The restriction weight of b is given by

Number of differentials over with a given weight
Clearly, there is only one fully active input difference, and only one fully passive input difference.Therefore, we only consider h = and h = 0. We denote the number of -bit input differences with weight w by N( , w).The number of differentials with weight w is 2 w N( , w), as each input difference with weight w leads to 2 w differences at the output of χ [5, Sect.6.9].
With a composite χ mapping consisting of q > 1 applications of χ , we can compute the number of differentials with weight w by q-fold convolution using the following recursion formula: Computing the value of N( , w) is easy for small or big values of w.
Computing N( , w) for an arbitrary and w is not easy.Therefore, we introduce the function N 3 ( , h, r ) that computes the number of strings of length with Hamming weight h and containing r 001 sub-strings.Then, the number of -bit strings with weight w can be written as Here, r is bounded by w/2 since w = h + r , and there cannot be more 001 sub-strings in a string than its Hamming weight, so r ≤ h.

Computing N 3 ( , h, r)
In general, N 3 ( , h, r ) is not easy to compute.It is non-zero for a limited range of parameters.In particular, N 3 ( , h, r ) = 0 if h + 2r > : as any active bit consumes one bit position and every 001 consumes two more bit positions out of .r > h: as there cannot be more 001 sub-strings than active bits.
r = 0 and 2h < : as it is not possible to position less than /2 active bits without leaving a gap of two zeroes.
For the other cases, we observe that, since the weight of a string s only depends on its Hamming weight and the number of 001 sub-strings in it, deleting a number of specific zeros in s will not affect its weight.If a string exhibits a sub-string 101, shortening it by removing the zero in the middle leaves the weight intact as it leaves the Hamming weight and r invariant.Definition 8 (Hole) We call the zero in 101 a hole and we denote the number of holes in a string by x.
If a string exhibits a sub-string 000, shortening it by removing the leading zero leaves the weight intact as it leaves the Hamming weight and r invariant.Definition 9 (Pause) We call the leading zero in 000 a pause and denote the number of pauses in a string by y.

Now we can define the minimal difference as follows.
Definition 10 (Minimal difference) An input difference of χ without pauses and holes is called a minimal difference.That is, it satisfies x = 0 and y = 0.
A minimal difference can be written either as a single 1-run, or as a sequence of 1-runs interleaved with sub-strings 00.
Any string s is associated to a unique minimal difference.To prove this, we can observe that the minimal string can be uniquely determined by removing holes and pauses from s. First, s is transformed by removing holes with the recursive procedure removeHoles in Algorithm 1.This procedure scans s and removes the middle 0 from the first 101 sub-string that is encountered.This procedure stops when the string does not contain any more 101 sub-strings.Then, s is transformed by removing pauses by applying the recursive procedure removePauses in Algorithm 1.This procedure scans s and removes the leading 0 from the first sub-string 000 it encounters.This procedure stops when the string does not contain any 000 sub-strings.

Example 2
Let s = 010010101000001000.First, holes are removed.Since s 4 s 5 s 6 = 101, then s 5 is removed obtaining s = 01001101000001000.Similarly, since s 5 s 6 s 7 = 101, then s 6 is removed obtaining s = 0100111000001000.Since no more 101 sub-strings are contained in s, pauses are removed from s. Since s 7 s 8 s 9 = 000, then s 7 is removed obtaining s = 010011100001000.Since s 7 s 8 s 9 = 000 again, then s 7 is removed obtaining s = 01001110001000.Since s 7 s 8 s 9 = 000 again, then s 7 is removed obtaining s = 0100111001000.Then, since s 10 s 11 s 12 = 000, then s 10 is removed obtaining s = 010011100100.Finally, since s 10 s 11 s 0 = 000 again, s 10 is removed obtaining s = 01001110010.Since s does not contain any 000 sub-string, s is a minimal difference.

Algorithm 1
Computing the minimal difference of a string s.
remove pause in position i return removePauses(s) return end procedure Lemma 3 For a string of length , Hamming weight h, and containing r 001 sub-strings, x holes and y pauses, the following equivalence holds: Proof The length of a string is the sum of the number of active bits and the number of passive bits.The former is simply the Hamming weight h of the string.The latter is the number of passive bits in each 001 sub-string (i.e., 2) plus the number of passive bits that are removed from the string when reducing it to its minimal difference.Namely, the middle bit of each 101 sub-string and the leading bit of each 000 sub-string.This gives = h + y + x + 2r .

Example 3
Let s = 010010101000001000 with = 18 as in Example 2. The Hamming weight of s is h = 5 and the number of 000 sub-strings is 5 so y = 5.The number of 101 sub-strings is 2 so x = 2 and finally the number of 001 sub-strings is 3. Then we have = 5 + 5 + 2 + 2 × 3 = 18 that is indeed the length of the string s.
We denote the number of strings with Hamming weight h and containing r 001 strings, y pauses and x holes by N 4 (h, r , y, x).Lemma 3 implies that

Computing N 4 (h, r, y, x)
Since each string can be associated to a unique minimal difference, it follows that the set of strings can be partitioned in classes, where strings in the same class have the same associated minimal difference.Strings in the same class can be built by adding holes and pauses to the corresponding minimal difference in all possible ways.The number of ways to add x holes and y pauses to a minimal difference depends on its Hamming weight and its number of 001 sub-strings, but also on the value of its leading and trailing bits.Namely, it depends on whether the minimal string has a 11 sub-string or a 001 sub-string that spans the boundaries.

Example 4
Let s = 1100111001 be a minimal difference of length = 10 and x = 1.The hole can be placed between any pair of adjacent active bits.But if we consider the pair at indexes ( − 1, 0), then the hole can be placed either at the end of the string or at its beginning.In the former case we obtain the string 11001110010 and in the latter case the string 01100111001.

Example 5
Let s = 011100110 be a minimal difference of length = 9 and y = 1.The unique pause can be placed before any 001 sub-string.If we consider the 001 sub-string at indexes ( − 1, 0, 1), then the pause can be placed only between positions − 2 and − 1 giving the string 0111001100.Similarly, let s = 111001100 be a minimal difference of length = 9 and y = 1.If we consider the 001 sub-string at indexes ( − 2, − 1, 0), then the pause can be placed only between positions − 3 and − 2 giving the string 1110011000.

Example 6
Let s = 0011111 be a minimal difference of length = 7 and y = 1.If we consider the 001 sub-string at indexes (0, 1, 2), then the pause can be placed between positions − 1 and 0 in two different ways, giving the strings 00011111 and 00111110.
Similarly, for the same string if y = 2, we can build the strings 000011111, 000111110, 001111100.
We denote the pair (s 0 , s −1 ) formed by the leading bit and the trailing bit of a minimal difference s by S.
Since s is minimal, S = (0, 0) and S = (1, 0) imply that there is a 001 sub-string that crosses the boundaries as in Example 5, while S = (0, 1) implies that the string starts with a 001 sub-string as in Example 6.Finally, S = (1, 1) implies that there is a 11 sub-string that crosses the boundary as in Example 4.
We denote the number of minimal differences with Hamming weight h, r 001 sub-strings and given S by N min (h, r , S).
It holds that: where α(h, r , x, S) denotes the number of ways to add x holes and β(h, r , y, S) the number of ways to add y pauses to a minimal state of length with Hamming weight h, r 001 sub-strings, and leading and trailing bits specified by S.
The factors in the right hand side of (Eq.14) are summarized in Table 1 and we recall how we derived them in the remaining part of this section as presented in [8].

Proposition 2 The number of minimal differences with Hamming weight h and containing r 001 sub-strings is
.
Table 1 Combinatorial expressions to compute the number of minimal states of length with Hamming weight h, r 001 sub-strings and leading and trailing bits specified by S, and the number of ways to add x holes and y pauses to them Proof It is the number of ways of putting r − 1 pairs of passive bits between the h − 1 pairs of active bits.The position of one 001 sub-string is in fact specified by S.

Proposition 3 The number of ways to add x holes to a minimal difference with Hamming weight h and containing r 001 sub-strings is h−r
x when S = (1, 1).
Proof It is the number of ways to distribute x holes over h − r positions, where each position can have at most one hole.Now, we just need to add pauses to the created strings.

Proposition 4
The number of ways to add y pauses to a string with Hamming weight h and containing r 001 sub-strings and x holes is y+r y + y+r −1 y when S = (1, 1).
Proof Here we have two cases: -S = (0, 1): β(h, r , y, S) is the number of ways to distribute y pauses over r positions, where there are no restrictions on the number of pauses per position.Since S = (0, 1) implies that the minimal difference starts with a 001 sub-string, then the pauses that are put before it can be placed either at the beginning of the string or at its end, as shown in Example 6.It means that there are actually r + 1 positions to place the y pauses.It follows that β(h, r , y, S) , which is the number of ways to distribute y pauses over r positions, where there are no restrictions on the number of pauses per position.

Proposition 5
The number of minimal differences with Hamming weight h and containing r 001 sub-strings is h−1 r when S = (1, 1).
Proof It is the number of ways of putting r pairs of passive bits between the h − 1 pairs of active bits remaining after excluding the pair at the boundaries.

Proposition 6 The number of ways to add x holes to a minimal difference with Hamming weight h and containing r 001 sub-strings is
x−1 when S = (1, 1).
Proof α(h, r , x, S) is the number of ways to distribute x holes over h − r positions, where each position can have at most one hole.Since the minimal state starts with a 1 and ends with a 1 then the hole that is placed between these two ones can be placed either at the beginning of the state or at its end, as shown in Example 4. For any other pair of active bits, there is a unique way to put the hole.The total count is thus is the number of ways to distribute x − K holes between the h − r − 1 pairs of ones remaining after excluding the pair across the boundaries.Now, we just need to add pauses to the created strings.

Proposition 7
The number of ways to add y pauses to a string with Hamming weight h and containing r 001 sub-strings and x holes is y+r −1 y when S = (1, 1).
Proof It is the number of ways to distribute y pauses over r positions, where there are no restrictions on the number of pauses per position.

Distribution of linear approximations over
In this section, we first recall the method to compute correlation weight of a linear approximation over χ as introduced in [5, Sect.6.9.1].Then, we provide a method to compute the number of linear approximations with a given correlation weight w over χ and present a proof for it.

Definition 11 (Correlation weight)
The correlation weight of a linear approximation (u, v) for a boolean function f : F n 2 → F n 2 , denoted as w c (u, v), is defined as In what follows, when it is clear from the context that we are talking about linear approximation over χ , we simply use weight instead of correlation weight.
We call 1-runs of odd length odd-runs and denote the number of odd-runs in a string by o.We also use the term even-run for a 1-run of even length.As shown in [5, Sect.6.9], since the algebraic degree of χ is two, the weight of any linear approximation over χ is fully determined by the output mask, and it can be computed using Proposition 8.

Proposition 8
Given an -bit mask v with Hamming weight h and o odd-runs at the output of χ ( ≥ 3), its weight is given by:

Number of linear approximations over with a given weight
Clearly, there is only one fully active mask (h = ), and only one fully passive mask (h = 0).
In what follows, we only consider cases where h = and h = 0. We denote the number of output masks of χ with weight w by L( , w).Then, the number of linear approximations with weight w is simply 2 w L( , w), as each output mask with weight w is correlated to 2 w masks at the input of χ [5, Sect.6.9].
Similar to the differential case, if the χ mapping is composed by q > 1 applications of χ , we efficiently compute the number of linear approximations with weight w by q-fold convolution using the following recursion: To compute L( , w), we first provide the following propositions.

Proposition 9 Given an output mask with Hamming weight h and containing o odd-runs it holds that h
Proof Let us denote by 2e the total number of active bits in even-runs, and by 2d[i] + 1 the length of the i-th odd-run in an output mask.Then, the Hamming weight of the output mask is: Based on Propositions 8 and 9 the following holds.Since each 1-run is preceded and followed by a 0-bit, the number of odd-runs is at most equal to the number of passive bits in the output mask.The length of a given output mask is the number of passive bits plus active bits.Hence, h + o ≤ and the weight is upper bounded by .
Corollary 2 For each mask v at the output of χ the following holds: Based on Proposition 8, if v has one active bit, then h + o = 1 + 1 = 2; if v has two or more active bits, then w c (v) = h + o ≥ h ≥ 2. On the other hand, the weight is an even number that is upper bounded by .
Computing the value of L( , w) is easy for small or big weights w.
Example 7 An output mask with weight w = 2 can be: -one of the translated versions of 1(0) −1 ; or -one of the translated versions of 11(0 Therefore, in this case, we have Example 8 Output masks with even length and maximum weight w = have the following form: -two translated versions of output masks of the form (1 ) /2 , where starred bits can be either 0 or 1, with the exception of the fully active mask.
Therefore, for an even , we have In general, computing the value of L( , w) is not easy for arbitrary and w.To simplify this, we introduce a new function L 3 ( , h, o) that computes the number of output masks of length with Hamming weight h and containing o odd-runs.Then, the number of -bit masks with weight w for w ≤ can be written as Here, o is bounded by w/2 since w = h + o, and there cannot be more odd-runs than active bits o ≤ h.

Computing L 3 ( , h, o)
In general, L 3 ( , h, o) is not easy to compute.It is non-zero for a limited range of parameters.In particular, L 3 ( , h, o) = 0 if h = o mod 2: see Proposition 9.
h +o > +1 and is an odd number: the weight is upper bounded by so, for a non-fully active mask h + o ≤ , and for a fully active mask in this case h + o = + 1.
h + o > and is an even number: for a non-fully active mask h + o ≤ , and for a fully active mask in this case h + o = .
o > h: as there cannot be more odd-runs than active bits.
For the other cases, we use the following procedure to calculate L 3 ( , h, r ).Since the weight only depends on the Hamming weight and the number of odd-runs, deleting a number of specific zeros will not affect the weight.To compute L 3 ( , h, o), we partition the set into subsets characterized by the specific zeros called gaps and chains.
If a string exhibits two consecutive zeros, shortening it by removing the leading zero leaves the weight intact since it leaves the Hamming weight and the number of odd-runs invariant.After shortening all two consecutive zeros by deleting the leading zero, if the obtained string starts with an even-run and ends with a single zero, e.g.11010, deleting the rightmost zero leaves the weight intact.
Definition 12 (Gap) We call the leading zero in two consecutive zeros a gap.Let s be a string that does not contain two consecutive zeros, then if s starts with an even-run and ends with 0, we also call the ending zero a gap.We denote the number of gaps in a string by g.
We call a string without gaps, a gap-free string.In a gap-free string, there are only evenruns and odd-runs that are surrounded by single 0s.Deleting the 0 on the left side of an even-run does not affect the weight since the Hamming weight and the number of odd-runs remain constant.
Definition 13 (Chain) We call a zero at the left side of an even-run a chain and denote the number of chains by c. Definition 14 (Minimal mask) An output mask without gaps and chains is called a minimal mask.
Any string s is associated to a unique minimal mask.To prove this we can observe that the minimal mask can be uniquely determined by removing gaps and chains from s. First, s is transformed by removing gaps by applying the recursive procedure removeGaps given in Algorithm 2. This procedure scans s and removes the leading 0 from the first sub-string 00 it encounters.This procedure stops when the string does not contain any 00 sub-strings.Then, s is transformed by removing chains by applying the recursive procedure removeChains given in Algorithm 2. This procedure scans s and removes the 0 on the left side of even-runs from the first such 0 that is encountered.This procedure stops when the string does not contain any more 0 on the left side of even-runs.
Based on the definition of the minimal mask, the following corollary holds.
Corollary 3 Given an output mask that is not fully active or fully passive, its minimal mask can be written either as a single even-run, or as odd-runs preceded and followed by a 0-bit.

Example 9
Let s = 0100101111001.First, gaps are removed.Since s 2 s 3 = 00, then s 2 is removed obtaining s = 010101111001.Similarly, since s 9 s 10 = 00, then s 9 is removed obtaining s = 01010111101.Since no more 00 sub-strings are contained in s, chains are removed in s.
Since s 4 = 0 and it is located on the left side of an even-run, then s 4 is removed obtaining s = 0101111101.
Since s = 0101111101 does not contain any chain, it is a minimal mask that contains only odd-runs preceded and followed by a 0-bit as stated in Corollary 3.

Proposition 10 Given an output mask that is not fully active or fully passive, the number of passive bits in its minimal mask is o.
Proof Due to Corollary 3, the number of passive bits in a minimal mask equals the number of odd-runs in it.Given an output mask with o odd-runs, since deleting gaps and chains does not change the number of odd-runs, the number of odd-runs in its minimal mask is o.

Lemma 4 For a non-fully active mask of length , Hamming weight h and containing g gaps, c chains, and o odd-runs we have:
Proof The length of a mask is the sum of the length of its minimal mask and the number of gaps and chains.The length of the minimal mask is the sum of its Hamming weight and the number of its passive bits o (see Proposition 10).

Example 10
Let s = 0100101111001 with = 13 as in Example 9.The Hamming weight of s is h = 7 and the number of chains is c = 1.The number of gaps is g = 2 and finally the number of odd-runs is 3.We have = 7 + 1 + 2 + 3 = 13 that is indeed the length of the string s.
We denote the number of strings of length with Hamming weight h and containing o odd-runs, g gaps and c chains by L 4 (h, o, g, c).Lemma 4 implies that (18)

Computing L 4 (h, o, g, c)
Since each string can be associated to a unique minimal mask, it follows that the set of strings can be partitioned in classes, where strings in the same class have the same associated minimal masks.Strings in the same class can be built by adding gaps and chains to the corresponding minimal mask in all possible ways.We start by generating all the possible minimal masks of length h + o with Hamming weight h, o odd-runs and c = g = 0.Then, we add for each minimal mask c chains to build all possible gap-free strings.Then, we add g gaps to each gap-free string in all possible ways.
Before going on, we need to provide the following definition.
Definition 15 (Even start and odd start masks) Without considering the circularity of the string, if a mask starts with 0 or an even-run, we call it even-start mask, otherwise an odd-start mask.
Example 11 A mask s = 110101 is an even-start mask since (without considering the circularity) it starts with an even-run, namely the 11 sub-string.A mask s = 101011 is an odd-start mask since (without considering the circularity) it starts with an odd-run, namely the 1 sub-string.
Without considering the circularity of the string, the minimal mask associated to an even-start mask (odd-start mask) should start with 0 or an even-run (odd-run). .We say o + 1 positions since we have o odd-runs, and we can also put 11-strings in the beginning of the string that is also attached to the rightmost odd-run.

Proposition 11 The number of minimal masks with Hamming weight h, containing o oddruns, and that form even-start masks is
• odd-start mask: we have again (h+o)/2 o because the number of 11-strings and positions equals the even-start mask case, since we have o odd-runs and we can also put 11-strings in the end of the string that is also attached to the leftmost odd-run.Now, we compute the number of gap-free strings by adding c chains to minimal masks.

Proposition 12 The number of ways to add c chains to a minimal mask with Hamming weight h and o odd-runs is
for both cases where the minimal mask forms even-start masks or odd-start masks.
Proof The number of ways to put c single chains at the left side of (h − o)/2 11-strings is .
We only need to add g gaps to gap-free strings to compute L 4 (h, o, g, c).

Proposition 13 The number of ways to add g gaps to a gap-free string with Hamming weight h and containing o odd-runs and c chains is c+o+g
(19) We experimentally verified the correctness of Eq. 19 for ∈ [3,32] by exhaustively generating all -bit states, computing their weight using Proposition 8 and checking that the number of states with given weight corresponds to the number obtained by applying our formula.

Comparing differential and linear properties of
In this section, we first investigate the distribution of differentials and linear approximations for some primitives whose non-linear layer is based on χ.For non-linear layers based on composite χ, we provide a comparison between their original definition and single-circle χ mapping, that is when a single χ operates on the whole n-bit state, so that = n.Then, we present a comparison between the number of 2-round differential and linear trail cores in Xoodoo that uses χ 3 and Ascon that uses S that is a variant of χ 5 .After that, we investigate the differential properties of χ for a given output difference, and the linear properties of χ for a given input mask.

Differentials and linear approximations
We use the results presented in the previous sections to compute the distribution of differentials and linear approximations in some well known cryptographic primitives, i.e., Subterranean, Simon, Xoodoo, Keccak-f [400], and Ascon, whose non-linear layers are based on χ.
For Xoodoo, Keccak-f [400], and Ascon, that are based on composite χ, we compare the obtained results with the distribution of differentials and linear approximations of the mapping χ when has the state size of such permutations.We underline the fact that we don't pretend to replace the non-linear layers of such permutations with single-circle χ, as this implies further analysis, which goes beyond the goal of this work.Our goal is to provide a metric for the comparison of these two design approaches, i.e. the usage of composite χ vs single-circle χ.We chose to use the same state size of the aforementioned permutations for single-circle χ as an example, but we don't expect the figures to change significantly when changing the circle size by one or a few more bits.

257-bit state as in SUBTERRANEAN
We applied the methods introduced in this paper to compute the number of differentials and linear approximations up to a given weight for Subterranean, where χ operates on the full state of 257 bits.In Fig. 4a we report the obtained results for w ≤ 257.Both curves appear flat on the right side because the curves of the number of differentials and linear approximations with given weight are monotonically decreasing after w = 187 and w = 214 respectively and their contribution becomes negligible.We can notice that the number of linear approximations up to a given (even) weight is in general higher than the number of differentials.To better show this, we zoom on the values up to weight w ≤ 32 in Fig. 4b.

128-bit state as in SIMON
We consider Simon with block length n = 128 and compute the number of differentials and linear approximations for g using χ 128 .In Fig. 5a, we report the obtained results for w ≤ 128.Notice that g acts on only one block of the state, i.e. x.It follows that each differential over g corresponds to 2 128 round differentials, since the difference in w can be freely chosen.
As expected, the trend is similar to the case of χ 257 .Both curves in Fig. 5a appear flat on the right side because the curves of the number of differentials and linear approximations with given weight are monotonically decreasing after w = 93 and w = 108 respectively and their contribution becomes negligible.The number of linear approximations up to a given (even) weight is in general higher than the number of differentials.To better show this, we zoom on the values up to weight w ≤ 32 in Fig. 5b.

384-bit state as in XOODOO
In the permutation Xoodoo, the state is composed by 384 bits arranged in an array of shape 4 × 3 × 32.The non-linear layer is a composite χ mapping of 128 circles of length = 3.To compute the number of differentials and linear approximations in Xoodoo, we can use Eqs.11 and 16.However, we can observe that since both the restriction and correlation weight of any 3-bit circle is 2, then the weight is always even.Therefore, N(128 × 3, w) = L(128 × 3, w) = 0 for w odd.For w even, that is the number of ways to choose w/2 columns among the 128 in the state, multiplied by the possible values of such columns.The number of differentials and linear approximations with restriction weight w is then 2 w • 7 To compute the number of differentials and linear approximations for χ 384 , we used the formulas introduced in this paper.
We depict in Fig. 6a the number of differentials and linear approximations with weight smaller than a given weight w for both composite χ and single-circle χ.Since there are no differentials and linear approximations with weight bigger than 256 in Xoodoo, the Fig. 6 Number of linear approximations and differentials up to a given weight w for the case of 128 parallel χ 3 as in Xoodoo, and the case of single-circle χ 384 histogram for parallel χ 3 becomes flat after w = 256.The histograms corresponding to the case of single-circle χ 384 appear flat toward the end because the curve of the number of differentials and linear approximations with given weight are monotonically decreasing after w = 288 and w = 288 respectively and their contribution is negligible.We can notice that the number of differentials and linear approximations with high probability is always smaller for the single-circle case.To better show it, we zoom on the values corresponding to weight up to 32 in Fig. 6b.For instance, the number of differentials and linear approximations with weight up to w = 32 is ≈ 2 143.264 for composite χ.While for single-circle χ, the number of differentials is ≈ 2 130.936 (i.e., around 5,000 times smaller than the composite case) and the number of linear approximations is ≈ 2 139.720 (i.e., only 11.7 times smaller).
Figure 7a depicts the ratio between the number of differentials up to a given weight for the case of composite χ over the case of single-circle χ 384 and the ratio between the number of linear approximations.Since there are no differentials with odd weight for the case of composite χ, for all k ∈ {0, 1, . . .127} the number of differentials with weight smaller than 2k and 2k + 1 is the same and the curve presents a zigzag trend.To better show it, we zoom on the values up to weight 32 in Fig. 7b.We can also observe that for high probabilities, the ratio between the number of linear approximations in the two cases is not so large as the ratio between the number of differentials.In Keccak-f [400], the state is organized as an array of 5 × 5 × 16 bits.The non-linear layer is a composite χ mapping of 80 circles of length 5, i.e., 80 parallel χ 5 .
In Fig. 8a, we report the number of differentials and linear approximations up to a given weight for composite χ and single-circle χ 400 .Compared to the case of χ 3 and χ 384 , we can observe that now the two curves of differentials and the two curves of linear approximations are closer to each other, with the curves for the case of 80 parallel χ 5 slightly above the others.This can be better noticed in Fig. 8b, where we focus on the number of differentials and linear approximations up to weight w ≤ 32.For example, the number of differentials with weight up to w = 32 is ≈ 2 133.064 for composite χ and ≈ 2 131.787 for single-circle χ.Namely, the latter is around 2.4 times smaller than the former.The number of linear approximations is ≈ 2 140.764 for composite χ and ≈ 2 140.719 for single-circle χ and they almost coincide.The ratio between the two cases is depicted in Fig. 9a for all w ≤ 400, with a focus on w ≤ 32 in Fig. 9a.
Since the non-linear layer of Ascon is based on χ 5 , we have similar results when we compare composite χ consisting of 64 applications of χ 5 and χ 320 .

Number of 2-round differential and linear trail cores
To perform a dedicated trail search as in [15,16], the first step is to generate all possible 2round trail cores up to a specific weight.Let us denote by λ the linear layer of a cryptographic scheme.Then, a 2-round differential trail core consists of a difference a i at the input of λ, and its corresponding difference b i at the output of λ, that we represent as a i λ − → b i .The weight of a given 2-round differential trail core is computed as w rev (a i ) + w r (b i ) where w rev (a i ) represents the minimum weight over all states b i−1 that are compatible with a i through the inverse of the non-linear layer.The weight of a 2-round differential trail core thus lower bounds the weight of all 2-round differential trails with intermediate differences a i and b i .A 2-round linear trail core is also defined in a similar way as v i λ T − → u i with v i the input of λ T and u i its output.
In Fig. 10 we report the number of 2-round linear and differential trail cores with weight w for Xoodoo and Ascon, based on the numbers reported in [9,14].We can notice that these results reflect what we observed in Section 6.1.In fact, in Fig. 6 we saw that the number of differentials and linear approximations is the same when the scheme uses parallel χ 3 .In contrast, as can be seen in Fig. 8, the number of linear approximations is higher than the number of differentials when parallel χ 5 are used.This results in a kind of balance in the number of linear and differential 2-round trail cores in Xoodoo, and a meaningful difference between these two numbers in Ascon.

Differential propagation over given an output difference
Given a difference at the input of χ , the way to generate all its output differences is given in [5].For a given difference at the output of χ, it is possible to build all input differences by brute-force when χ applies to a short string, but for big strings it is not trivial.To have a better understanding of the differential properties of χ for a given output difference, we provide a simple example in this section.
We look into the simplest active string, namely a string with a single active bit at the output of χ and investigate the differential properties of χ in the backward direction.
A difference b at the input of χ is called compatible with a difference a at the output of χ if DP(b, a) > 0. For a single active bit difference b, we form a tree of all compatible input differences a's where each node of the tree represents an input difference.The children of a node are generated by adding active bit(s) to that node.Therefore, a specific part of a node remains unchanged while going to the children and descendant nodes.We call the bits in this part the set bits.To make our investigation simpler, we assume that the length of the circle is large enough ( 1), so that there are always at least two passive bits at the right side of the active bit(s) of all nodes in the tree.
Figure 11 represents the tree of the set bits of all input differences that are compatible with a single active bit output difference, up to restriction weight 6.The position of the rightmost active bit of each node is the same as the position of the single active bit of the output and there are always two consecutive zeros at the right side of this active bit.For simplicity, we removed the two zeros at the right side of the set bits in all nodes.For example, the set bits of the first node are (100) but we only depict a single (1).
Each node in Fig. 11 is built by adding -a (10) to the left side of its parent's set bits, or -a (1) to the left side of its parent's set bits except for the case where its parent node has a pattern (101) on its left.
That can be stated formally as in the following proposition.
Proposition 14 Let a be a single active bit output difference and b's be its compatible input differences with at least one active bit at the same position as the single active bit in the output difference followed by two zeros.When generating the tree of all possible b's, adding the following patterns to the left side of a parent node is forbidden: -two active bits at b with at least two zeros in between e.g. ( 1001), (10001); -(1101) pattern at b.

Proof
Since the difference at a should have only one active bit, we need to find compatible b's that add no more active bits to a. Based on [7, Propositions 6 and 7], two active bits at b Fig. 11 The tree of all input b's (in black) compatible with a single active bit difference a (in red) up to weight 6 Fig. 12 Number of input differences compatible with a single active bit output difference and the number of output masks compatible with a single active bit input mask with given weight Fig. 13 The tree of all output masks v's (in black) compatible with a single active bit mask u (in red) up to weight 6 with at least two zeros in between, e.g. ( 1001), (10001), result in at least two active bits at a. Also, the pattern (1101) results in at least two active bits.
The restriction weight of each node in the tree is the restriction weight of its parent node plus 1.That is because adding (1) or (10) to the left side of a node only adds 1 to the Hamming weight, and hence adds 1 to the restriction weight [5].Hence, all nodes in the same row have the same restriction weight.
Figure 12 represents the number of input differences compatible with a single active bit output difference.We can see that this number grows linearly while increasing the weight.

Linear propagation over given an input mask
Given a mask at the output of χ , the way to generate all its input masks is given in [5].For a given mask at the input of χ it is possible to build all output masks by brute-force when χ applies to short strings, but for long strings it is not trivial.Therefore, we present an example to study the linear properties of χ for a given input mask with a single active bit.
A linear approximation over χ has correlation different from 0 if and only if it can be expressed as a sum of product terms plus a constant, as follows: where c i , c i+1 , and c k are constants, namely c i , c i+1 , c k ∈ {0, 1}.
We say an input mask u is compatible with an output mask v if C(u, v) = 0. Figure 13 represents the tree of the set bits of all output masks compatible with an input mask with a single active bit, up to correlation weight 6.Here, the position of the leftmost active bit is the same as the single active bit of the input mask and for simplicity, we removed the two zeros at the left side of the set bits in all nodes.Each node in Fig. 13 is generated by adding a mask (10) or (11) to the right side of the set bits of its parent node.Therefore, the following propositions hold.
Proposition 15 Let u be an input mask with a single active bit in position i and let v be an output mask compatible with u.Then, v cannot have two active bits in positions j, k with two or more zeros in between, with i ≤ j < k − 2.
Proof Let us denote a string with a single 1 at index i as e i ∈ F 2 , then u = e i .Let v have two active bits in positions j and k with j + 2 < k.Then, v is of the form v = Since j + 2 < k, then the term x k cannot be simplified and the expression above is not of the form of Eq. 20.
Proposition 16 Let u be an input mask with a single active bit in position i and v's be the compatible output masks with v i−2 v i−1 v i = 001.When generating the tree of all possible v's, adding an active bit proceeded by zero(s), e.g. ( 01) and (001), to the right side of a parent node is forbidden.
Proof We denote a string with a single 1 at index i as e i ∈ F 2 , then u = e i .Based on Proposition 15, having two active bits with at least two zeros in between is not allowed.We prove other cases by induction.
Base case: is a product of two terms (x i+1 + 1) and which is the sum of product terms plus a constant, so C(u, v) = 0.

Induction step:
1. Let us denote a node of the tree that is compatible with u = e i and has a pattern 10 at its right side by X , namely X j−2 X j−1 = 10.Then, the linear approximation over χ can be represented as Y + x j−1 • x j + x j , where Y is a sum of product terms plus a constant, and x j−1 • x j and x j are the only terms where x j appears.The reason why we just consider terms with x j is that these are the only terms that can be affected by adding new bits at positions { j, j + 1, . . .}. Then: u is compatible with v = X + e j because u T x + v T χ(x) = Y + x j−1 • x j + x j + x j + (x j+1 + 1) that is a sum of product terms plus a constant, so C(u, v) = 0; u is compatible with v = X + e j + e j+1 because u T x + v T χ(x) = Y + x j−1 • x j + x j + x j + (x j+1 + 1) • (x j+2 + 1) +(x j+2 + 1) • x j+3 + 1 = Y + x j−1 • x j + (x j+1 + 1) • (x j+2 + 1) that is a sum of product terms plus a constant, so C(u, v) = 0; u is not compatible with v = X + e j+1 because v j−2 v j−1 v j v j+1 = 1001 that has two active bits with two zeros in between.
2. Let us denote a node of the tree that is compatible with u = e j and has a pattern 11 at its right side by Z , namely Z j−2 Z j−1 = 11.Then, the linear approximation over χ is of the form Y + (x j−1 + 1)(x j + 1) + (x j + 1) • x j+1 , where Y is a sum over products, and (x j−1 + 1)(x j + 1) and (x j + 1) • x j+1 are the only terms where x j and x j+1 appear.
The correlation weight of each node is equal to the correlation weight of its parent node plus two.This happens because adding (01) to left side of the set bits of each node of the tree in Fig. 13 adds one to the Hamming weight of that node and one to the number of its odd-runs.And, adding (11) to each node only adds two to its Hamming weight.Thus, all nodes in the same row have the same correlation weight.
Figure 12 represents the number of output masks compatible with a single active bit input mask.We can see that this number grows exponentially while increasing the weight, in contrast to the number of input differences which grows linearly.

Conclusions
We introduced a method to compute the number of linear approximations with a given correlation weight over the non-linear map χ for any size of .Together with the method introduced in [8] to compute the number of differentials with a given restriction weight, this provides a useful tool to evaluate and compare composite χ mappings and single-circle χ mappings.Since the non-linear layer of Ascon and Simon are EA-equivalent to χ, our methods can be extended to them.
We used our methods to compare the non-linear layers of Xoodoo and Keccak-f [400], which use composite χ, with instantiations of single-circle χ.We observed that in the case of Xoodoo, the number of differentials and linear approximations in the case of parallel instances of χ 3 is slightly higher than the single-circle χ.On the contrary, there is no meaningful difference in the case of parallel instances of χ 5 and single-circle χ.
By comparing differentials and linear approximations, we see that the number of linear approximations is the same as differentials in the case of parallel χ 3 .Hence, we expect almost the same number of linear and differential trail cores over multiple rounds for the case of parallel χ 3 .It confirms the report on the number of 2-round trail cores given in [9]: "We found 2, 983, 444, 980 differential trail cores and 2, 983, 073, 628 linear trail cores.It is worth noticing that these numbers are close to each other within 0.05%.This is a consequence of the choice of χ 3 over, for instance, χ 5 as in Keccak− p".The authors of [9] also reported on the number of 3-round trail cores, that are 201 in the differential case and 204 in the linear case, that is another confirmation.
Unlike the case of parallel χ 3 , the number of linear approximations is bigger than the number of differentials in the case of parallel χ 5 or for longer strings.Therefore, we expect more linear trail cores than differential trail cores over multiple rounds in the case of χ with a circle length of 5 or greater.The results depicted in Fig. 10 confirm our expectations.regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Fig. 2
Fig. 2 The round function R k of Simon

3. 1
Differential propagation Let x, x * ∈ F n 2 be two inputs to a vectorial boolean function f : F n 2 → F n 2 , and y, y * ∈ F n 2 be their corresponding outputs, respectively.We call b = x − x * an input difference to f and a = y − y * an output difference.A differential over f consists of a couple (b, a).The number of occurrences of all differentials over a vectorial boolean function f : F n 2 → F n 2 are usually arranged in a 2 n by 2 n array, called the difference distribution table (DDT).For a differential (b, a), we have DDT(b, a) = |{x ∈ F n 2 | f (x − b) − f (x) = a}| .Differential cryptanalysis exploits the probability of differentials to occur.Definition 3 (Differential Probability (DP)) The differential probability of a differential (b, a) over a function f : F n 2 → F n 2 is denoted by DP(b, a) and is defined as DP(b, a) = DDT(b, a)

Definition 7 (
Restriction weight) The restriction weight of a differential (b, a) for a boolean function f : F n 2 → F n 2 , denoted by w r (b, a), is defined as w r (b, a) = − log 2 DP f (b, a) .

Corollary 1
The correlation weight is always an even number.

1 (o+1)− 1 =
(h+o)/2 o , which equals the number of minimal masks with the same h and o that form odd-start masks.Proof We start with a string of o odd-runs when all odd-runs have length 1 e.g. for o = 4 we have 010101 and 101010.Then we attach 11-strings to each odd-run to get the Hamming weight h.The number of 11-strings is (h − o)/2.Then, there are two cases: • even-start mask: then the number of ways to attach (h −o)/2 11-strings to o +1 positions is ((h−o)/2)+(o+1)−(h+o)/2 o

1 c+o− 1 =.
g for the case of even-start mask, and c+o+g−1 g for odd-start mask.Proof To compute the number of ways to attach g zeros to the passive bits of the gap-free string we consider two cases -odd-start mask: the number of ways to attach g zeros to c + o passive bits is c+o+g−start mask: the number of ways to attach g zeros to c + o + 1 positions is That is c + o + 1 positions since we can attach a 0 to either the start or end of the even-start mask.Using Propositions 11 to 13 allows us to compute L 4 (h, o, g, c) as follows

Fig. 4
Fig. 4 Number of linear approximations and differentials up to a given weight w for the case of χ 257

Fig. 5
Fig. 5 Number of linear approximations and differentials up to a given weight w for the case of χ 128

Fig. 7
Fig.7 Ratio between the number of linear approximations and differentials up to weight w for the case of 128 parallel χ 3 (as in Xoodoo) over the case of single-circle χ 384

Fig. 8 Fig. 9 Fig. 10
Fig. 8 Number of linear approximations and differentials up to a given weight w for the case of 80 parallel χ 5 as in Keccak-f [400], and the case of single-circle χ 400 < j c e + e j + e k + k<m c m e m (21) with c , c m ∈ {0, 1}.Then

Algorithm 2
Computing the minimal mask of a string s.