본문 펼치기
IACR Transactions on Symmetric Cryptology
ISSN 2519-173X, Vol. 2024, No. 2, pp. 190–221. [DOI:10.46586/tosc.v2024.i2.190-221](https://doi.org/10.46586/tosc.v2024.i2.190-221)
# Dynamic Cube Attacks against Grain-128AEAD
Chen Liu and Tian Tian
Information Engineering University, Zhengzhou 450001, China
`[LC_LiuChen@126.com](mailto:LC_LiuChen@126.com)`, `[tiantian_d@126.com](mailto:tiantian_d@126.com)`
Abstract. In this paper, we revisit the division property based dynamic cube attack
on the full Grain-128 presented by Hao et al. at FSE 2020 and demonstrate that their
attack on the full Grain-128 is invalid, that is, no key information could be successfully
recovered. The theoretical framework for the dynamic cube attack provided by Hao
et al. is correct, but the technique for building the MILP model in the dynamic cube
attack has flaws. Besides, strong evidence indicates that their bias estimation method
is not applicable to Grain-128AEAD and Grain-128. Accordingly, we introduce the
three-subset division property without unknown subset (3SDP/u) into dynamic cube
attacks and present a correct MILP modeling technique. In addition, we propose a
heuristic technique called Polynomial Approximation with regard to Bias (PAB) to
evaluate the bias in superpolies in the dynamic cube attack, which can provide a
more accurate bias evaluation for high-dimension cubes. As a result, we implemented
the dynamic cube attack based on 3SDP/u on 190-round Grain-128AEAD, and we
could recover 3 key bits with a complexity 2 <sup>103</sup> <sup>_._</sup> <sup>44</sup> and the success probability was
evaluated to be 99 _._ 68%. For Grain-128, some zero-sum distinguishers of cube size 80
are given for the first time.
Keywords: Dynamic Cube Attacks - Division Property - MILP - Grain-128AEAD
- Grain-128
## 1 Introduction
Since the cube attack was first introduced by Dinur and Shamir in [DS09], it has become
an important cryptanalysis tool for stream ciphers. In cube attacks, the first output bit of
a stream cipher can be regarded as a black-box polynomial _f_ ( _k_ _,_ _v_ ) with respect to the
secret key variables _k_ and public IV variables _v_ . Given a non-empty subset _I_ of IV indices,
_f_ ( _k_ _,_ _v_ ) can be rewritten uniquely as
_f_ ( _k_ _,_ _v_ ) = _v_ _I_ _· pI_ ( _k_ _,_ _v_ ) _⊕_ _qI_ ( _k_ _,_ _v_ ) _,_
where _v_ _I_ = <sup>�</sup> _i∈I_ <sup>_vi_</sup> <sup>and</sup> <sup>each</sup> <sup>term</sup> <sup>of</sup> <sup>_qI_</sup> <sup>(</sup> <sup>_k_</sup> <sup>_,_</sup> <sup>_v_</sup> <sup>)</sup> <sup>is</sup> <sup>not</sup> <sup>divisible</sup> <sup>by</sup> <sup>_v_</sup> <sup>_I_</sup> <sup>.</sup> <sup>The</sup> <sup>IV</sup> <sup>variables</sup> <sup>in</sup>
_{vi_ _| i ∈_ _I}_ are called cube variables. In the preprocessing phase, by assigning all possible
combinations of 0 _/_ 1 values to the cube variables, 2 <sup>_|I|_</sup> polynomials are obtained from _f_,
and their symbolic sum _pI_ is called the superpoly of _I_ in _f_ . Generally, the non-cube
variables are set to 0-constant in specific cube attacks, and in this case, _pI_ is a polynomial
in _k_ . Cube attacks aim to find proper sets _I_ such that the superpolies _pI_ ( _k_ ) are balanced
polynomials with low-degree, which can provide 1-bit secret key information theoretically.
The equations on the secret key variables could be built by inquiring about the value of
_pI_ ( _k_ ) online. Finally, some key information could be restored by solving these equations.
Additionally, a distinguisher variant of cube attacks, referred to as _cube_ _tester_, was first
This work was supported by the National Natural Science Foundation of China under Grant No.
62372464.
Licensed under Creative Commons License CC-BY 4.0.
Received: 2024-03-01 Accepted: 2024-05-01 Published: 2024-06-18
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>191</u>
introduced in [ADMS09], which is used to detect non-random properties of a superpoly of
a carefully selected cube such as constantness, linearity, and bias.
The dynamic cube attack, a variant of cube attacks proposed in [DS11], serves as a
potent cryptanalytic technique extensively applied in the evaluation of security in the
Grain family [DS11, DGP <sup>+</sup> 11, RBMA16, HJL <sup>+</sup> 20]. Unlike cube attacks, dynamic cube
attacks recover secret key information by exploiting distinguishers on superpolies, such
as bias and constantness. The basic idea of dynamic cube attacks is to simplify or even
nullify the ANFs of several critical intermediate state bits by imposing dynamic constraints
on some IV variables called dynamic variables, which aims to simplify the ANF of the
output function and induce non-random properties to the corresponding superpoly. The
dynamic constraints typically depend on some cube variables and key expressions. By
guessing the values of key expressions (or secret key variables) involved in the constraints,
the correct guesses can be obtained by detecting the non-randomness of the corresponding
superpoly. Ideally, under a correct key guess, the corresponding superpoly will show a kind
of non-randomness; conversely, under wrong key guesses, the corresponding superpolies
behave randomly. By using the dynamic cube attack, Dinur and Shamir proposed a
weak-key attack on the full version of Grain-128 in [DS11]. Subsequently, Dinur et al.
further proposed a key-recovery attack on the full version of Grain-128 in [DGP <sup>+</sup> 11] and
experimentally verified the correct guesses for a dozen of keys. By adjusting the strategy
of imposed conditions, Rahimi et al. presented a key-recovery attack against 100-round
Grain v1 in [RBMA16].
In [HJL <sup>+</sup> 20], Hao et al. argued that a theoretically reliable key-recovery attack should
evaluate not only the non-randomness for the correct key guess but also the randomness
for the wrong ones. Based on this idea, they pointed out that previous dynamic cube
attacks are unreliable, as these attacks typically overlooked the empirical or theoretical
validation of the randomness of the superpoly under wrong key guesses.
To solve this problem, Hao et al. applied the division property to dynamic cube attacks
and proposed a new dynamic cube attack (which we call division property based dynamic
cube attack) along with the corresponding MILP <sup>1</sup> modeling technique. By applying
the division property and the MILP modeling technique, large cubes can be exploited
to construct zero-sum distinguishers in dynamic cube attacks, which is very useful for
distinguishing correct guesses from incorrect guesses. To achieve this goal, a “qualified”
cube must satisfy the following requirements: for the correct key guess, the cube should
introduce a zero-sum property (i.e., the bias of the corresponding superpoly is 2 <sup>_−_</sup> <sup>1</sup> ); for
each wrong key guess, the superpoly should be of high degree with a bias smaller than 2 <sup>_−_</sup> <sup>1</sup> .
However, using high-dimensional cubes makes detecting the bias through experimental
testing infeasible since the computation complexity exceeds the available computational
capabilities. Therefore, to evaluate biases in superpolies of high-dimensional cubes, Hao
et al. drew links between the bias and the division property through a specific algebraic
structure and a heuristic assumption. Based on the links, they proposed a theoretical
method for estimating the biases of superpolies. Strictly speaking, it is necessary to
evaluate the biases of the superpolies for all possible wrong guesses. But, it is impractical
to do this due to a large number of wrong key guesses. Therefore, the authors proposed
a method to pick up a special wrong key guess that is expected to have a bias that is
closest to the bias of the correct key guess. Thus, the dynamic cube attack is deemed to be
successful if the correct key guess can be distinguished from the special wrong key guess.
Finally, the authors in [HJL <sup>+</sup> 20] applied the division property based dynamic cube attack
to the full Grain-128 and recovered about 3-bit key information with a complexity of 2 <sup>97</sup> <sup>_._</sup> <sup>86</sup>
and a success probability of 99 _._ 83%. It is currently the best theoretical key recovery attack
for the full Grain-128.
1Short for Mixed Integer Linear Programming, which is widely applied to various cryptanalysis
techniques
<u>192</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
Motivation. In recent years, several cube attacks have been proposed against Grain128AEAD [HLM <sup>+</sup> 20, HLM <sup>+</sup> 21, HST <sup>+</sup> 21, HHPW22]. These attacks aim to recover a
superpoly for more initialization rounds. But, as the number of initialization rounds
increases, the recovered superpolies become highly complex and exhibit significant bias.
Such superpolies are considered “bad” in cube attacks because, theoretically, they can
only provide key information of less than 1 bit, leading to an attack with a computation
complexity close to that of the exhaustive search attack. As a comparison, the dynamic
cube attack makes use of biased superpolies without recovering their full algebraic normal
forms that are typically complex, and it has theoretical complexity significantly lower than
that of the exhaustive search attack when applied to Grain-128. Besides, some dynamic
cube attacks against Grain-128 could even experimentally recover some key bits. Thus, the
dynamic cube attack seems to be a potentially powerful attack against Grain-128AEAD
as well as Grain-128.
When we revisited the dynamic cube attack against the full version of Grain-128
proposed in [HJL <sup>+</sup> 20], we found that the attack has some issues which results in that the
key-recovery result against the full Grain-128 is invalid. The primary issue is that the
MILP modeling technique for the dynamic cube attack did not consider the structural
characteristics of the Grain family, making the established MILP models contain many
redundant division trails. Therefore, the cubes constructed by the modeling technique and
deemed “qualified” failed to meet the requirements for distinguishing between correct and
wrong key guesses. Another issue is that the significant gap between the estimated and
actual biases could also affect the effectiveness of the attack. The method for estimating
bias proposed in [HJL <sup>+</sup> 20] relies on a heuristic assumption. The accuracy of the estimated
bias obtained using this method depends on the validity of this assumption. However,
based on many experiments, we found that the assumption is not universally applicable
to the Grain family of ciphers as the estimated bias using the method in [HJL <sup>+</sup> 20] is
significantly smaller than the actual bias in our experiments.
Contributions. In this paper, we focus on improving the dynamic cube attack against
Grain-128AEAD. As mentioned above, the inaccuracies in the MILP modeling technique
and the bias evaluation method lead to the key-recovery result in [HJL <sup>+</sup> 20] against the
full Grain-128 being invalid. Our main contribution is to present a more robust dynamic
cube attack against the Grain family of ciphers both in implementation and theory. In
specific, our contribution consists of the following three aspects.
Firstly, we introduce a heuristic technique called Polynomial Approximation with
respect to Bias (PAB), which can provide a more accurate bias evaluation for a superpoly
of a high-dimensional cube. Compared to the method proposed in [HJL <sup>+</sup> 20], the PAB
technique leverages the algebraic properties of the Grain family, enabling more precise bias
estimation. Secondly, we apply the 3SDP/u to dynamic cube attacks for the first time
and propose a more accurate MILP modeling method based on the 3SDP/u, which takes
the structural characteristics of the Grain family into consideration. Thirdly, a method
was proposed to analyze the impact of wrong key guesses on superpolies from an algebraic
perspective. This method aims to identify all possible wrong key guesses that are least
distinguishable from the correct key guess. Unlike the method in [HJL <sup>+</sup> 20], our approach
has more theoretical foundation to support its correctness.
As an illustration, we apply our methods to Grain-128AEAD and Grain-128 and obtain
the following results.
1. We present a key-recovery attack against 190-round Grain-128AEAD with theoretical
analysis of the success probability, which is the first dynamic cube attack against
Grain-128AEAD. In our attack on Grain-128AEAD, we identify the nullification
strategy by employing an automated search algorithm. It only nullifies two internal
state bits by guessing 6 key bits. As a result, our attack provides 3 bits of key information with a complexity of 2 <sup>103</sup> <sup>_._</sup> <sup>44</sup> and a theoretically estimated success probability
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>193</u>
of 99 _._ 68%.
We summarized the previous and our attack results for Grain-128AEAD in Table 1.
Compared with Hao et al.’s cube attack in [HLM <sup>+</sup> 21], our attack can be regarded
as a more “practical” key recovery attack since we can independently recover 3 key
bits. In [HLM <sup>+</sup> 21], it is explained from the perspective of entropy that 15 recovered
superpolies with high biases can provide 5 _._ 03 bits of key information, which is a
“theoretical” analysis and how to solve theses 5 _._ 03 bits of key information in practice
is unknown.
2. Based on the new modeling technique, we further discuss the feasibility of Hao et
al.’s dynamic cube attack against the full Grain-128. Through a large number of
experiments, we claim that within the framework of dynamic cube attacks proposed
in [HJL <sup>+</sup> 20], it is challenging to execute an effective key-recovery attack against
Grain-128.
3. We compare the accuracy of our bias estimation method with the previous method
given in [HJL <sup>+</sup> 20] by performing experiments on the reduced-round Grain-128AEAD.
It can be seen from Table 10 that the accuracy of our new bias evaluation method is
much better than the previous method for Grain-128AEAD. Besides we also give the
main reasons for the inaccuracies in estimating bias with the previous method.
All our results and the source code are available in our git [repository.](https://github.com/StrawberryBoy123/DynamicCubeAttack.git)
<u>Table</u> <u>1:</u> <u>Summary</u> <u>of</u> <u>the</u> <u>attack</u> <u>results</u> <u>for</u> <u>round-reduced</u> <u>Grain-128AEAD</u>
Attack type round _r_ Key information available Computation complexity Ref.
Dynamic cube attacks 190 3 2 <sup>103</sup> <sup>_._</sup> <sup>44</sup> Section 6.1
Cube attacks 190 5 _._ 03 2 <sup>98</sup> <sup>_._</sup> <sup>91</sup> [HLM <sup>+</sup> 21]
Cube attacks 191 128 <sup>1</sup> 2 <sup>126</sup> <sup>_._</sup> <sup>26</sup> [HST <sup>+</sup> 21]
Cube attacks 192 128 <sup>2</sup> 2 <sup>127</sup> [HHPW22]
<u>1They</u> recovered two massive superpolies with a high-bias, which are considered to be able to provide
1 _._ 7-bit key information from the perspective of entropy.
2They recovered one massive superpoly, which is proved balanced through experimental testing and
is considered capable of providing 1-bit key information.
## 2 Preliminaries
2.1 Notations
Let _n_ be a positive integer. An _n_ -variable Boolean function _f_ ( _x_ 0 _, x_ 1 _, . . ., xn−_ 1) is a
mapping from F <sup>_n_</sup> 2 <sup>into</sup> <sup>F2,</sup> <sup>and</sup> <sup>we</sup> <sup>also</sup> <sup>denote</sup> <sup>it</sup> <sup>by</sup> <sup>_f_</sup> <sup>(</sup> <sup>_x_</sup> <sup>)</sup> <sup>for</sup> <sup>simplicity.</sup> <sup>It</sup> <sup>can</sup> <sup>be</sup> <sup>uniquely</sup>
written as
_f_ ( _x_ ) =
- _a_ _µx_ <sup>_µ_</sup> _, a_ _µ_ _∈_ F2 _,_ (1)
_µ_ _∈_ F <sup>_n_</sup> 2
where _x_ <sup>_µ_</sup> = <sup>�</sup> _i_ <sup>_n_</sup> =0 <sup>_−_</sup> <sup>1</sup>
_i_ <sup>_n_</sup> =0 <sup>_−_</sup> <sup>1</sup> <sup>_x_</sup> _i_ <sup>_µi_</sup>
where _x_ <sup>_µ_</sup> = <sup>�</sup> _i_ <sup>_n_</sup> =0 <sup>_−_</sup> <sup>1</sup> <sup>_x_</sup> _i_ <sup>_µi_</sup> ≜ _π_ _µ_ ( _x_ ), which is called the Algebraic Normal Form (ANF) of
_f_ ( _x_ ). A Boolean function of the form _x_ <sup>_µ_</sup> for some vector _µ_ _∈_ F <sup>_n_</sup> 2 <sup>is</sup> <sup>called</sup> <sup>a</sup> <sup>monomial.</sup>
In particular, 1 = _x_ <sup>0</sup> is a monomial. By Eq.(1), if _a_ _µ_ = 1, then we say the monomial _x_ <sup>_µ_</sup>
appears in _f_ ( _x_ ), denoted by _x_ <sup>_µ_</sup> _→_ _f_ ; otherwise denote _x_ <sup>_µ_</sup> ↛ _f_ . The algebraic degree of
_f_ ( _x_ ) is defined by
deg( _f_ ) = max _{wt_ ( _µ_ ) _|_ _x_ <sup>_µ_</sup> _→_ _f_ _},_
where _wt_ ( _µ_ ) is the Hamming Weight of _µ_, and is denoted by deg( _f_ ). A vector of length
2 <sup>_n_</sup> consisting of all the outputs of _f_ ( _x_ ) is called the truth table of _f_ . The quantity _εf_ such
that
Pr( _f_ ( _x_ ) = 0) ≜ <sup>_<u>|{</u>_</sup> <sup>_<u>x</u>_</sup> <sup>_<u>∈</u>_</sup> <sup>F</sup> <u>2</u> <sup>_n_</sup>
<sup><u>1</u></sup>
2 <sup>+</sup> <sup>_εf_</sup> <sup>_,_</sup>
<u>2</u> <sup>_n_</sup> <sup>_<u>| f</u>_</sup> <sup><u>(</u></sup> <sup>_<u>x</u>_</sup> <sup><u>) = 0</u></sup> <sup>_<u>}|</u>_</sup> = <sup><u>1</u></sup>
2 <sup>_n_</sup> 2
<u>194</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
is called the bias of _f_ ( _x_ ), which describes the 0 _/_ 1 distribution of the truth table of _f_ ( _x_ ).
It can be seen that _−_ <sup><u>1</u></sup> 2 <sup>_≤_</sup> <sup>_εf_</sup> <sup>_<_</sup> 2 <sup><u>1</u></sup> <sup>.</sup> <sup>If</sup> <sup>_εf_</sup> <sup>= 0,</sup> <sup>then</sup> <sup>the</sup> <sup>number</sup> <sup>of</sup> <sup>0’s</sup> <sup>is</sup> <sup>equal</sup> <sup>to</sup> <sup>that</sup> <sup>of</sup> <sup>1’s</sup>
It can be seen that _−_ <sup><u>1</u></sup> 2 <sup>_≤_</sup> <sup>_εf_</sup> <sup>_<_</sup> 2 <sup><u>1</u></sup> <sup>.</sup> <sup>If</sup> <sup>_εf_</sup> <sup>= 0,</sup> <sup>then</sup> <sup>the</sup> <sup>number</sup> <sup>of</sup> <sup>0’s</sup> <sup>is</sup> <sup>equal</sup> <sup>to</sup> <sup>that</sup> <sup>of</sup> <sup>1’s</sup>
in the truth table of _f_, and in this case, _f_ is called a balanced Boolean function. If _εf_ _>_ 0,
then the number of 0’s is larger than that of 1’s, and in this case, the output of _f_ is more
likely to be 0 for a random input. In particular, if _εf_ is close to <sup><u>1</u></sup> 2 <sup>,</sup> <sup>then</sup> <sup>_f_</sup> <sup>is</sup> <sup>close</sup> <sup>to</sup> <sup>being</sup>
likely to be 0 for a random input. In particular, if _εf_ is close to <sup><u>1</u></sup> 2 <sup>,</sup> <sup>then</sup> <sup>_f_</sup> <sup>is</sup> <sup>close</sup> <sup>to</sup> <sup>being</sup>
the zero constant function.
Beside Boolean functions, we need to introduce another type of polynomial ring.
Let Z[ _x_ 0 _, . . ., xn−_ 1] be the polynomial ring in _n_ variables over the integer ring Z and
( _x_ <sup>2</sup> 0 <sup>_−_</sup> <sup>_x_</sup> <sup>0</sup> <sup>_, . . ., x_</sup> <sup>2</sup> _n−_ 1 <sup>_−_</sup> <sup>_xn−_</sup> <sup>1)</sup> <sup>be</sup> <sup>the</sup> <sup>ideal</sup> <sup>in</sup> <sup>Z[</sup> <sup>_x_</sup> <sup>0</sup> <sup>_, . . ., xn−_</sup> <sup>1]</sup> <sup>generated</sup> <sup>by</sup> <sup>_{x_</sup> <sup>2</sup> _i_ <sup>_−_</sup> <sup>_xi_</sup> <sup>_|_</sup> <sup>0</sup> <sup>_≤_</sup> <sup>_i ≤_</sup>
_n−_ 1 _}_ . Then the quotient ring Z[ _x_ 0 _, . . ., xn−_ 1] _/_ ( _x_ <sup>2</sup> 0 <sup>_−x_</sup> <sup>0</sup> <sup>_, . . ., x_</sup> <sup>2</sup> _n−_ 1 <sup>_−xn−_</sup> <sup>1) is a commutative</sup>
<sup>2</sup> 0 <sup>_−_</sup> <sup>_x_</sup> <sup>0</sup> <sup>_, . . ., x_</sup> <sup>2</sup> _n−_ 1 <sup>_−_</sup> <sup>_xn−_</sup> <sup>1)</sup> <sup>be</sup> <sup>the</sup> <sup>ideal</sup> <sup>in</sup> <sup>Z[</sup> <sup>_x_</sup> <sup>0</sup> <sup>_, . . ., xn−_</sup> <sup>1]</sup> <sup>generated</sup> <sup>by</sup> <sup>_{x_</sup> <sup>2</sup> _i_
_n−_ 1 _}_ . Then the quotient ring Z[ _x_ 0 _, . . ., xn−_ 1] _/_ ( _x_ <sup>2</sup> 0 <sup>_−x_</sup> <sup>0</sup> <sup>_, . . ., x_</sup> <sup>2</sup> _n−_ 1 <sup>_−xn−_</sup> <sup>1) is a commutative</sup>
ring with identity, and we denote it by Z <sup>¯</sup> [ _x_ ], where _x_ = ( _x_ 0 _, x_ 1 _, . . ., xn−_ 1). Since _x_ <sup>2</sup> _i_ <sup>=</sup> <sup>_xi_</sup>
in Z <sup>¯</sup> [ _x_ ], it follows that every polynomial _f_ ( _x_ ) _∈_ Z <sup>¯</sup> [ _x_ ] can be written uniquely as
_f_ ( _x_ ) =
_α_ _µx_ <sup>_µ_</sup> _, α_ _µ_ _∈_ Z _._
<sup>_n_</sup> 2
_µ_ _∈_ F <sup>_n_</sup> 2
2.2 Frequency test to Boolean functions
Let _f_ ( _x_ ) be an _n_ -variable random Boolean function, that is, its truth table contains
as many zeroes as ones. This implies that Pr( _f_ ( _x_ ) = 1) = Pr( _f_ ( _x_ ) = 0) = <u>12</u> <sup>for</sup> <sup>a</sup>
uniformly distributed discrete random variable _x_ over F <sup>_n_</sup> 2 <sup>.</sup> <sup>Let</sup> <sup>X =</sup> <sup>_{_</sup> <sup>_x_</sup> <sup>1</sup> <sup>_,_</sup> <sup>_x_</sup> <sup>2</sup> <sup>_, . . .,_</sup> <sup>_x_</sup> <sup>_N_</sup> <sup>_}_</sup> <sup>be</sup>
a non-empty subset of F <sup>_n_</sup> 2 <sup>.</sup> <sup>Assume</sup> <sup>_f_</sup> <sup>is</sup> <sup>random</sup> <sup>on</sup> <sup>X</sup> <sup>(that</sup> <sup>is,</sup> <sup>_f_</sup> <sup>(</sup> <sup>_x_</sup> <sup>1)</sup> <sup>_, f_</sup> <sup>(</sup> <sup>_x_</sup> <sup>2)</sup> <sup>_, . . ., f_</sup> <sup>(</sup> <sup>_x_</sup> <sup>_N_</sup> <sup>)</sup>
are random samples from the truth table of _f_ ). Denote the number of 1’s in the _N_ tuple ( _f_ ( _x_ 1) _, f_ ( _x_ 2) _, . . ., f_ ( _x_ _N_ )) by _S_ . Then the central limit theorem implies that for a
sufficiently large _N_, the distribution of
_y_ = <sup>_<u>S −</u>_</sup> <sup>_<u>N/</u>_</sup> <sup><u>2</u></sup>
<u>�</u> _N/_ 4
= <sup><u>2</u></sup> <sup>_<u>S</u>_</sup> _~~√~~_ <sup>_<u>−</u>_</sup> <sup>_<u>N</u>_</sup>
_N_
is approximately the standard normal distribution _N_ (0 _,_ 1). Generally, when _N_ is greater
than 25 or 30, this approximation will be good [HTZ13, Chapter 5.6]. Next, we devise a test
for random Boolean functions. Choose a significance level 0 _< α ≤_ 0 _._ 05. If Φ( _|y|_ ) _≤_ 1 _−_ <sup>_<u>α</u>_</sup> 2 <sup>,</sup>
then we say the function _f_ passes the frequency test for randomness with a significance
level _α_, where Φ is the distribution function of _N_ (0 _,_ 1), that is,
<u>1</u>
Φ( _|y|_ ) = _~~√~~_
2 _π_
- _|y|_
_−∞_
_e_ <sup>_−_</sup> <sup>_<u>u</u>_</sup> 2 <sup>2</sup> d _u._
Otherwise, we say _f_ ( _x_ ) fails the frequency test for randomness with the significance level
_α_ and in this case we also say _f_ is biased .
Finally, we discuss the sample size _N_ in the above frequency test to detect a Boolean
function _f_ <sup>_′_</sup> with bias _εf ′_ _>_ 0. The bias implies that Pr( _f_ <sup>_′_</sup> ( _x_ ) = 1) = <sup><u>1</u></sup> 2 <sup>_−_</sup> <sup>_εf ′_</sup> <sup>for</sup> <sup>a</sup> <sup>random</sup>
function _f_ <sup>_′_</sup> with bias _εf ′_ _>_ 0. The bias implies that Pr( _f_ <sup>_′_</sup> ( _x_ ) = 1) = <sup><u>1</u></sup> 2 <sup>_−_</sup> <sup>_εf ′_</sup> <sup>for</sup> <sup>a</sup> <sup>random</sup>
input _x_ _∈_ F <sup>_n_</sup> 2 <sup>.</sup> <sup>Find</sup> <sup>the</sup> <sup>number</sup> <sup>_uα_</sup> <sup>such</sup> <sup>that</sup> <sup>Φ(</sup> <sup>_uα_</sup> <sup>)</sup> <sup>=</sup> <sup>1</sup> <sup>_−_</sup> <sup>_<u>α</u>_</sup> 2 <sup>.</sup> <sup>If</sup> <sup>we</sup> <sup>want</sup> <sup>_f ′_</sup> <sup>to</sup> <sup>fail</sup> <sup>the</sup>
input _x_ _∈_ F <sup>_n_</sup> 2 <sup>.</sup> <sup>Find</sup> <sup>the</sup> <sup>number</sup> <sup>_uα_</sup> <sup>such</sup> <sup>that</sup> <sup>Φ(</sup> <sup>_uα_</sup> <sup>)</sup> <sup>=</sup> <sup>1</sup> <sup>_−_</sup> <sup>_<u>α</u>_</sup> 2 <sup>.</sup> <sup>If</sup> <sup>we</sup> <sup>want</sup> <sup>_f ′_</sup> <sup>to</sup> <sup>fail</sup> <sup>the</sup>
frequency test for randomness, then the sample size _N_ should be the solution of
<sup><u>1</u></sup> <u>2</u> <sup>_−_</sup> <sup>_εf ′_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_<u>N</u>_</sup> <u>2</u>
~~<u>�</u>~~
_<u>N</u>_
_N_ ( <sup><u>1</u></sup> <u>2</u>
<u>2</u> _< −uα,_
_<u>N</u>_
4
that is,
_N_ _>_ (2 _εuf_ <sup>2</sup> _<u>α ′</u>_ ) <sup>2</sup> <sup>_._</sup> (2)
Thus, we can detect that _f_ <sup>_′_</sup> is biased by the frequency test for randomness with the
significance level _α_ when the size of X is at least (2 _εf_ <sup>_′_</sup> ) <sup>_−_</sup> <sup>2</sup> _· u_ <sup>2</sup> _α_ <sup>.</sup> <sup>To</sup> <sup>make</sup> <sup>the</sup> <sup>assertion</sup> <sup>for</sup> <sup>a</sup>
Boolean function being biased more reliable, in the following we set _N_ = 2 _·_ (2 _εf ′_ ) <sup>_−_</sup> <sup>2</sup> _· u_ <sup>2</sup> _α_ <sup>.</sup>
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>195</u>
2.3 Three-subset division property without unknown subset
The concept of the _three-subset_ _division_ _property_ _without_ _unknown_ _subset_ (shortly 3SDP/u)
was proposed by Hao et al. at Eurocrypt 2020 in [HLM <sup>+</sup> 20], which is widely applied to
cube attacks against stream ciphers. The 3SDP/u is one of the best methods to resolve the
problem of determining the presence or absence of a monomial in the ANF of a Boolean
function. In [HLM <sup>+</sup> 20], the definition of the 3SDP/u was not given directly, but an
equivalent definition called the _modified_ _three-subset_ _division_ _property_ was proposed.
Definition 1 (Modified three-subset division property) . Let X be a multiset whose
elements take a value of F <sup>_N_</sup> 2 <sup>.</sup> <sup>Let</sup> <sup>L</sup> <sup>also</sup> <sup>be</sup> <sup>a</sup> <sup>multiset</sup> <sup>whose</sup> <sup>elements</sup> <sup>take</sup> <sup>a</sup> <sup>value</sup> <sup>of</sup>
F <sup>_N_</sup> 2 <sup>.</sup> <sup>When</sup> <sup>the</sup> <sup>multiset</sup> <sup>X</sup> <sup>has</sup> <sup>the</sup> <sup>modified</sup> <sup>three-subset</sup> <sup>division</sup> <sup>property</sup> <sup>(shortly</sup> <sup>_T_</sup> L <sup>1</sup> <sup>_N_</sup> ),
it fulfils the following conditions:
- 1 if there is an odd number of _µ_ ’s in L _,_
0 otherwise _._
_x_ _∈_ X
_x_ <sup>_µ_</sup> =
Generally, an iterative stream cipher can be decomposed into a composition of basic
vectorial Boolean functions: COPY, AND, and XOR. We present the propagation rules
of the 3SDP/u for these basic vectorial Boolean functions below and provide their MILP
models in Appendix A.
Proposition 1 (COPY) . _Let_ _x_ = ( _x_ 0 _, x_ 1 _, ..., xm−_ 1) _and_ _y_ = ( _x_ 0 _, x_ 0 _, x_ 1 _, ..., xm−_ 1) _be_ _the_
_input_ _and_ _output_ _vector_ _of_ _a_ _Copy_ _function._ _Let_ X _and_ Y _be_ _the_ _input_ _and_ _output_ _multisets,_
_respectively._ _Assuming_ _that_ X _has_ _T_ L <sup>1</sup> <sup>_m_</sup> _,_ Y _has_ _T_ L <sup>1</sup> <sup>_′m_</sup> <sup>+1</sup> _where_ L <sup>_′_</sup> _is_ _computed_ _as_
L <sup>1</sup> <sup>_′m_</sup> <sup>+1</sup> _where_ L <sup>_′_</sup> _is_ _computed_ _as_
L <sup>1</sup> <sup>_m_</sup> _,_ Y _has_ _T_ L <sup>1</sup> <sup>_′m_</sup> <sup>+1</sup>
L <sup>_′_</sup> _←_ ( _l_ 0 <sup>_′_</sup> <sup>_, l_</sup> 0 <sup>_′′, l_</sup> <sup>1</sup> <sup>_, . . ., lm−_</sup> <sup>1)</sup> <sup>_,_</sup> <sup>_if_</sup> <sup>_l_</sup> 0 <sup>_′_</sup> <sup>_∨_</sup> <sup>_l_</sup> 0 <sup>_′′_</sup> <sup>=</sup> <sup>_l_</sup> <sup>0</sup> <sup>_,_</sup>
_for_ _all_ _l_ _∈_ L _._ _Note_ _that_ _the_ _operator_ _∨_ _represents_ _the_ _OR_ _operation,_ _and_ _here_ L <sup>_′_</sup> _←_ _l_
_denotes_ _that_ _l_ _is_ _inserted_ _into_ _the_ _multiset_ L <sup>_′_</sup> _._
Proposition 2 (AND) . _Let_ _x_ = ( _x_ 1 _, x_ 2 _, ..., xm_ ) _and_ _y_ = ( _x_ 1 _· x_ 2 _, x_ 3 _, ..., xm_ ) _be_ _the_ _input_
_and_ _output_ _vector_ _of_ _an_ _And_ _function._ _Let_ X _and_ Y _be_ _the_ _input_ _and_ _output_ _multisets,_
_respectively._ _Assuming_ _that_ X _has_ _T_ L <sup>1</sup> <sup>_m_</sup> _,_ Y _has_ _T_ L <sup>1</sup> <sup>_′m−_</sup> <sup>1</sup> _where_ L <sup>_′_</sup> _is_ _computed_ _as_
L <sup>1</sup> <sup>_′m−_</sup> <sup>1</sup> _where_ L <sup>_′_</sup> _is_ _computed_ _as_
L <sup>1</sup> <sup>_m_</sup> _,_ Y _has_ _T_ L <sup>1</sup> <sup>_′m−_</sup> <sup>1</sup>
L <sup>_′_</sup> _←_ ( _l_ 0 _, l_ 2 _, . . ., lm−_ 1) _,_ _if_ _l_ 0 = _l_ 1 _,_
_for_ _all_ _l_ _∈_ L _._
Proposition 3 (XOR) . _Let_ _x_ = ( _x_ 1 _, x_ 2 _, ..., xm_ ) _and_ _y_ = ( _x_ 1 _⊕_ _x_ 2 _, x_ 3 _, ..., xm_ ) _be_ _the_ _input_
_and_ _output_ _vector_ _of_ _a_ _Xor_ _function._ _Let_ X _and_ Y _be_ _the_ _input_ _and_ _output_ _multisets,_
_respectively._ _Assuming_ _that_ X _has_ _T_ L <sup>1</sup> <sup>_m_</sup> _,_ Y _has_ _T_ L <sup>1</sup> <sup>_′m−_</sup> <sup>1</sup> _where_ L <sup>_′_</sup> _is_ _computed_ _as_
L <sup>1</sup> <sup>_′m−_</sup> <sup>1</sup> _where_ L <sup>_′_</sup> _is_ _computed_ _as_
L <sup>1</sup> <sup>_m_</sup> _,_ Y _has_ _T_ L <sup>1</sup> <sup>_′m−_</sup> <sup>1</sup>
L <sup>_′_</sup> _←_ ( _l_ 0 + _l_ 1 _, l_ 2 _, . . ., lm−_ 1) _,_ _if_ _l_ 0 _· l_ 1 = 0 _,_
_for_ _all_ _l_ _∈_ L _._
To determine whether a given monomial appears in the ANF of the output function
for an iterative cryptosystem with _r_ -round initialization, the authors in [HLM <sup>+</sup> 20] defined
the concept of _three-subset_ _division_ _trail_ .
Definition 2 (Three-subset division trail [HLM <sup>+</sup> 20]) . Let _T_ L _i_ be the three-subset division
property of the input for the _i_ th round function. Let us consider the propagation of
_def_
the three-subset division property _{_ _l_ _}_ = L0 _→_ L1 _→· · ·_ _→_ L _r_ . Moreover, for any
_def_
the three-subset division property _{_ _l_ _}_ = L0 _→_ L1 _→· · ·_ _→_ L _r_ . Moreover, for any
bit-vector _l_ _i_ <sup>_′_</sup> +1 <sup>_∈_</sup> <sup>L</sup> <sup>_i_</sup> <sup>+1,</sup> <sup>there</sup> <sup>must</sup> <sup>exist</sup> <sup>a</sup> <sup>bit-vector</sup> <sup>_l_</sup> _i_ <sup>_′_</sup> <sup>_∈_</sup> <sup>L</sup> <sup>_i_</sup> <sup>such</sup> <sup>that</sup> <sup>_l_</sup> _i_ <sup>_′_</sup> <sup>can</sup> <sup>propagate</sup>
to _l_ _i_ <sup>_′_</sup> +1 <sup>by</sup> <sup>the</sup> <sup>propagation</sup> <sup>rules</sup> <sup>of</sup> <sup>the</sup> <sup>3SDP/u,</sup> <sup>denoted</sup> <sup>by</sup> <sup>_l_</sup> _i_ <sup>_′_</sup> _−→p_ _l_ _i′_ +1 <sup>.</sup> <sup>Furthermore,</sup> <sup>for</sup>
( _l_ 0 _,_ _l_ 1 _, . . .,_ _l_ _r_ ) _∈_ L0 _×_ L1 _× · · · ×_ L _r_, if _l_ _i_ can propagate to _l_ _i_ +1 for all _i ∈{_ 0 _,_ 1 _, . . ., r −_ 1 _}_,
_i_ <sup>_′_</sup> +1 <sup>_∈_</sup> <sup>L</sup> <sup>_i_</sup> <sup>+1,</sup> <sup>there</sup> <sup>must</sup> <sup>exist</sup> <sup>a</sup> <sup>bit-vector</sup> <sup>_l_</sup> _i_ <sup>_′_</sup>
_i_ <sup>_′_</sup> <sup>_∈_</sup> <sup>L</sup> <sup>_i_</sup> <sup>such</sup> <sup>that</sup> <sup>_l_</sup> _i_ <sup>_′_</sup>
_i_ <sup>_′_</sup> +1 <sup>by</sup> <sup>the</sup> <sup>propagation</sup> <sup>rules</sup> <sup>of</sup> <sup>the</sup> <sup>3SDP/u,</sup> <sup>denoted</sup> <sup>by</sup> <sup>_l_</sup> _i_ <sup>_′_</sup>
_i_
_−→p_ _l_ _i′_
_−→· · ·p_
_−→p_ _l_ _r_ an _r_ -round three-subset division trail.
we call _l_ 0
_−→p_ _l_ 1
<u>196</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
Let _f_ ( _x_ ) be a basic vectorial Boolean function, and _y_ = _f_ ( _x_ ). For an input bit-vector
_µ_, the corresponding output bit-vector _ω_ can be derived using the propagation rules of
the 3SDP/u. In this case, the monomial _x_ <sup>_µ_</sup> appears in the ANF of _y_ <sup>_ω_</sup> with respect to _x_,
the correctness of which is guaranteed by the propagation rules.
However, when the function _f_ ( _x_ ) is not a basic vectorial Boolean function, _µ_ _−→p_ _ω_
does not necessarily mean that the monomial _x_ <sup>_µ_</sup> appears in the ANF of _y_ <sup>_ω_</sup> with respect
to _x_ . It is implied that the monomial _x_ <sup>_µ_</sup> appears in the expression of _y_ <sup>_ω_</sup> with respect to
_x_, under the condition that the expression does not consider the cancellation property of
the operation xor. This is because a Boolean function can typically be decomposed into a
composition of basic vectorial Boolean functions, and there are more than one possible
ways for propagation according to the rule of COPY, rendering _µ_ propagate to _ω_ through
several different ways. Assuming that there are a total of _N_ different trails connecting _µ_
and _ω_, it implies that there are _N_ monomials _x_ <sup>_µ_</sup> appearing in the expression of _y_ <sup>_ω_</sup> with
respect to _x_, without taking into account the cancellation property. Further, if _N_ is even,
then the monomial _x_ <sup>_µ_</sup> does not appear in the ANF of _y_ <sup>_ω_</sup> with respect to _x_ due to the
cancellation property; otherwise, _x_ <sup>_µ_</sup> appears in the ANF of _y_ <sup>_ω_</sup> . To illustrate more clearly,
we provide a simple example.
Example 1. Let _x_ = ( _x_ 0 _, x_ 1 _, x_ 2) _∈_ F <sup>3</sup> 2 <sup>and</sup> <sup>_y_</sup> <sup>=</sup> <sup>_f_</sup> <sup>(</sup> <sup>_x_</sup> <sup>)</sup> <sup>=</sup> <sup>(</sup> <sup>_x_</sup> <sup>0</sup> <sup>_⊕_</sup> <sup>_x_</sup> <sup>1</sup> <sup>_⊕_</sup> <sup>_x_</sup> <sup>2</sup> <sup>_, x_</sup> <sup>1</sup> <sup>_x_</sup> <sup>2</sup> <sup>_, x_</sup> <sup>0).</sup> <sup>The</sup>
function _f_ can be decomposed into the following procedure, say
( _x_ 0 _, x_ 1 _, x_ 2)
_COP Y_
===== _⇒_ ( _x_ 0 _, x_ 1 _, x_ 2 _, x_ 1 _, x_ 2 _, x_ 0) _,_
_XOR_
==== _⇒_ ( _x_ 0 _⊕_ _x_ 1 _⊕_ _x_ 2 _, x_ 1 _, x_ 2 _, x_ 0) _,_
_AND_
==== _⇒_ ( _x_ 0 _⊕_ _x_ 1 _⊕_ _x_ 2 _, x_ 1 _x_ 2 _, x_ 0) ≜ ( _y_ 0 _, y_ 1 _, y_ 2) _._
To check whether _x_ <sup>(1</sup> <sup>_,_</sup> <sup>1</sup> <sup>_,_</sup> <sup>1)</sup> appears in _y_ <sup>(1</sup> <sup>_,_</sup> <sup>1</sup> <sup>_,_</sup> <sup>1)</sup> = _x_ 0 _x_ 1 _x_ 2, we need to enumerate all
possible three-subset division trails connecting _x_ <sup>(1</sup> <sup>_,_</sup> <sup>1</sup> <sup>_,_</sup> <sup>1)</sup> and _y_ <sup>(1</sup> <sup>_,_</sup> <sup>1</sup> <sup>_,_</sup> <sup>1)</sup> . By computation, there
are in total 3 trails as follows
_−→p_ (1 _,_ 1 _,_ 1) _,_
_−→p_ (1 _,_ 1 _,_ 1) _,_
_−→p_ (1 _,_ 1 _,_ 1) _._
(1 _,_ 1 _,_ 1)
(1 _,_ 1 _,_ 1)
(1 _,_ 1 _,_ 1)
_−→p_ (1 _,_ 0 _,_ 0 _,_ 1 _,_ 1 _,_ 1)
_−→p_ (0 _,_ 1 _,_ 0 _,_ 1 _,_ 1 _,_ 1)
_−→p_ (0 _,_ 0 _,_ 1 _,_ 1 _,_ 1 _,_ 1)
Therefore, the monomial _x_ <sup>(1</sup> <sup>_,_</sup> <sup>1</sup> <sup>_,_</sup> <sup>1)</sup> appears in the ANF of _y_ <sup>(1</sup> <sup>_,_</sup> <sup>1</sup> <sup>_,_</sup> <sup>1)</sup> with respect to _x_ .
Conversely, there are only 2 three-subset division trails connecting _x_ <sup>(0</sup> <sup>_,_</sup> <sup>1</sup> <sup>_,_</sup> <sup>1)</sup> and _y_ <sup>(1</sup> <sup>_,_</sup> <sup>1</sup> <sup>_,_</sup> <sup>0)</sup> =
( _x_ 0 _⊕_ _x_ 1 _⊕_ _x_ 2) _· x_ 1 _x_ 2 = _x_ 0 _x_ 1 _x_ 2 given by
_−→p_ (1 _,_ 1 _,_ 0) _,_
_−→p_ (1 _,_ 1 _,_ 0) _._
(0 _,_ 1 _,_ 1)
(0 _,_ 1 _,_ 1)
_−→p_ (0 _,_ 1 _,_ 0 _,_ 1 _,_ 1 _,_ 0)
_−→p_ (0 _,_ 0 _,_ 1 _,_ 1 _,_ 1 _,_ 0)
Therefore, the monomial _x_ <sup>(0</sup> <sup>_,_</sup> <sup>1</sup> <sup>_,_</sup> <sup>1)</sup> does not appear in the ANF of _y_ <sup>(1</sup> <sup>_,_</sup> <sup>1</sup> <sup>_,_</sup> <sup>0)</sup> with respect to _x_ .
Similarly, for an iterated stream cipher with _r_ -round initialization _f_ ( _k_ _,_ _v_ ), if we want
to determine whether a monomial _π_ _l_ ( _s_ 0) appears in _f_, it is necessary to enumerate all
possible three-subset division trails connecting _π_ _l_ ( _s_ 0) and _f_ . When the number of trails is
odd, the monomial _π_ _l_ ( _s_ 0) appears in the ANF of _f_ ; otherwise, _π_ _l_ ( _s_ 0) does not appear in
the ANF of _f_ .
Based on the propagation rules of these basic functions and the concept of _three-subset_
_division_ _trail_, Hao et al. proposed a general modeling technique to recover the superpolies
against the stream ciphers in [HLM <sup>+</sup> 20, HLM <sup>+</sup> 21], which is a basic tool for all superpoly
recovery algorithms proposed after it. For details on the corresponding MILP models for
specific stream ciphers, please refer to [HLM <sup>+</sup> 20, HLM <sup>+</sup> 21].
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>197</u>
2.4 A divide-and-conquer algorithm for superpoly recovery
A divide-and-conquer algorithm for recovering superpolies was proposed in [Sun21, HST <sup>+</sup> 21].
Its basic idea is to decompose the complex system that failed to be solved within a time
limit, into several simpler subsystems for resolution by employing a divide-and-conquer
strategy based on the algebraic expression of the internal update function. If any subsystems remain unsolved within a time limit, they are further decomposed into even simpler
subsystems until all subsystems are successfully resolved.
In specific, expressing the output bit _z_ as a polynomial of some intermediate state
variables (not necessarily at the same time instance), say _z_ = _f_ ( _s_ 1 _, s_ 2 _, . . ., sm_ ), and then
the process of recovering the superpoly of the output bit _z_ for a given cube _I_ could be
divided into recovering the superpoly of every monomial of _f_ for the cube _I_ . That is,
if _f_ ( _s_ 1 _, s_ 2 _. . ., sm_ ) has _N_ monomials, then the MILP model to recover the superpoly of
_z_ could be decomposed into _N_ smaller MILP models as _N_ branches for recovering the
superpolies of _N_ monomials. The MILP models for some branches could be solved very
efficiently, such as 0-constant superpolies, while the MILP models for some branches
are time-consuming. For those branches with MILP models that are hard to resolve, a
preset time limit is used to terminate them. Therefore, for each monomial of _f_, if the
corresponding MILP model is solved within the time limit, then the superpoly of the
monomial has been recovered; otherwise, it indicates that the superpoly of the monomial
is still unknown. Then, each monomial with an unsolved MILP model is further divided
into more branches by expressing it as polynomials of deeper intermediate states. The
above procedure is iterated until all monomials are resolved. Finally, all the superpolies
are collected and assembled into the whole superpoly of the output bit.
## 3 Revisiting Hao et al.’s dynamic cube attack
In this section, we will first provide a brief introduction to Hao et al.’s dynamic cube attack
in Section 3.1 and then discuss the issues in their attack on the full Grain-128 in Sections
3.2 and 3.3, respectively.
3.1 Brief introduction to the dynamic cube attack
In this subsection, we briefly introduce the division property based dynamic cube attack
presented by Hao et al. in [HJL <sup>+</sup> 20]. For a stream cipher with _n_ -bit key variables
_x_ = ( _x_ 0 _, . . ., xn−_ 1) and _m_ -bit public IV variables _v_ = ( _v_ 0 _, . . ., vm−_ 1), the ANF of its
arbitrary intermediate state bit can be regarded as a polynomial _s_ ( _x_ _,_ _v_ ) as follows,
_s_ ( _x_ _,_ _v_ ) =
_α_ _µv_ <sup>_µ_</sup> _,_ where _α_ _µ_ _∈_ F2[ _x_ ] _._
<sup>_m_</sup> 2
_µ_ _∈_ F <sup>_m_</sup> 2
Naturally, the output bit can be represented as a polynomial involving the intermediate
state bits. Hence, if we can identify crucial intermediate state bits for the output bit and
nullify them, then the output bit can be significantly simplified, making it vulnerable to
cube testers. An intermediate state bit _s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>),</sup> <sup>generated</sup> <sup>at</sup> <sup>round</sup> <sup>_r_</sup> <sup>and</sup> <sup>position</sup> <sup>_i_</sup> <sup>,</sup> <sup>can</sup> <sup>be</sup>
nullified by assigning specific IV variables to a dynamic value determined by the ANF of
_s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>).</sup> <sup>Assume</sup> <sup>that</sup> <sup>_s_</sup> _i_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> can be expressed as
<sup>(</sup> _i_ <sup>_r_</sup> <sup>).</sup> <sup>Assume</sup> <sup>that</sup> <sup>_s_</sup> _i_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup>
_i_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> can be expressed as
_s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup>
<sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup> = _s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup>
<sup>(</sup> _i_ <sup>_r_</sup> <sup>)(</sup> <sup>_x_</sup> <sup>_,_</sup> <sup>_v_</sup> <sup>) =</sup> <sup>_vl ⊕_</sup> <sup>_g_</sup> <sup>(</sup> <sup>_x_</sup> <sup>_,_</sup> <sup>_v_</sup> <sup>)</sup> <sup>_,_</sup>
where each monomial in _g_ does not contain the variable _vl_ . Then, the state bit _s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup>
where each monomial in _g_ does not contain the variable _vl_ . Then, the state bit _s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup> can be
nullified by assigning _g_ ( _x_ _,_ _v_ ) to _vl_ . Let _v_ <sup>_′_</sup> = ( _v_ 0 _, . . ., vl−_ 1 _, g, vl_ +1 _, . . ., vm−_ 1) be a vector
derived from _v_ . The state bit _s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup> is nullified for _s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup> = _s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>)(</sup> <sup>_x_</sup> <sup>_,_</sup> <sup>_v_</sup> <sup>_′_</sup> <sup>) = 0.</sup> <sup>The</sup> <sup>expression</sup> <sup>_g_</sup> <sup>is</sup>
_s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup> is nullified for _s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup>
<sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup> = _s_ <sup>(</sup> _i_ <sup>_r_</sup> <sup>)</sup>
<sup>(</sup> _i_ <sup>_r_</sup> <sup>)(</sup> <sup>_x_</sup> <sup>_,_</sup> <sup>_v_</sup> <sup>_′_</sup> <sup>) = 0.</sup> <sup>The</sup> <sup>expression</sup> <sup>_g_</sup> <sup>is</sup>
<u>198</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
referred to as the dynamic value and the variable _vl_ is referred to as the dynamic variable.
If there are several crucial state bits _s_ <sup>(</sup> _i_ 1 <sup>_r_</sup> <sup>1)</sup> _, . . ., s_ <sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup> (we always assume _r_ 1 _≤· · ·_ _≤_ _rt_
hereafter) to be nullified, then the dynamic variables _vl_ 1 _, . . ., vlt_ need to be replaced by the
corresponding dynamic values _g_ 1 _, . . ., gt_ recursively. Since the dynamic values are uniquely
determined by the pairs in _NS_ = _{_ ( _vl_ 1 _, s_ <sup>(</sup> _i_ 1 <sup>_r_</sup> <sup>1)</sup> ) _, . . .,_ ( _vlt, s_ <sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup> ) _}_, the authors referred to the
<sup>(</sup> _i_ 1 <sup>_r_</sup> <sup>1)</sup> _, . . ., s_ <sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup>
<sup>(</sup> _i_ 1 <sup>_r_</sup> <sup>1)</sup> ) _, . . .,_ ( _vlt, s_ <sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup>
determined by the pairs in _NS_ = _{_ ( _vl_ 1 _, s_ <sup>(</sup> _i_ 1 <sup>_r_</sup> <sup>1)</sup> ) _, . . .,_ ( _vlt, s_ <sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup> ) _}_, the authors referred to the
set _NS_ as the “nullification strategy”.
Once a nullification strategy _NS_ and a cube _I_ are confirmed, we can identify a set of
key expressions (including key variables) that need to be guessed. By guessing the values of
these key expressions, we can obtain a set of dynamic values. To-be-guessed key expressions
are denoted as _G_ = ( _g_ 0 _, g_ 1 _, . . ., gκ−_ 1) where _gj_ _∈_ F2[ _x_ ] for _j_ _∈{_ 0 _, . . ., κ −_ 1 _}_ . There are a
total of 2 <sup>_κ_</sup> different key guesses, denoted by _G_ _µ_ = ( _g_ 0 _⊕_ _µ_ [0] _, . . ., gκ−_ 1 _⊕_ _µ_ [ _κ −_ 1]), where
_µ_ _∈{_ 0 _, . . .,_ 2 <sup>_κ_</sup> _−_ 1 _}_ and _µ_ [ _i_ ] represents the _i_ th bit of _µ_ . Obviously, _µ_ = 0 is the correct
key guess. For a predefined nullification strategy, it is necessary to find a batch of cubes
that satisfy the following criteria: the corresponding superpolies should be 0-constant
polynomials (i.e., the bias is 2 <sup>_−_</sup> <sup>1</sup> ) under the correct key guess; under any wrong key guess,
the corresponding superpolies should be high-degree polynomials with a bias less than
2 <sup>_−_</sup> <sup>1</sup> . Such cubes can effectively differentiate between correct and wrong key guesses, thus
recovering key information.
There are two important contributions in [HJL <sup>+</sup> 20] for the dynamic cube attack. One
is applying the conventional bit-based division property (CBDP) with the “flag” technique
to the dynamic cube attack and proposing a new MILP modeling method. The MILP
model established by this method can be used to estimate the algebraic degree of the
superpoly for a given cube, provided that the nullification strategy is predefined and the
assignment of the non-cube IV is fixed. The models can not only describe the zero-sum (or
bias) for the correct key guess but also analyze the randomness in the wrong guesses. This
modeling method forms the basis for division property based dynamic cube attacks. See
[HIJ <sup>+</sup> 19, HJL <sup>+</sup> 20] for more details about the propagation rules of CBDP and its MILP
modeling techniques.
The other is drawing links between the bias and the division property. To achieve this,
two new concepts were proposed: _split_ _set_ and _minimal_ _split_ _set_, along with an assumption.
They found that the bias of a superpoly is closely related to the split set and further proved
that the minimal split set can draw lower bounds on the bias in superpolies under the
given assumption. Based on these two new concepts and the assumption, a new method
was proposed to theoretically estimate the bias for superpolies of large cubes.
Definition 3. ([HJL <sup>+</sup> 20]) Let _pI_ ( _k_ ) be a superpoly. Let Λ be a subset of secret key
indices. It defines a key class _W_ Λ _⊂_ F <sup>_n_</sup> 2 <sup>as</sup> <sup>follows:</sup>
_W_ Λ = _{_ _x_ _∈_ F <sup>_n_</sup> 2 <sup>_|xi_</sup> <sup>= 0</sup> <sup>for</sup> <sup>all</sup> <sup>_i ∈_</sup> <sup>Λ</sup> <sup>_}._</sup>
Such Λ is referred to as a split set if the superpoly _pI_ ( _k_ ) satisfies _pI_ ( _x_ ) _≡_ 0 for all _x_ _∈_ _W_ Λ.
Further, we call this Λ a minimal split set if, for all Λ <sup>_′_</sup> with size _|_ Λ <sup>_′_</sup> _|_ _<_ _|_ Λ _|_ and the
corresponding key class _W_ Λ _′_, there is _pI_ ( _x_ ) _≡/_ 0 for _x_ _∈_ _W_ Λ _′_ .
Assumption 1. _([HJL_ <sup>+</sup> _20])_ _For_ _a_ _minimal_ _split_ _set_ Λ _and_ _its_ _corresponding_ _key_ _class_
_W_ Λ _,_ _we_ _assume_
Pr( _pI_ ( _x_ ) = 0 _|_ _x_ _∈_ _W_ Λ) = 2 <sup>_−_</sup> <sup>1</sup> _,_ _where_ _W_ Λ ≜ F <sup>_n_</sup> 2 <sup>_\W_</sup> <sup>Λ</sup> <sup>_._</sup>
For a superpoly _pI_ ( _k_ ), let Λ be a minimal split set of _pI_ ( _k_ ). Then it follows from
Definition 3 and Assumption 1 that
Pr( _pI_ ( _k_ ) = 0) = 2 <sup>_−_</sup> <sup>1</sup> + 2 <sup>_−_</sup> <sup>(</sup> <sup>_|_</sup> <sup>Λ</sup> <sup>_|_</sup> <sup>+1)</sup> _,_
and so the bias of _pI_ ( _k_ ) is set to be 2 <sup>_−_</sup> <sup>(</sup> <sup>_|_</sup> <sup>Λ</sup> <sup>_|_</sup> <sup>+1)</sup> . Note that the accuracy of such bias
evaluation depends on the rationality of Assumption 1.
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>199</u>
Although Hao et al. provided a reliable framework for dynamic cube attacks in theory,
the implementation of their attack against the full Grain-128 is not in accordance with
their theory, which makes the key-recovery attack invalid.
3.2 Inaccuracy in the MILP models for dynamic cube attacks
The MILP modeling technique for dynamic cube attacks proposed in [HJL <sup>+</sup> 20] can be
utilized to evaluate the algebraic degree of the superpoly, provided that the nullification
strategy and the cube are predefined. This modeling technique is essential for constructing
qualified cubes, and its accuracy determines the effectiveness of the results of dynamic
cube attacks. Upon analyzing this modeling technique, we discovered that the specific
modeling process did not consider the algebraic structure of Grain family of ciphers. This
oversight led to many redundant division trails in their models, which may result in an
inaccurate estimation of the algebraic degree of a superpoly.
Through further experiments, we discovered that the qualified cubes used in [HJL <sup>+</sup> 20]
do not meet the specified requirements. Specifically, the superpolies corresponding to these
cubes are 0-constant polynomials under both correct and wrong key guesses, making it
impossible to correctly distinguish between correct and wrong key guesses. To illustrate
the issues in this modeling technique, we will first describe the propagation of division
property from an algebraic perspective.
The propagation of division property from an algebraic perspective. Generally,
an iterative stream cipher _f_ ( _k_ _,_ _v_ ) can be further decomposed into a composition of simple
vectorial Boolean functions as follows,
_f_ ( _k_ _,_ _v_ ) = _Fout ◦_ _F_ _r ◦· · · ◦_ _F_ 0( _k_ _,_ _v_ ) _,_ (3)
<sup>_N_</sup> 2 <sup>_→_</sup> <sup>F</sup> <sup>_N_</sup> 2 <sup>(</sup> <sup>_i_</sup> <sup>_∈{_</sup> <sup>1</sup> <sup>_,_</sup> <sup>2</sup> <sup>_, . . ., r}_</sup> <sup>),</sup> <sup>_F_</sup> <sup>0</sup> <sup>:</sup> <sup>F</sup> 2 <sup>_n_</sup> <sup>+</sup> <sup>_m_</sup> _→_ F <sup>_N_</sup> 2
where _F_ _i_ : F <sup>_N_</sup> 2
where _F_ _i_ : F <sup>_N_</sup> 2 <sup>_→_</sup> <sup>F</sup> <sup>_N_</sup> 2 <sup>(</sup> <sup>_i_</sup> <sup>_∈{_</sup> <sup>1</sup> <sup>_,_</sup> <sup>2</sup> <sup>_, . . ., r}_</sup> <sup>),</sup> <sup>_F_</sup> <sup>0</sup> <sup>:</sup> <sup>F</sup> 2 <sup>_n_</sup> <sup>+</sup> <sup>_m_</sup> _→_ F <sup>_N_</sup> 2 <sup>,</sup> <sup>and</sup> <sup>_Fout_</sup> <sup>:</sup> <sup>F</sup> <sup>_N_</sup> 2 <sup>_→_</sup> <sup>F2.</sup> <sup>Denote</sup>
_s_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> _∈_ F <sup>_N_</sup> 2 <sup>as</sup> <sup>the</sup> <sup>output</sup> <sup>of</sup> <sup>_F_</sup> <sup>_i_</sup> <sup>for</sup> <sup>_i_</sup> <sup>_∈{_</sup> <sup>0</sup> <sup>_, . . ., r}_</sup> <sup>.</sup> <sup>We</sup> <sup>refer</sup> <sup>to</sup> <sup>Eq.(3)</sup> <sup>as</sup> <sup>a</sup> <sup>composite</sup>
expression of _f_ ( _k_ _,_ _v_ ). Obviously, the composite expression of _f_ is not unique. From an
algebraic perspective, the 3SDP/u actually describes how a given monomial is propagated
in a composite expression of _f_ ( _k_ _,_ _v_ ).
Let us consider the propagation of the 3SDP/u as follows,
_F_ 1
_−−→_ L1
_F_ 2
_−−→· · ·_
_F_ _r_
_−−→_ L _r_
_F_ _out_
_−−−→_ L _out,_ ( _L_ )
_{_ _l_ _}_
_F_ 0
_−−→_ L0
where _l_ = ( _µ_ _,_ _ν_ ) _∈_ F <sup>_n_</sup> 2 <sup>+</sup> <sup>_m_</sup> . For the sequence of multisets _L_, if the multiset L _out_ is nonempty,
there must exist a three-subset division trail, denoted by
_−→· · ·p_
_−→p_ _l_ _r_
_−→p_ 1 _,_ ( _ι_ )
_l_
_−→p_ _l_ 0
where _l_ _i_ _∈_ L _i_ for _i ∈{_ 0 _, . . ., r}_ . According to the propagation rules of 3SDP/u, _l_ _i_ _−→p_ _l_ _i_ +1
means that the monomial _π_ _l_ _i_ ( _s_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> ) appears in the polynomial _π_ _l_ _i_ +1( _s_ <sup>(</sup> <sup>_i_</sup> <sup>+1)</sup> ) _∈_ Z <sup>¯</sup> [ _s_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> ].
Similarly, _l_ _i−_ 1 _−→p_ _l_ _i_ _−→p_ _l_ _i_ +1 means that the monomial _π_ _l_ _i−_ 1( _s_ ( _i−_ 1)) can appear in the
where _l_ _i_ _∈_ L _i_ for _i ∈{_ 0 _, . . ., r}_ . According to the propagation rules of 3SDP/u, _l_ _i_
Similarly, _l_ _i−_ 1 _−→p_ _l_ _i_ _−→p_ _l_ _i_ +1 means that the monomial _π_ _l_ _i−_ 1( _s_ ( _i−_ 1)) can appear in the
expansion of _π_ _l_ _i_ +1( _l_ _i_ +1) with respect to _s_ <sup>(</sup> <sup>_i−_</sup> <sup>1)</sup> . The trail _ι_ describes a propagation of the
monomial _π_ _l_ ( _k_ _,_ _v_ ) in a composite expression of _f_ ( _k_ _,_ _v_ ), and indicates that the monomial
_π_ _l_ ( _k_ _,_ _v_ ) appears in the expansion of _f_ with respect to _k_ and _v_ . However, the expansion of
different composite expressions of _f_ with respect to _k_ and _v_ may vary. This means that in
other composite expressions of _f_, the three-subset division trails connecting the monomial
_π_ _l_ ( _k_ _,_ _v_ ) and _f_ may not necessarily exist. We will illustrate this point through a simple
example.
Example 2. Let _x_ = ( _x_ 0 _, x_ 1 _, x_ 2 _, x_ 3) _∈_ F <sup>4</sup> 2 <sup>.</sup> <sup>Let</sup> <sup>_f_</sup> <sup>(</sup> <sup>_x_</sup> <sup>)</sup> <sup>=</sup> <sup>_x_</sup> <sup>0</sup> <sup>_x_</sup> <sup>1</sup> <sup>_⊕_</sup> <sup>_x_</sup> <sup>0</sup> <sup>_x_</sup> <sup>2</sup> <sup>_⊕_</sup> <sup>_x_</sup> <sup>1</sup> <sup>_x_</sup> <sup>2</sup> <sup>_⊕_</sup> <sup>_x_</sup> <sup>1</sup> <sup>_x_</sup> <sup>3</sup> <sup>_⊕_</sup>
_x_ 2 _x_ 3 _⊕_ _x_ 0 _⊕_ _x_ 3 _∈_ F2[ _x_ ]. The function _f_ can be represented as _f_ 1 = _Fo ◦_ _F_ 2 _◦_ _F_ 1( _x_ ), where
_−→p_ _l_ _i_
Example 2. Let _x_ = ( _x_ 0 _, x_ 1 _, x_ 2 _, x_ 3) _∈_ F <sup>4</sup> 2
_y_ = _F_ 1( _x_ ) = ( _x_ 0 _, x_ 1 _, x_ 2 _, x_ 3 _, x_ 3) _,_
_z_ = _F_ 2( _y_ ) = ( _y_ 0 _, y_ 0 + _y_ 1 + _y_ 4 _, y_ 2 _, y_ 0 + _y_ 2 + _y_ 4) _,_
<u>200</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
and _Fo_ ( _z_ ) = _z_ 1 _z_ 3. It is clear that the monomial _z_ 1 _z_ 3 can be expanded as the polynomial
of _x_ in Z <sup>¯</sup> [ _x_ ] as follows,
_z_ 1 _z_ 3 = ( _y_ 0 + _y_ 1 + _y_ 4) _·_ ( _y_ 0 + _y_ 2 + _y_ 4) ( _∈_ Z <sup>¯</sup> [ _y_ ])
= _y_ 0 _y_ 1 + _y_ 0 _y_ 2 + 2 _y_ 0 _y_ 4 + _y_ 1 _y_ 2 + _y_ 1 _y_ 4 + _y_ 2 _y_ 4 + _y_ 0 + _y_ 4 ( _∈_ Z <sup>¯</sup> [ _y_ ])
= _x_ 0 _x_ 1 + _x_ 0 _x_ 2 + 2 _x_ 0 _x_ 3 + _x_ 1 _x_ 2 + _x_ 1 _x_ 3 + _x_ 2 _x_ 3 + _x_ 0 + _x_ 3 ( _∈_ Z <sup>¯</sup> [ _x_ ])
Let _f_ 2 = _Fo ◦_ _F_ 2 <sup>_′_</sup> <sup>_◦_</sup> <sup>_F_</sup> 1 <sup>_′_</sup> <sup>(</sup> <sup>_x_</sup> <sup>)</sup> <sup>be</sup> <sup>another</sup> <sup>composite</sup> <sup>expression</sup> <sup>of</sup> <sup>_f_</sup> <sup>,</sup> <sup>where</sup>
_y_ = _F_ 1 <sup>_′_</sup> <sup>(</sup> <sup>_x_</sup> <sup>) = (</sup> <sup>_x_</sup> <sup>0</sup> <sup>_, x_</sup> <sup>1</sup> <sup>_, x_</sup> <sup>2</sup> <sup>_, x_</sup> <sup>3</sup> <sup>_, x_</sup> <sup>0</sup> <sup>+</sup> <sup>_x_</sup> <sup>3)</sup> <sup>_,_</sup>
_z_ = _F_ 2 <sup>_′_</sup> <sup>(</sup> <sup>_y_</sup> <sup>) = (</sup> <sup>_y_</sup> <sup>0</sup> <sup>_, y_</sup> <sup>1</sup> <sup>+</sup> <sup>_y_</sup> <sup>4</sup> <sup>_, y_</sup> <sup>2</sup> <sup>_, y_</sup> <sup>2</sup> <sup>+</sup> <sup>_y_</sup> <sup>4)</sup> <sup>_._</sup>
The expandsion of _z_ 1 _z_ 3 can be obtained as follows,
_z_ 1 _z_ 3 = ( _y_ 1 + _y_ 4) _·_ ( _y_ 2 + _y_ 4) = _y_ 1 _y_ 2 + _y_ 1 _y_ 4 + _y_ 2 _y_ 4 + _y_ 4 ( _∈_ Z <sup>¯</sup> [ _y_ ])
= _x_ 1 _x_ 2 + _x_ 1 _·_ ( _x_ 0 + _x_ 3) + _x_ 2 _·_ ( _x_ 0 + _x_ 3) + ( _x_ 0 + _x_ 3) ( _∈_ Z <sup>¯</sup> [ _x_ ])
For the first composite expression _f_ 1, there is an even number of division trails
connecting _x_ 0 _x_ 3 to _f_ . In contrast, no three-subset division trail connects _x_ 0 _x_ 3 to _f_ for
the second composite expression _f_ 2. Therefore, if we set _x_ 0 and _x_ 3 as cube variables and
construct the MILP model based on the composite expression _f_ 1, the estimated algebraic
degree of the superpoly in _f_ is not accurate due to redundant trails in the MILP model.
Therefore, when constructing the MILP model for a stream cipher _f_ ( _k_ _,_ _v_ ), the usage of
an inadequate composite expression for _f_ can result in numerous redundant trails within
the corresponding MILP model. The propagation rules of CBDP are similar to those of
3SDP/u, so the propagation of CBDP faces the same issues as 3SDP/u. This issue is
the primary reason for the failure of the dynamic cube attack against the full Grain-128
proposed in [HJL <sup>+</sup> 20].
Inaccuracy in the original MILP models. The original modeling technique for
dynamic cube attacks is to model round by round. Therefore, the _r_ -round Grain-128
_G_ ( _k_ _,_ _v_ ) is first decomposed into a composition of the round functions as Eq.(3).
Let ( _s_ <sup>(</sup> <sup>_i_</sup> <sup>+1)</sup> _,_ _b_ <sup>(</sup> <sup>_i_</sup> <sup>+1)</sup> ) = _F_ _i_ +1( _s_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> _,_ _b_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> ) for _i ∈{_ 0 _, . . ., r_ _−_ 1 _}_ and ( _s_ <sup>(0)</sup> _,_ _b_ <sup>(0)</sup> ) = _F_ 0( _k_ _,_ _v_ ). In
any round _i_, only two state bits, _si_ +128 and _bi_ +128, are updated respectively by _zi ⊕_ _fi ⊕_ _si_
and _zi ⊕_ _gi ⊕_ _si_, and the rest of the state bits are shifted. The additional binary variables
_fi_, _gi_ and _zi_ can be represented as the polynomial of _s_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> and _b_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> .
In the process of modeling the function _F_ _i_ +1, the additional binary variables _fi_, _gi_,
and _zi_ are first defined, and the algebraic relation between them and _s_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> as well as _b_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> are
added to the model as constraints. Then, the expressions of _s_ <sup>(</sup> <sup>_i_</sup> <sup>+1)</sup> and _b_ <sup>(</sup> <sup>_i_</sup> <sup>+1)</sup> with respect
to _s_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup>, _b_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup>, _fi_, _gi_ and _zi_ are added to the model. However, the MILP model established
by this method may have redundant division trails, since _zi ⊕_ _si_ is involved in both two
update functions of _si_ +128 and _bi_ +128, which makes the following equations hold,
_si_ +128 _bi_ +128 = ( _fi_ + _zi_ + _si_ ) _·_ ( _gi_ + _zi_ + _si_ ) ( _∈_ Z <sup>¯</sup> [ _s_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> _,_ _b_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> _, fi, gi, zi_ ])
= _fi · gi_ + ( _fi_ + _gi_ ) _·_ ( _zi_ + _si_ )
+ 2 _zi · si_ + _zi_ + _si._ ( _∈_ Z <sup>¯</sup> [ _s_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> _,_ _b_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> _, fi, gi, zi_ ])
Another issue with the original MILP models is that the imposed constraints, based on
the nullification strategy, do not consider the specific structure of Grain-128. We will use
the nullification strategy in [HJL <sup>+</sup> 20] as an example to illustrate this issue.
For the nullification strategy _NS_ = _{_ ( _v_ 30 _, b_ 158) _}_, the IV variable _v_ 30 is first set as
a dynamic variable, and its dynamic value is determined by the ANF of _b_ 158 under
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>201</u>
a specific key guess. For the correct key guess, we have the equations _b_ 158 = 0 and
_v_ 30 = _g_ 30 + _z_ 30, which are added to the MILP model as the constraints. Then, the other
state bit _s_ 158 is updated by the expression _z_ 30 + _f_ 30 + _s_ 30 in the MILP model. The
modeling process described above is algebraically sound, but it may result in many division
trails in the MILP model that should not exist. This is because the MILP model does
not consider the cancellation property. Due to the nullification strategy _NS_, the equations
_v_ 30 = _z_ 30 + _g_ 30 and _s_ 30 = _v_ 30 are satisfied in the MILP model, thereby, the equation
_s_ 158 = _z_ 30 + _f_ 30 + _s_ 30 = 2 _· z_ 30 + _f_ 30 + _g_ 30 also satisfying in the MILP model, which makes
many redundant trails in this model.
In [HJL <sup>+</sup> 20], the presence of numerous redundant trails in the model led to inaccurate
results, causing the cubes identified as “qualified” to be unable to distinguish between
correct and wrong key guesses. This directly rendered the key-recovery attack against the
full Grain-128 invalid.
3.3 Empirical analysis of the impact caused by wrong key guesses
Evaluating the bias of the superpoly for each wrong key guess in practical scenarios presents
challenges due to the exponential increase in the quantity of wrong key guesses as the
number of key expressions to be guessed rises. This task necessitates solving numerous
MILP models, which is a time-consuming process and incurs substantial computational
costs. Constrained by the MILP modeling technique and computational capacity, Hao et al.
introduced a resolution, which is to identify a specific wrong key guess that is considered
to have potentially significant bias and is closest to the bias under the correct key guess.
For a predefined nullification strategy, _NS_ = _{_ ( _l_ 1 _, s_ <sup>(</sup> _i_ 1 <sup>_r_</sup> <sup>1)</sup>
<sup>(</sup> _i_ 1 <sup>_r_</sup> <sup>1)</sup> ) _, . . .,_ ( _lt, s_ <sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup>
<sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup> ) _}_, Hao et al.
<sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup> = 1 and _s_ <sup>(</sup> _ij_ <sup>_rj_</sup> <sup>)</sup>
considered the wrong key guess satisfying the conditions _s_ <sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup>
<sup>(</sup> _ij_ <sup>_rj_</sup> <sup>)</sup> = 0 (1 _≤_
_j_ _≤_ _t −_ 1) as special, since under such a wrong key guess, the intermediate state bit _s_ <sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup>
_it_
has the simplest ANF, i.e., _s_ <sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup> = 1, and the other intermediate state bits that require
has the simplest ANF, i.e., _s_ <sup>(</sup> _it_ <sup>_rt_</sup> <sup>)</sup> = 1, and the other intermediate state bits that require
nullification are successfully nullified. By contrast, the ANFs of the intermediate state bits
that required nullification become more complex under other wrong key guesses.
Intuitively, as the complexity of the ANFs of the intermediate state bits that require
nullification increases, the complexity of the superpoly may also increase, potentially
resulting in a smaller bias of the superpoly. Therefore, the special wrong key guess is
considered to have the most significant bias among all wrong key guesses. Based on the
above view, if a batch of cubes can successfully differentiate between the correct key guess
and such a specific wrong key guess, it implies that the batch of cubes can successfully
differentiate between the correct key guess and all wrong key guesses. This solution
not only reduces the requirements for modeling techniques but also greatly reduces the
computational workload.
However, the validity of this viewpoint lacks inferences drawn from theoretical analysis;
instead, it is based on personal experiences and intuition, which may lead to the division
property based dynamic cube attack encountering similar issues as the traditional dynamic
cube attack; that is, the constructed cubes may not guarantee successful differentiation
between the correct key guess and all wrong key guesses.
## 4 More accurate bias evaluation for high-dimension cubes
Due to computational constraints, evaluating biases for high-dimension cubes has always
been an extremely challenging problem. Hao et al. in [HJL <sup>+</sup> 20] first established connections
between the bias phenomenon and the division property, introducing a bias evaluation
method based on the minimal split set. However, this method has significant limitations
because its accuracy depends on Assumption 1. If Assumption 1 is unsuitable for a certain
<u>202</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
cryptosystem, then this method cannot provide a relatively accurate estimate of bias. In
[HJL <sup>+</sup> 20], this method was applied in the division property based cube attack against the
full Grain-128. However, based on our experiments, we found that Assumption 1 is not
universally true for the Grain family of ciphers.
In this section, we present a new technique called Polynomial Approximation with
regard to Bias (PAB) to evaluate the bias of the superpolies for the dynamic cube attack.
The basic idea is that when dealing with a complex unknown polynomial, we identify
and leverage its various algebraic properties to construct a simpler, known polynomial.
By leveraging these properties, the constructed polynomial closely reflects the bias of the
original one. Consequently, the original polynomial can be evaluated by detecting bias of
the constructed polynomial. Prior to presenting the new method for evaluating bias in
Section 4.1, we will first describe a trivial method for calculating the actual bias in Section
4.2.
4.1 A trivial method for calculating practical bias
Identifying biases of superpolies of high-dimension cubes through experimental testing
is not feasible in cube attacks due to the computational complexity involved, which far
exceeds current computational capabilities. In current cube attacks against stream ciphers,
the dimensions of cubes that can be experimentally tested are mostly around 40 dimensions,
not exceeding 50 dimensions.
With the _three-subset_ _division_ _property_ _without_ _unknown_ _set_ (3SDP/u) and its MILP
modeling technique proposed in [HLM <sup>+</sup> 20, HLM <sup>+</sup> 21], it is possible to recover the exact
ANF of a superpoly. Subsequently, by combining 3SDP/u with the divide-and-conquer
strategy, a series of state-of-the-art methods were proposed in [Sun21, HST <sup>+</sup> 21, HHPW22],
which demonstrate high efficacy in the massive superpoly recovery. Therefore, we can use
the accurately recovered superpoly to calculate its bias directly. Fortunately, recovering
the corresponding superpoly in dynamic cube attacks is more accessible than in other
variants of the cube attack, as a nullification strategy is applied to simplify the superpoly
of the output bit, which makes enumerating all feasible solutions in the MILP model easier.
For a predetermined nullification strategy, if the superpoly under a specific wrong key
guess has been successfully recovered, we can use experimental testing to detect its bias
directly. Let _pI_ ( _k_ ) represent the recovered superpoly of a given cube _I_ . The process of
detecting bias of _pI_ is simple and follows these steps.
1. Identify the key variables included in _pI_, denoted as K = _{ki_ 1 _, ki_ 2 _, . . ., kit}_ .
2. Randomly assign values to the key variables in K multiple times, denoted as
_κ_ 1 _, . . ., κN_, as _N_ different inputs for the superpoly _pI_ .
3. compute the bias _εN_ = 2 <sup>_−_</sup> <sup>1</sup> _−_ _N_ <sup>_−_</sup> <sup>1</sup> _·_ <sup>�</sup> _i_ <sup>_N_</sup> =1 <sup>_pI_</sup> <sup>(</sup> <sup>_κi_</sup> <sup>).</sup>
As described in Section 2.2, if the obtained value _εN_ satisfies Eq.(2), it can be regarded as
the practical bias of _pI_, and this bias can be detected with the significance level _α_ using
_N_ random inputs of _pI_ . If _N_ does not satisfy Eq.(2), choose a new _N_ <sup>_′_</sup> such that
_<u>α</u>_
_N_ <sup>_′_</sup> _≥_ <sup>_<u>u</u>_</sup> <sup>2</sup>
2 _ε_ <sup>2</sup> _N_
and repeat the aforementioned process.
_,_
4.2 Polynomial Approximation with regard to Bias
While the process of recovering a massive superpoly is currently quite effective, it still
involves significant computational and time expenses. Additionally, as the number of
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>203</u>
initialization rounds of a cryptosystem increases, the superpoly simplified by the nullification strategy will also become more complex, making it difficult to recover its exact
ANF. Therefore, a method is required to provide accurate bias evaluation with fewer
computational requirements and faster processing times.
In this part, we will introduce a new method for evaluating bias based on a new
technique, called Polynomial Approximation with regard to Bias. The new technique is not
to recover the entire superpoly but to recover a portion of it and identify specific algebraic
properties of the remaining portion, thereby constructing a polynomial with a bias similar
to that in the complete superpoly, which we refer to as an approximate polynomial of the
superpoly. Accordingly, the bias of the superpoly can be evaluated by detecting the bias
of the approximate polynomial.
An _r_ -round iterative stream cipher _f_ ( _k_ _,_ _v_ ) can be decomposed into a composition of
round functions as Eq.(3). By choosing a proper positive number _r_ 0 _∈{_ 0 _, . . ., r −_ 1 _}_,
_f_ ( _k_ _,_ _v_ ) can be represented as follows:
_f_ ( _k_ _,_ _v_ ) = _Fo ◦_ _F_ _r ◦· · · ◦_ _F_ _r_ 0+1( _s_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> ) _,_
=
_ω_ _∈_ Ω <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>
_π_ _ω_ ( _s_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> ) _,_
where Ω <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> ≜ _{_ _ω_ _∈_ F <sup>_N_</sup> 2 <sup>_|π_</sup> <sup>_ω_</sup> <sup>(</sup> <sup>_s_</sup> <sup>(</sup> <sup>_r_</sup> <sup>0))</sup> <sup>_→_</sup> <sup>_f_</sup> <sup>_}_</sup> <sup>,</sup> <sup>and</sup> <sup>_s_</sup> <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> <sup>=</sup> <sup>_F_</sup> <sup>_r_</sup> 0 <sup>_◦· · · ◦_</sup> <sup>_F_</sup> <sup>0(</sup> <sup>_k_</sup> <sup>_,_</sup> <sup>_v_</sup> <sup>).</sup> <sup>For</sup> <sup>a</sup> <sup>specified</sup>
cube _I_, we denote the superpoly of _I_ in _π_ _ω_ ( _s_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> ) as _p_ _ω_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>, and try to recover these
superpolies. The method of superpoly recovery is to construct the corresponding MILP
model _M_ <sup>_r_</sup> _ω_ <sup>0</sup> <sup>with</sup> <sup>a</sup> <sup>time</sup> <sup>limit</sup> <sup>for</sup> <sup>each</sup> <sup>monomial</sup> <sup>_π_</sup> <sup>_ω_</sup> <sup>(</sup> <sup>_s_</sup> <sup>(</sup> <sup>_r_</sup> <sup>0))</sup> <sup>in</sup> <sup>_f_</sup> <sup>.</sup> <sup>If</sup> <sup>the</sup> <sup>model</sup> <sup>_Mr_</sup> _ω_ <sup>0</sup> <sup>is</sup> <sup>not</sup>
solved within the time limit, the procedure will be forcibly terminated. Depending on
whether the model _M_ <sup>_r_</sup> _ω_ <sup>0</sup> <sup>determined</sup> <sup>by</sup> <sup>_ω_</sup> <sup>_∈_</sup> <sup>Ω(</sup> <sup>_r_</sup> <sup>0)</sup> <sup>can</sup> <sup>return</sup> <sup>all</sup> <sup>feasible</sup> <sup>solutions</sup> <sup>within</sup>
the time limit, the function _f_ can be represented as
_ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup>
_π_ _ω_ ( _s_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> ) ≜ _fs_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>
_s_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> _⊕_ _fu_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>
_u_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> _,_
_f_ =
_ω_ _∈_ Ω <sup>(</sup> _s_ <sup>_r_</sup> <sup>0)</sup>
_π_ _ω_ ( _s_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> ) _⊕_
where
_s_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> = _{_ _ω_ _∈_ Ω <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> _|M_ <sup>_r_</sup> _ω_ <sup>0</sup>
_u_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> = _{_ _ω_ _∈_ Ω <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> _|M_ <sup>_r_</sup> _ω_ <sup>0</sup>
Ω _s_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>
Ω _u_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>
<sup>_r_</sup> _ω_ <sup>0</sup> <sup>is</sup> <sup>solved</sup> <sup>within</sup> <sup>the</sup> <sup>time</sup> <sup>limit</sup> <sup>and</sup> <sup>_p_</sup> <sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup>
<sup>_r_</sup> _ω_ <sup>0</sup> <sup>is</sup> <sup>unsolved</sup> <sup>within</sup> <sup>the</sup> <sup>time</sup> <sup>limit</sup> <sup>and</sup> <sup>_p_</sup> <sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup>
<sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup> is still unknown _}._
<sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup> has been recovered _},_
Obviously, the superpoly _p_ <sup>(</sup> _s_ <sup>_r_</sup> <sup>0)</sup>
Furthermore, if the set Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup>
<sup>(</sup> _s_ <sup>_r_</sup> <sup>0)</sup> in _fs_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>
_fs_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> has been recovered, namely _p_ <sup>(</sup> _s_ <sup>_r_</sup> <sup>0)</sup>
<sup>(</sup> _s_ <sup>_r_</sup> <sup>0)</sup>
= <sup>�</sup>
_ω_ _∈_ Ω <sup>(</sup> _s_ <sup>_r_</sup> <sup>0)</sup>
<sup>(</sup> _s_ <sup>_r_</sup> <sup>0)</sup> _p_ <sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup>
<sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup> _._
Furthermore, if the set Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup> is empty, the superpoly _pI_ will be successfully recovered.
However, recovering the superpoly is a challenging task, making it almost impossible for
the set Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup> to be empty, and our primary goal is to handle the monomials determined by
the set Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup> .
Each monomial _ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup> undergoes a detection process to ascertain whether its
superpoly is divisible by the variables _k_ 0 _, . . ., kn−_ 1. Assuming that the superpoly _p_ <sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup> is
divisible by the variables _{ki_ 1 _, . . ., kit}_, it can be represented as follows:
set Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup> .
Each monomial _ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup>
<sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup> = _k_ <sup>_µ_</sup> _· q_ _ω_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>
_p_ <sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup>
_ω_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> _,_
where _µ_ ( _∈_ F <sup>_n_</sup> 2
_q_ _ω_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>
<sup>_n_</sup> 2 <sup>)</sup> <sup>satisfys</sup> <sup>_kµ_</sup> <sup>= �</sup> _j_ <sup>_t_</sup> =1 <sup>_ki_</sup> _j_ <sup>.</sup> <sup>It</sup> <sup>is</sup> <sup>noteworthy</sup> <sup>to</sup> <sup>highlight</sup> <sup>that</sup> <sup>the</sup> <sup>polynomial</sup>
_ω_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> still remains unknown. If the superpoly in each monomial _ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup>
_q_ _ω_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> still remains unknown. If the superpoly in each monomial _ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup> has such a
representation, i.e., _p_ <sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup> = _k_ <sup>_µω_</sup> _· q_ _ω_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>, then the entire superpoly _pI_ can be represented as
<sup>(</sup> _ω_ <sup>_r_</sup> <sup>0)</sup> = _k_ <sup>_µω_</sup> _· q_ _ω_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>,
_ω_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>, then the entire superpoly _pI_ can be represented as
_k_ <sup>_µω_</sup> _· q_ _ω_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> _._
_pI_ = _p_ <sup>(</sup> _s_ <sup>_r_</sup> <sup>0)</sup> _⊕_
_ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_r_</sup> <sup>0)</sup>
<u>204</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
Otherwise, we will choose another positive integer _r_ 1 _∈{_ 0 _, . . ., r_ 0 _−_ 1 _}_, and then expand
the polynomial _fu_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> into a polynomial _f_ <sup>(</sup> <sup>_r_</sup> <sup>1)</sup> in terms of _s_ <sup>(</sup> <sup>_r_</sup> <sup>1)</sup> as follows,
_f_ <sup>(</sup> <sup>_r_</sup> <sup>1)</sup> =
_ω_ _∈_ Ω <sup>(</sup> <sup>_r_</sup> <sup>1)</sup>
_π_ _ω_ ( _s_ <sup>(</sup> <sup>_r_</sup> <sup>1)</sup> ) _,_
where Ω <sup>(</sup> <sup>_r_</sup> <sup>1)</sup> = _{_ _ω_ _∈_ F <sup>_N_</sup> 2 <sup>_|π_</sup> <sup>_ω_</sup> <sup>(</sup> <sup>_s_</sup> <sup>(</sup> <sup>_r_</sup> <sup>1))</sup> <sup>_→_</sup> <sup>_f_</sup> _u_ <sup>(</sup> <sup>_r_</sup> <sup>0)</sup> _}_ . We repeat the process of dealing with Ω <sup>(</sup> <sup>_r_</sup> <sup>0)</sup>
along with the number of rounds reducing (0 _<_ _rt_ _<_ _· · ·_ _<_ _r_ 1 _<_ _r_ 0) until we obtain the
following equation, i.e.,
_k_ <sup>_µω_</sup> _· q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> _,_ (4)
_pI_ = _ps ⊕_
_ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_rt_</sup> <sup>)</sup>
_i_ <sup>_t_</sup> =0 <sup>_p_</sup> <sup>(</sup> _s_ <sup>_ri_</sup> <sup>)</sup>
where _ps_ = <sup>�</sup> _i_ <sup>_t_</sup>
<sup>(</sup> _s_ <sup>_ri_</sup> <sup>)</sup> . The worst-case scenario of this process is that Ω <sup>(</sup> _u_ <sup>_rt_</sup> <sup>)</sup>
where _ps_ = <sup>�</sup> _i_ <sup>_t_</sup> =0 <sup>_p_</sup> <sup>(</sup> _s_ <sup>_ri_</sup> <sup>)</sup> . The worst-case scenario of this process is that Ω <sup>(</sup> _u_ <sup>_rt_</sup> <sup>)</sup> is an empty
set, indicating that the entire superpoly has been recovered.
For each _ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_rt_</sup> <sup>)</sup>, the superpoly _p_ <sup>(</sup> _ω_ <sup>_rt_</sup> <sup>)</sup> in _π_ _ω_ ( _s_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> ) is considered a relatively complex
polynomial due to the inability to enumerate all potential three-subset division trails within
a time limit. The polynomial _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> serves as the predominant component of polynomial
_p_ <sup>(</sup> _ω_ <sup>_rt_</sup> <sup>)</sup>, thus indicating that polynomial _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> possesses a level of complexity equivalent to that
of polynomial _p_ <sup>(</sup> _ω_ <sup>_rt_</sup> <sup>)</sup>, making it difficult to recover the ANF of _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> . Hence, it is crucial to
determine how to provide an approximate polynomial that maintains a bias similar to the
bias of _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> when constructing an approximate polynomial of the superpoly _pI_ . According
to the equation _p_ <sup>(</sup> _ω_ <sup>_rt_</sup> <sup>)</sup> = _k_ <sup>_µ_</sup> _· q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup>, the part _k_ <sup>_µ_</sup> in _p_ <sup>(</sup> _ω_ <sup>_rt_</sup> <sup>)</sup> that is most correlated with the
key variables _{k_ 0 _, . . ., kn−_ 1 _}_ has been extracted. Therefore, we consider the correlation
between _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> and the key variables notably feeble.
Given this understanding, it is possible to introduce a new variable _x_ _ω_ _∈_ F2 as substitutes for the unidentified polynomial _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup>, leading to the derivation of a new polynomial
_p_ <sup>_′_</sup> _I_ <sup>expressed</sup> <sup>in</sup> <sup>terms</sup> <sup>of</sup> <sup>_k_</sup> <sup>and</sup> <sup>_{x_</sup> <sup>_ω_</sup> <sup>_}_</sup> _ω_ _∈_ Ω <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> as follows,
For each _ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_rt_</sup> <sup>)</sup>
<sup>(</sup> _u_ <sup>_rt_</sup> <sup>)</sup>, the superpoly _p_ <sup>(</sup> _ω_ <sup>_rt_</sup> <sup>)</sup>
<sup>(</sup> _ω_ <sup>_rt_</sup> <sup>)</sup>, thus indicating that polynomial _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup>
<sup>(</sup> _ω_ <sup>_rt_</sup> <sup>)</sup>, making it difficult to recover the ANF of _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup>
<sup>(</sup> _ω_ <sup>_rt_</sup> <sup>)</sup> = _k_ <sup>_µ_</sup> _· q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup>,
_ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup>, the part _k_ <sup>_µ_</sup> in _p_ <sup>(</sup> _ω_ <sup>_rt_</sup> <sup>)</sup>
<sup>_′_</sup> _I_ <sup>expressed</sup> <sup>in</sup> <sup>terms</sup> <sup>of</sup> <sup>_k_</sup> <sup>and</sup> <sup>_{x_</sup> <sup>_ω_</sup> <sup>_}_</sup> _ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_rt_</sup> <sup>)</sup>
<sup>(</sup> _u_ <sup>_rt_</sup> <sup>)</sup> as follows,
_k_ <sup>_µω_</sup> _· x_ _ω_ _._ (5)
_p_ <sup>_′_</sup> _I_ <sup>=</sup> <sup>_ps_</sup> <sup>_⊕_</sup>
_ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_rt_</sup> <sup>)</sup>
It can be seen that _p_ <sup>_′_</sup> _I_
It can be seen that _p_ <sup>_′_</sup> _I_ <sup>is</sup> <sup>a</sup> <sup>simple</sup> <sup>and</sup> <sup>identified</sup> <sup>polynomial</sup> <sup>whose</sup> <sup>bias</sup> <sup>can</sup> <sup>be</sup> <sup>detected</sup>
by the method described in Section 4.1. However, there is a significant gap between the
practical bias _p_ <sup>_′_</sup> _I_ <sup>and</sup> <sup>_pI_</sup> <sup>,</sup> <sup>and</sup> <sup>the</sup> <sup>reasons</sup> <sup>mainly</sup> <sup>lie</sup> <sup>in</sup> <sup>two</sup> <sup>aspects.</sup>
<sup>_′_</sup> _I_ <sup>and</sup> <sup>_pI_</sup> <sup>,</sup> <sup>and</sup> <sup>the</sup> <sup>reasons</sup> <sup>mainly</sup> <sup>lie</sup> <sup>in</sup> <sup>two</sup> <sup>aspects.</sup>
1. The polynomial _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> has a bias that is not equal to 0 . Although the polynomial
_q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> is extremely complex, it does not mean that it is balanced. Therefore, the
_q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> is extremely complex, it does not mean that it is balanced. Therefore, the
new variable _x_ _ω_ used to replace _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> should not be randomly distributed over F2,
new variable _x_ _ω_ used to replace _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> should not be randomly distributed over F2,
implying that Pr( _x_ _ω_ = 1) _̸_ = Pr( _x_ _ω_ = 0).
2. Too many new variables were introduced. There are correlations among the
polynomials _{q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> _}_ _ω_ _∈_ Ω( _rt_ ) and variables _k_ ; however, the newly introduced variables
_ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> _}_ _ω_ _∈_ Ω _u_ ( _rt_ )
polynomials _{q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup> _}_ _ω_ _∈_ Ω _u_ ( _rt_ ) and variables _k_ ; however, the newly introduced variables
are not correlated with each other or with the original variables. This implies that
the more new variables we add, the smaller the bias of _p_ <sup>_′_</sup> _I_ <sup>will</sup> <sup>be,</sup> <sup>which</sup> <sup>can</sup> <sup>be</sup>
proven by the piling-up lemma.
To mitigate these issues, we introduced a new algebraic property of polynomials, referred
to as _the_ _minimum_ _algebraic_ _degree_ . Based on this property, we proposed a heuristic
method to estimate the probability of each new variable taking the value of 1.
Definition 4 (The minimal algebraic degree) . The Boolean function _f_ can be represented
as follows,
_a_ _µx_ <sup>_µ_</sup> _⊕_ _c,_ where _a_ _µ_ and _c ∈_ F2 _._
_̸_ <sup>_n_</sup> 2
_f_ ( _x_ ) =
_µ_ _̸_ =(0 _,...,_ 0) _∈_ F <sup>_n_</sup> 2
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>205</u>
We denote the minimal algebraic degree of the function _f_ as deg _m_ ( _f_ ), defined as
deg _m_ ( _f_ ) = ( _−_ 1) <sup>_c_</sup> _·_ min _{wt_ ( _µ_ ) _|_ _x_ <sup>_µ_</sup> _→_ _f_ _}._
A heuristic method for probability estimation. For each _ω_ _∈_ Ω <sup>(</sup> _u_ <sup>_rt_</sup> <sup>)</sup>, we heuristically
use the minimal algebraic degree of _q_ _ω_ <sup>(</sup> <sup>_rt_</sup> <sup>)</sup>, denoted by _d_ _ω_, to define the probability of _x_ _ω_
taking the value 1, i.e.,
Pr( _x_ _ω_ = 1) =
- 2 <sup>_−d_</sup> <sup>_ω_</sup> _,_ if _d_ _ω_ _>_ 0 _,_
1 _−_ 2 <sup>_d_</sup> <sup>_ω_</sup> _,_ otherwise _._
The heuristic method is based on a simple property: for a monomial <sup>�</sup> _j_ <sup>_d_</sup> =1 <sup>_xi_</sup> _j_ <sup>,</sup> <sup>when</sup>
_xi_ 1 _, . . ., xid_ are random variables over F2, it has the probability given by
Pr
_d_
-
_j_ =1
_xij_ = 1� = 2 <sup>_−d_</sup> _._
As the value of _d_ increases, the probability of the monomial taking the value 1 decreases.
Intuitively, when a polynomial has a high minimal algebraic degree, the probability of
it taking the value 1 may be very small. Furthermore, if there are correlations among
monomials in this polynomial, it may bring this intuition closer to the actual scenario. In
our experiments, we observed that for the Grain family, particularly for Grain-128AEAD
and Grain-128, there is a high correlation among the monomials in their superpolies, and
their superpolies generally have high minimal algebraic degrees. Therefore, for a superpoly
with a high correlation between monomials and with _d_ -minimal algebraic degree, we regard
it as a monomial of degree _d_ . Besides, for the new variable _x_ used to substitute the
superpoly, the probability of it taking value 1 is required to be 2 <sup>_−d_</sup> .
For the sake of simplicity, we will only focus on the case where the minimum algebraic
degree is greater than 0 hereafter, which also aligns with the algebraic characteristics of
the Grain family.
A set of rules for polynomial transformations. We provide a set of polynomial
transformation rules designed to integrate unknown polynomials, aiming to reduce the
introduction of new variables. The specific rules are listed as follows:
rule 1: If there are polynomials _k_ <sup>_µ_</sup> _· q_ _ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup>
_ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup> <sup>_, . . .,_</sup> <sup>_kµ_</sup> <sup>_· q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> _l_ <sup>_t_</sup> <sup>)</sup>
_ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup> <sup>_⊕· · · ⊕_</sup> <sup>_q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> _l_ <sup>_t_</sup> <sup>)</sup>
If there are polynomials _k_ <sup>_µ_</sup> _· q_ _ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup> <sup>_, . . .,_</sup> <sup>_kµ_</sup> <sup>_· q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> _l_ <sup>_t_</sup> <sup>)</sup> involved in Eq.(4), we use a
new symbol polynomial _g_ to represent the sum ( _q_ _ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup> <sup>_⊕· · · ⊕_</sup> <sup>_q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> _l_ <sup>_t_</sup> <sup>)),</sup> <sup>and</sup> <sup>these</sup>
polynomials can be replaced by _k_ <sup>_µ_</sup> _· g_ . The minimal algebraic degree of _g_ can
be obtained by deg _m_ ( _g_ ) = min _{d_ _ω_ 1 _, . . ., d_ _ω_ _l_ _}_ .
rule 2: If there are such polynomials _k_ <sup>_µ_</sup> <sup>1</sup> _·_ _q_ _ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup>
_ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup> and _k_ <sup>_µ_</sup> <sup>2</sup> _·_ _q_ _ω_ <sup>(</sup> <sup>_r_</sup> 2 <sup>_t_</sup> <sup>)</sup>
If there are such polynomials _k_ <sup>_µ_</sup> <sup>1</sup> _·_ _q_ _ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup> and _k_ <sup>_µ_</sup> <sup>2</sup> _·_ _q_ _ω_ <sup>(</sup> <sup>_r_</sup> 2 <sup>_t_</sup> <sup>)</sup> in Eq.(4) satisfying
that _k_ <sup>_µ_</sup> <sup>2</sup> is divisible by _k_ <sup>_µ_</sup> <sup>1</sup>, we use a new symbol polynomial _g_ to represent
the sum ( _q_ _ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup> <sup>_⊕_</sup> _k_ <sup>_<u>kµµ</u>_</sup> <sup>12</sup> <sup>_· q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> 2 <sup>_t_</sup> <sup>)),</sup> <sup>and</sup> <sup>thereby</sup> <sup>the</sup> <sup>polynomials</sup> <sup>can</sup> <sup>be</sup> <sup>replaced</sup> <sup>by</sup>
_k_ <sup>_µ_</sup> <sup>1</sup> _· g_ . The minimal algebraic degree of _g_ can be obtained by deg _m_ ( _g_ ) =
min _{d_ _ω_ 1 _, d_ _ω_ 2 + ( _wt_ ( _µ_ 2) _−_ _wt_ ( _µ_ 1)) _}_ .
_ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup> <sup>_⊕_</sup> _k_ <sup>_<u>kµµ</u>_</sup> <sup>12</sup>
_k_ <sup>_<u>kµµ</u>_</sup> <sup>12</sup> <sup>_· q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> 2 <sup>_t_</sup> <sup>)</sup>
rule 3: If there are at least three polynomials ( _ki_ 1 _· · · kij_ ) _·kl_ 1 _·q_ _ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup>
_ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>), (</sup> <sup>_k_</sup> _i_ 1 <sup>_· · · k_</sup> _ij_ <sup>)</sup> <sup>_·k_</sup> _l_ 2 <sup>_·q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> 2 <sup>_t_</sup> <sup>),</sup>
_ω_ <sup>(</sup> <sup>_r_</sup> 2 <sup>_t_</sup> <sup>),</sup>
( _ki_ 1 _· · · kij_ ) _· kl_ 3 _· q_ _ω_ <sup>(</sup> <sup>_r_</sup> 3 <sup>_t_</sup> <sup>)</sup> in Eq.(4), we use a new symbol polynomial _g_ to represent
the sum ( _kl_ 1 _· q_ _ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup>
_ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup> <sup>_⊕_</sup> <sup>_k_</sup> _l_ 2 <sup>_· q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> 2 <sup>_t_</sup> <sup>)</sup>
_ω_ <sup>(</sup> <sup>_r_</sup> 2 <sup>_t_</sup> <sup>)</sup> <sup>_⊕_</sup> <sup>_k_</sup> _l_ 3 <sup>_· q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> 3 <sup>_t_</sup> <sup>)</sup>
the sum ( _kl_ 1 _· q_ _ω_ <sup>(</sup> <sup>_r_</sup> 1 <sup>_t_</sup> <sup>)</sup> <sup>_⊕_</sup> <sup>_k_</sup> _l_ 2 <sup>_· q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> 2 <sup>_t_</sup> <sup>)</sup> <sup>_⊕_</sup> <sup>_k_</sup> _l_ 3 <sup>_· q_</sup> _ω_ <sup>(</sup> <sup>_r_</sup> 3 <sup>_t_</sup> <sup>)),</sup> <sup>and</sup> <sup>thereby</sup> <sup>these</sup> <sup>polynomials</sup> <sup>can</sup> <sup>be</sup>
replaced by ( _ki_ 1 _· · · kij_ ) _· g_ . The minimal algebraic degree of _g_ can be obtained
by deg _m_ ( _g_ ) = 1 + min _{d_ _ω_ 1 _, d_ _ω_ 2 _, d_ _ω_ 3 _}_ .
<u>206</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
Based on the polynomial transformation rules, a simplified form of Eq.(4) can be
derived as follows,
_pI_ = _ps ⊕_
_t_
- _k_ <sup>_µ_</sup> <sup>_i_</sup> _· gi._
_i_ =1
Besides, the minimal algebraic degree of _gi_ has been obtained, denoted by _di_ . By replacing
the polynomials _g_ 1 _, . . ., gt_ with new variables _x_ 1 _, . . ., xt_ _∈_ F2, we can obtain an approximate
polynomial of the superpoly _pI_, i.e.,
_p_ <sup>_′_</sup> _I_ <sup>=</sup> <sup>_ps_</sup> <sup>_⊕_</sup>
_t_
- _k_ <sup>_µ_</sup> <sup>_i_</sup> _· xi._
_i_ =1
Note that the new variables satisfy the conditions: Pr( _xi_ = 1) = 2 <sup>_−di_</sup>, for _i ∈{_ 1 _, . . ., t}_ .
The construction of this approximate polynomial involves leveraging the known part
and the algebraic properties of the undetermined part of the superpoly. It makes the
constructed polynomial closer to the superpoly in terms of algebraic properties, further
making the bias of the approximate polynomial more similar to the bias of the superpoly.
Therefore, we can compute the actual bias _ε_ <sup>_′_</sup> of the approximate polynomial _p_ <sup>_′_</sup> _I_ <sup>by</sup>
the method described in Section 4.1. Moreover, we use the bias _ε_ <sup>_′_</sup> of the approximate
polynomial _p_ <sup>_′_</sup> _I_ <sup>to</sup> <sup>evaluate</sup> <sup>the</sup> <sup>bias</sup> <sup>of</sup> <sup>the</sup> <sup>superpoly</sup> <sup>_pI_</sup> <sup>.</sup>
Therefore, we can compute the actual bias _ε_ <sup>_′_</sup> of the approximate polynomial _p_ <sup>_′_</sup>
<sup>_′_</sup> _I_ <sup>to</sup> <sup>evaluate</sup> <sup>the</sup> <sup>bias</sup> <sup>of</sup> <sup>the</sup> <sup>superpoly</sup> <sup>_pI_</sup> <sup>.</sup>
## 5 A reliable implementation of dynamic cube attacks
In this section, we introduce a reliable implementation of dynamic cube attacks against
the Grain family of ciphers, which includes an algebraic analysis of the impact caused
by wrong key guesses and a more accurate MILP modeling technique for dynamic cube
attacks.
5.1 Algebraic analysis of the impact caused by wrong key guesses
In dynamic cube attacks, it is necessary to evaluate the biases of the superpolies for all
possible wrong key guesses. However, it is impractical to do this due to the need to
solve a large number of MILP models, which is time-consuming and entails a significant
computational cost. Therefore, we also need to identify specific wrong key guesses that
may have significant biases and are closest to the bias of the correct guess. We refer to
these key guesses as “bad” wrong key guesses.
For a predefined nullification strategy _NS_ and a given cube _I_, based on the ANFs of
the intermediate state bits that need to be nullified, we can identify a set of dynamic
variables _vd_ 1 _, . . ., vdt_, and their respective dynamic values _fd_ 1( _k_ _,_ _v_ ) _, . . ., fdt_ ( _k_ _,_ _v_ ). It is
worth noting that, through simple algebraic substitutions, it can be ensured that none of
_fd_ 1 _, . . ., fdt_ contain any dynamic variables.
The first output bit _z_ = _f_ ( _k_ _,_ _v_ ) can be uniquely decomposed into the following form,
i.e.,
- _t_
_i_ =1
( _vdi_ _⊕_ _fdi_ ) <sup>_µi_</sup> _· q_ _µ_ ( _k_ _,_ _v_ ) _,_ (6)
_f_ ( _k_ _,_ _v_ ) = _q_ 0 ( _k_ _,_ _v_ ) _⊕_
_µ_ _̸_ =(0 _,...,_ 0) _∈_ F <sup>_t_</sup> 2
where there are no dynamic variables involved in the polynomial _q_ _µ_ ( _k_ _,_ _v_ ), for each vector
_µ_ _∈_ F <sup>_t_</sup> 2 <sup>.</sup> <sup>Based</sup> <sup>on</sup> <sup>Eq.(6),</sup> <sup>we</sup> <sup>can</sup> <sup>analyze</sup> <sup>the</sup> <sup>impact</sup> <sup>of</sup> <sup>different</sup> <sup>wrong</sup> <sup>key</sup> <sup>guesses</sup> <sup>on</sup> <sup>the</sup>
biases of the corresponding superpolies. Taking the specific strategy in [HJL <sup>+</sup> 20] as an
example, we will provide a simple explanation.
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>207</u>
For the nullification strategy _NS_ = _{_ ( _v_ 30 _, b_ 158) _}_, the dynamic variable _v_ 30 is required
to satisfy the following equation,
_v_ 30 = _g_ 0 _⊕_ _k_ 42 _v_ 38 _⊕_ _k_ 125 _v_ 72 _⊕_ _v_ 43 _v_ 50 _⊕_ _v_ 90 _._ (7)
For Eq.(7), if the variables _v_ 38 and _v_ 72 are treated as non-cube variables with fixed values,
guessing the values of _k_ 42 and _k_ 125 is meaningless, due to the equation _v_ 30 = _g_ 0 <sup>_′_</sup> <sup>_⊕v_</sup> <sup>43</sup> <sup>_v_</sup> <sup>50</sup> <sup>_⊕v_</sup> <sup>90.</sup>
In this situation, the constructed cubes can not provide 3-bit key information. Therefore,
the variables _v_ 38 and _v_ 72 should be set to cube variables.
The function _f_ ( _k_ _,_ _v_ ) can be decomposed into the expression as Eq.(6), i.e.,
_f_ ( _k_ _,_ _v_ ) = _q ·_ ( _v_ 30 _⊕_ _g_ 0 _⊕_ _k_ 42 _v_ 38 _⊕_ _k_ 125 _v_ 72 _⊕_ _v_ 43 _v_ 50 _⊕_ _v_ 90) _⊕_ _h,_
where _q_ and _h_ are the polynomials with respect to the key variables _k_ and the cube
variables _v_ _I_ .
Let _µ_ be a positive integer. Denote the guess values of ( _g_ 0 _, k_ 42 _, k_ 125) by ( _g_ 0 _⊕_ _µ_ [0] _, k_ 42 _⊕_
_µ_ [1] _, k_ 125 _⊕_ _µ_ [2]). Each value of _µ_ corresponds to a unique key guess, and we refer to
_µ_ as the key-guess pattern. Since the value of _v_ 30 is determined by the guess values of
( _g_ 0 _, k_ 42 _, k_ 125), the function _f_ can be further represented as follows,
_f_ ( _k_ _,_ _v_ ) = _q ·_ ( _µ_ [0] _⊕_ _µ_ [1] _· v_ 38 _⊕_ _µ_ [2] _· v_ 72) _⊕_ _h._
Since the superpoly under the key-guess pattern _µ_ = 0 is required to be a 0-constant
polynomial, the corresponding superpoly in _h_ should be a 0-constant polynomial. The
polynomial _q_ can be uniquely decomposed as follows,
_q_ = _q_ 0 _⊕_ _v_ 38 _· q_ 1 _⊕_ _v_ 72 _· q_ 2 _⊕_ _v_ 38 _v_ 72 _· q_ 3 _,_
where the IV variables _v_ 38, _v_ 72 are not involved in the polynomials _q_ 0 _, q_ 1 _, q_ 2 _, q_ 3. Therefore,
the function _f_ can be further represented as follows,
_f_ ( _k_ _,_ _v_ ) = ( _q_ 0 _⊕_ _v_ 38 _· q_ 1 _⊕_ _v_ 72 _· q_ 2 _⊕_ _v_ 38 _v_ 72 _· q_ 3) _·_ ( _µ_ [0] _⊕_ _µ_ [1] _· v_ 38 _⊕_ _µ_ [2] _· v_ 72) _⊕_ _h_
= _µ_ [0] _· v_ 38 _v_ 72 _· q_ 3 _⊕_ _µ_ [0] _·_ ( _q_ 0 _⊕_ _v_ 38 _· q_ 1 _⊕_ _v_ 72 _· q_ 2)
_⊕_ _µ_ [1] _· v_ 38 _v_ 72 _·_ ( _q_ 2 _⊕_ _q_ 3) _⊕_ _µ_ [1] _·_ ( _q_ 0 _⊕_ _v_ 38 _· q_ 1)
_⊕_ _µ_ [2] _· v_ 38 _v_ 72 _·_ ( _q_ 1 _⊕_ _q_ 3) _⊕_ _µ_ [2] _·_ ( _q_ 0 _⊕_ _v_ 72 _· q_ 2) _⊕_ _h_
≜ _v_ 38 _v_ 72 _·_ ( _µ_ [0] _· q_ 3 _⊕_ _µ_ [1] _· q_ 2 _⊕_ _µ_ [1] _· q_ 3 _⊕_ _µ_ [2] _· q_ 1 _⊕_ _µ_ [2] _· q_ 3) _⊕_ _h_ <sup>_′_</sup>
Due to the variables _v_ 42 and _v_ 72 set to cube variables, the superpoly in _f_ only comes from
_v_ 38 _v_ 72 _·_ ( _µ_ [0] _·_ _q_ 3 _⊕_ _µ_ [1] _·_ _q_ 2 _⊕_ _µ_ [1] _·_ _q_ 3 _⊕_ _µ_ [2] _·_ _q_ 1 _⊕_ _µ_ [2] _·_ _q_ 3). Let _p_ 1 _, p_ 2 _, p_ 3 be the corresponding
superpoly in the polynomials _v_ 38 _v_ 72 _· q_ 0, _v_ 38 _v_ 72 _· q_ 1, _v_ 38 _v_ 72 _· q_ 2 respectively. Therefore, the
superpoly _p_ in _f_ also can be represented as follows,
_p_ = ( _µ_ [0] _⊕_ _µ_ [1] _⊕_ _µ_ [2]) _· p_ 3 _⊕_ _µ_ [1] _p_ 2 _⊕_ _µ_ [2] _p_ 1 _._
We show the superpoly under different key-guess patterns in Table 2.
<u>Table</u> <u>2:</u> <u>The</u> <u>superpoly</u> <u>under</u> <u>different</u> <u>key-guess</u> <u>patterns.</u>
( _µ_ [0] _, µ_ [1] _, µ_ [2]) the superpoly _p_ ( _µ_ [0] _, µ_ [1] _, µ_ [2]) the superpoly _p_
(0 _,_ 0 _,_ 0) 0 (1 _,_ 0 _,_ 0) _p_ 3
(0 _,_ 1 _,_ 0) _p_ 2 _⊕_ _p_ 3 (1 _,_ 1 _,_ 0) _p_ 2
(0 _,_ 0 _,_ 1) _p_ 1 _⊕_ _p_ 3 (1 _,_ 0 _,_ 1) _p_ 1
(0 _,_ 1 _,_ 1) _p_ 1 _⊕_ _p_ 2 (1 _,_ 1 _,_ 1) _p_ 1 _⊕_ _p_ 2 _⊕_ _p_ 3
For the Grain family of ciphers, the output bit can be expressed as a polynomial
with respect to the secret key and public IV variables. As the initialization rounds
<u>208</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
increase, the superpolies in the polynomial representing the output bit become incredibly
complex. Typically, the linear combination of different superpolies is considered even more
complicated, as there are no significant cancellations of monomials. Therefore, we can
come to the following conclusion.
Let _c_ = ( _c_ 1 _, c_ 2 _, c_ 3) _∈_ F <sup>3</sup> 2 <sup>,</sup> <sup>and</sup> <sup>_p_</sup> <sup>_c_</sup> <sup>=</sup> <sup>_c_</sup> <sup>1</sup> <sup>_· p_</sup> <sup>1</sup> <sup>_⊕_</sup> <sup>_c_</sup> <sup>2</sup> <sup>_· p_</sup> <sup>2</sup> <sup>_⊕_</sup> <sup>_c_</sup> <sup>3</sup> <sup>_· p_</sup> <sup>3</sup> <sup>be</sup> <sup>a</sup> <sup>linear</sup> <sup>combination</sup> <sup>of</sup>
the superpolies _p_ 1, _p_ 2 and _p_ 3. Denote the bias of a polynomial _p_ as _ε_ ( _p_ ). For each _c_ _∈_ F <sup>3</sup> 2 <sup>,</sup>
Let _c_ = ( _c_ 1 _, c_ 2 _, c_ 3) _∈_ F <sup>3</sup> 2
the superpolies _p_ 1, _p_ 2 and _p_ 3. Denote the bias of a polynomial _p_ as _ε_ ( _p_ ). For each _c_ _∈_ F <sup>3</sup> 2 <sup>,</sup>
the bias _ε_ ( _p_ _c_ ) satisfies the following condition: _ε_ ( _p_ _c_ ) _≤_ min _{ε_ ( _pi_ ) _|ci_ = 1 for _i ∈{_ 1 _,_ 2 _,_ 3 _}}_ .
As shown in Table 2, when the key-guess mode is _µ_ = 1, 3, or 5, the associated
superpolies may exhibit more significant biases. Therefore, it is necessary to identify the
biases of the superpolies under key-guess modes _µ_ = 1, 3, and 5, as it is uncertain which
one exhibits a greater bias. By employing the nulling strategy _NS_, if we can construct a
series of qualified cubes that successfully distinguish between the key guessing mode _µ_ = 0
and key guessing modes _µ_ = 1, 3, and 5, then we believe that these cubes can be used
to distinguish between correct and wrong key guesses. Leveraging these cubes, we can
execute a reliable dynamic cube attack against Grain-128. Compared to the analysis in
[HJL <sup>+</sup> 20], our method relies more on theoretical deduction, which is more reasonable.
Theoretically, this analysis method is a general and effective approach to identify
the potential “bad” wrong key guesses in dynamic cube attacks for most stream ciphers.
However, when the imposed conditions are complicated, the analysis becomes too intricate
to find the possible “bad” key guesses.
5.2 A new MILP model for dynamic cube attacks
In this subsection, we introduce a new MILP modeling technique for dynamic cube attacks
targeting the Grain family.
5.2.1 Specifications of Grain-128AEAD and Grain-128
The Grain family of ciphers include Grain v1, Grain-128, Grain-128a, and Grain-128AEAD.
The Grain family of ciphers consists of two registers: an NFSR _b_ = ( _b_ 0 _, . . ., bn−_ 1) and an
LFSR _s_ = ( _s_ 0 _, . . ., sn−_ 1), along with two feedback functions _g_ and _f_ for the NFSR and
the LFSR.
In the initialization phase, the _n_ -bit key and the _m_ -bit IV are first loaded into _b_ and
_s_, respectively, while the other state bits are set to constant values. Then, the cipher is
clocked 2 _n_ times without generating a keystream. Simultaneously, the output produced
from certain bits of the NFSR and the LFSR is fed to the cipher, as illustrated in Figure 1.
Figure 1: Structure of the Grain family
Grain-128AEAD and Grain-128 are both members of the Grain family designed to
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>209</u>
provide 128-bit security. Grain-128AEAD is one of the ten finalist candidates of the NIST
LWC standardization process. Grain-128 is the preliminary version of Grain-128AEAD,
whose specification is simpler than Grain-128AEAD. Their internal state at time _t_ consists
of an LFSR and an NFSR, both with a length of 128 bits, denoted by _s_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> = ( _st, . . ., st_ +127)
and _b_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> = ( _bt, . . ., bt_ +127), respectively.
For Grain-128AEAD, the initial states can be represented as follows:
_b_ <sup>(0)</sup> = ( _b_ 0 _, b_ 1 _, . . ., b_ 127) = ( _k_ 0 _, k_ 1 _, . . ., k_ 127) _,_
_s_ <sup>(0)</sup> = ( _s_ 0 _, s_ 1 _, . . ., s_ 127) = ( _v_ 0 _, v_ 1 _, . . ., v_ 95 _,_ 1 _, . . .,_ 1 _,_ 0) _._
Let _zt_ be an output of the pre-output function as time _t_, and it is computed as
_zt_ = _h_ ( _s_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> _,_ _b_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) _⊕_ _st_ +93 _⊕_
_j∈_ A
_bt_ + _j,_
where A = _{_ 2 _,_ 15 _,_ 36 _,_ 45 _,_ 64 _,_ 73 _,_ 89 _}_, and _h_ ( _s_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> _,_ _b_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) is defined as
_h_ ( _s_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> _,_ _b_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) = _bt_ +12 _st_ +8 _⊕_ _st_ +13 _st_ +20 _⊕_ _bt_ +95 _st_ +42 _⊕_ _st_ +60 _st_ +79 _⊕_ _bt_ +12 _bt_ +95 _st_ +94 _._
Moreover, the functions _g_ ( _b_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) and _f_ ( _s_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) are defined as follows,
_f_ ( _s_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) = _st ⊕_ _st_ +7 _⊕_ _st_ +38 _⊕_ _st_ +70 _⊕_ _st_ +81 _⊕_ _st_ +96 _,_
_g_ ( _b_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) = _bt_ +0 _⊕_ _bt_ +26 _⊕_ _bt_ +56 _⊕_ _bt_ +91 _⊕_ _bt_ +96 _⊕_ _bt_ +3 _bt_ +67 _⊕_ _bt_ +11 _bt_ +13
_⊕_ _bt_ +17 _bt_ +18 _⊕_ _bt_ +27 _bt_ +59 _⊕_ _bt_ +40 _bt_ +48 _⊕_ _bt_ +61 _bt_ +65 _⊕_ _bt_ +68 _bt_ +84
_⊕_ _bt_ +88 _bt_ +92 _bt_ +93 _bt_ +95 _⊕_ _bt_ +22 _bt_ +24 _bt_ +25 _⊕_ _bt_ +70 _bt_ +78 _bt_ +82 _._
The internal state bits _st_ +128 and _bt_ +128 are computed by
_st_ +128 = _zt ⊕_ _f_ ( _s_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) _,_
_bt_ +128 = _zt ⊕_ _st ⊕_ _g_ ( _b_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) _._
In the initialization phase, the state is updated 256 times without producing an output.
After the initialization, the update function is adjusted so that _zt_ is not fed to the state
but rather used as a pre-output keystream. Grain-128AEAD inherits many specifications
from Grain-128a proposed in [ÅHJM11]. Assuming that the first bit of the pre-output
keystream can be observed, there is no difference between Grain-128AEAD and Grain-128a.
Hereinafter, we study the round-reduced Grain-128AEAD under the above assumption.
For Grain-128, the feedback function for the NFSR is more sparse and is specified as
_g_ ( _b_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) = _bt_ +0 _⊕_ _bt_ +26 _⊕_ _bt_ +56 _⊕_ _bt_ +91 _⊕_ _bt_ +96 _⊕_ _bt_ +3 _bt_ +67 _⊕_ _bt_ +11 _bt_ +13
_⊕_ _bt_ +17 _bt_ +18 _⊕_ _bt_ +27 _bt_ +59 _⊕_ _bt_ +40 _bt_ +48 _⊕_ _bt_ +61 _bt_ +65 _⊕_ _bt_ +68 _bt_ +84 _._
Moreover there is a small tweak in the _h_ function as
_h_ ( _s_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> _,_ _b_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> ) = _bt_ +12 _st_ +8 _⊕_ _st_ +13 _st_ +20 _⊕_ _bt_ +95 _st_ +42 _⊕_ _st_ +60 _st_ +79 _⊕_ _bt_ +12 _bt_ +95 _st_ +95 _,_
where _st_ +95 is used to instead of _st_ +94. The others are identical to Grain-128AEAD.
5.2.2 A new modeling technique
Let _s_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> = ( _sr, . . ., sr_ + _n−_ 1) and _b_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> = ( _br, . . ., br_ + _n−_ 1) represent the intermediate states
of the Grian family of cipher after the _r_ -th round of iteration. In the initialization phase,
the internal state bits _sr_ + _n_ and _br_ + _n_ can also be updated by
_st_ + _n_ = _zt_ <sup>_′_</sup>
_st_ + _n_ = _zt_ <sup>_′_</sup> <sup>_⊕_</sup> <sup>_f ′,_</sup>
_bt_ + _n_ = _zt_ <sup>_′_</sup> <sup>_⊕_</sup> <sup>_g,_</sup>
_t_ <sup>_′_</sup> <sup>_⊕_</sup> <sup>_g,_</sup>
<u>210</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
where _zt_ <sup>_′_</sup> <sup>≜</sup> <sup>_zt_</sup> <sup>_⊕_</sup> <sup>_st_</sup> <sup>and</sup> <sup>_f_</sup> <sup>=</sup> <sup>_f ′ ⊕_</sup> <sup>_st_</sup> <sup>.</sup> <sup>The</sup> <sup>purpose</sup> <sup>of</sup> <sup>updating</sup> <sup>the</sup> <sup>intermediate</sup> <sup>state</sup> <sup>bits</sup>
with the functions _z_ <sup>_′_</sup>, _f_ <sup>_′_</sup>, and _g_ is to avoid the issue mentioned in Section 3.2.
For a given nullification strategy _NS_ = _{_ ( _vlj_ _, s_ <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_j_</sup> <sup>)</sup> 1 <sup>)</sup> <sup>_}j∈J_</sup> _s_ <sup>_∪{_</sup> <sup>(</sup> <sup>_vt_</sup> _j_ <sup>_, b_</sup> <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_j_</sup> <sup>)</sup> 1 <sup>)</sup> <sup>_}j∈J_</sup> _b_ <sup>and</sup> <sup>a</sup>
predefined cube _I_, the dynamic variables and their dynamic values can be determined.
For a pair ( _vd, s_ <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1 <sup>)</sup> <sup>_∈_</sup> <sup>_NS_</sup> <sup>and</sup> <sup>a</sup> <sup>key-guess</sup> <sup>pattern</sup> <sup>_µ_</sup> <sup>,</sup> <sup>denote</sup> <sup>_φ_</sup> <sup>(0)</sup> _d_ as the dynamic value of
the dynamic variables _vd_ under the key-guess pattern _µ_ = 0. Let _δd_ <sup>(</sup> <sup>_µ_</sup> <sup>)</sup> be the ANF of the
For a given nullification strategy _NS_ = _{_ ( _vlj_ _, s_ <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_j_</sup> <sup>)</sup> 1
<sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_j_</sup> <sup>)</sup> 1 <sup>)</sup> <sup>_}j∈J_</sup> _s_ <sup>_∪{_</sup> <sup>(</sup> <sup>_vt_</sup> _j_ <sup>_, b_</sup> <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_j_</sup> <sup>)</sup> 1
<sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1 <sup>)</sup> <sup>_∈_</sup> <sup>_NS_</sup> <sup>and</sup> <sup>a</sup> <sup>key-guess</sup> <sup>pattern</sup> <sup>_µ_</sup> <sup>,</sup> <sup>denote</sup> <sup>_φ_</sup> <sup>(0)</sup> _d_
the dynamic variables _vd_ under the key-guess pattern _µ_ = 0. Let _δd_ <sup>(</sup> <sup>_µ_</sup> <sup>)</sup> be the ANF of the
to-be-nullified state bit _s_ <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1 <sup>under</sup> <sup>a</sup> <sup>key-guess</sup> <sup>pattern</sup> <sup>_µ_</sup> <sup>.</sup> <sup>Hence,</sup> <sup>the</sup> <sup>dynamic</sup> <sup>values</sup> <sup>of</sup>
_vd_ can be represented as _φ_ <sup>(</sup> _d_ <sup>_µ_</sup> <sup>)</sup> = _φ_ <sup>(0)</sup> _d_ _⊕_ _δd_ <sup>(</sup> <sup>_µ_</sup> <sup>),</sup> <sup>and</sup> <sup>we</sup> <sup>have</sup> <sup>the</sup> <sup>following</sup> <sup>equation:</sup>
<sup>(0)</sup> _d_ _⊕_ _δd_ <sup>(</sup> <sup>_µ_</sup> <sup>)</sup>
<sup>(</sup> _d_ <sup>_µ_</sup> <sup>)</sup> = _φ_ <sup>(0)</sup> _d_
<sup>(</sup> <sup>_µ_</sup> <sup>)</sup>
_d_ <sup>,</sup> <sup>and</sup> <sup>we</sup> <sup>have</sup> <sup>the</sup> <sup>following</sup> <sup>equation:</sup>
_δd_ <sup>(</sup> <sup>_µ_</sup> <sup>)</sup>
_d_ <sup>(</sup> <sup>_µ_</sup> <sup>)</sup> = _s_ <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1
<sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1 <sup>=</sup> <sup>_z′_</sup> <sup>(</sup> <sup>_s_</sup> <sup>(</sup> <sup>_rd−_</sup> <sup>1)</sup> <sup>_,_</sup> <sup>_b_</sup> <sup>(</sup> <sup>_rd−_</sup> <sup>1))</sup> <sup>_⊕_</sup> <sup>_f ′_</sup> <sup>(</sup> <sup>_s_</sup> <sup>(</sup> <sup>_rd−_</sup> <sup>1)) =</sup> <sup>_vd ⊕_</sup> <sup>_φ_</sup> <sup>(0)</sup> _d_
<sup>(0)</sup> _d_ <sup>_._</sup> (8)
Obviously, only one of _z_ <sup>_′_</sup> and _f_ contains the dynamic variable _vd_ . If the dynamic variable
_vd_ comes from _z_ <sup>_′_</sup> and _rd_ _∈/_ _Rb_, then the constraint _b_ <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1 <sup>=</sup> <sup>_z′_</sup> <sup>(</sup> <sup>_s_</sup> <sup>(</sup> <sup>_rd−_</sup> <sup>1)</sup> <sup>_,_</sup> <sup>_b_</sup> <sup>(</sup> <sup>_rd−_</sup> <sup>1))</sup> <sup>_⊕_</sup> <sup>_g_</sup> <sup>(</sup> <sup>_b_</sup> <sup>(</sup> <sup>_rd−_</sup> <sup>1))</sup>
has been replaced in the model with the constraint _b_ <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1
<sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1 <sup>=</sup> <sup>_g_</sup> <sup>(</sup> <sup>_b_</sup> <sup>(</sup> <sup>_rd−_</sup> <sup>1)) +</sup> <sup>_f ′_</sup> <sup>(</sup> <sup>_s_</sup> <sup>(</sup> <sup>_rd−_</sup> <sup>1)) +</sup> <sup>_δ_</sup> _d_ <sup>(</sup> <sup>_µ_</sup> <sup>).</sup>
has been replaced in the model with the constraint _b_ <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1 <sup>=</sup> <sup>_g_</sup> <sup>(</sup> <sup>_b_</sup> <sup>(</sup> <sup>_rd−_</sup> <sup>1)) +</sup> <sup>_f ′_</sup> <sup>(</sup> <sup>_s_</sup> <sup>(</sup> <sup>_rd−_</sup> <sup>1)) +</sup> <sup>_δ_</sup> _d_ <sup>(</sup> <sup>_µ_</sup> <sup>).</sup>
While these constraints are algebraically equivalent due to Eq.(8), this modification in
the MILP model helps reduce unnecessary division trails within the model, as described
in Section 3.2. For the pair ( _vd, b_ <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1 <sup>)</sup> <sup>_∈_</sup> <sup>_NS_</sup> <sup>that</sup> <sup>satisfies</sup> <sup>similar</sup> <sup>conditions,</sup> <sup>we</sup> <sup>use</sup> <sup>the</sup>
identical processing method to replace the original constraint with the new one.
the MILP model helps reduce unnecessary division trails within the model, as described
in Section 3.2. For the pair ( _vd, b_ <sup>(</sup> _n_ <sup>_r_</sup> _−_ <sup>_d_</sup> <sup>)</sup> 1 <sup>)</sup> <sup>_∈_</sup> <sup>_NS_</sup> <sup>that</sup> <sup>satisfies</sup> <sup>similar</sup> <sup>conditions,</sup> <sup>we</sup> <sup>use</sup> <sup>the</sup>
Compared with the original MILP modeling method proposed in [HJL <sup>+</sup> 20] for dynamic
cube attacks, our new modeling technique can achieve a more accurate MILP model. First,
it is known that 3SDP/u is more accurate than the CBDP, and Algorithm 2 is based
on 3SDP/u while the original model is based on CBDP. Second, the specific algebraic
structure of the Grain family is taken into consideration in Algorithm 2 to avoid generating
numerous redundant trails. Our modeling technique is demonstrated in Algorithms 1 and
2, focusing on the modeling ideas while omitting some technical details. The detailed
modeling process has been uploaded to the GitHub repository as code.
<u>Algorithm</u> <u>1:</u> A New MILP Model for the Grain family
1: procedure GrainFamilyInit( Model _M_, Cube _I_, Nullification strategy
_NS_ = _{_ ( _vlj_ _, s_ ( _nr−j_ )1 <sup>)</sup> <sup>_}j∈J_</sup> _s_ <sup>_∪{_</sup> <sup>(</sup> <sup>_vt_</sup> _j_ <sup>_, b_</sup> ( _nr−j_ )1 <sup>)</sup> <sup>_}j∈J_</sup> _b_ <sup>,</sup> <sup>Key-guess</sup> <sup>pattern</sup> <sup>_µ_</sup> <sup>)</sup>
_NS_ = _{_ ( _vlj_ _, s_ ( _nr−j_ )1 <sup>)</sup> <sup>_}j∈J_</sup> _s_ <sup>_∪{_</sup> <sup>(</sup> <sup>_vt_</sup> _j_ <sup>_, b_</sup> ( _nr−j_ )1 <sup>)</sup> <sup>_}j∈J_</sup> _b_ <sup>,</sup> <sup>Key-guess</sup> <sup>pattern</sup> <sup>_µ_</sup> <sup>)</sup>
2: _M.var_ _←_ _bvar_ = ( _svar_ [0] _, . . ., svar_ [ _n −_ 1]) as binary variables
3: _M.var_ _←_ _svar_ = ( _bvar_ [0] _, . . ., bvar_ [ _n −_ 1]) as binary variables
4: _M.var_ _←_ _kvar_ = ( _kvar_ [0] _, . . ., kvar_ [ _n −_ 1]) as binary variables
5: _M.var_ _←_ _vvar_ = ( _vvar_ [0] _, . . ., vvar_ [ _m −_ 1]) as binary variables
6: _M.obj_ _←_ max _{_ <sup>�</sup> <sup>_n_</sup> _i_ =0 <sup>_−_</sup> <sup>1</sup> <sup>_kvar_</sup> <sup>[</sup> <sup>_i_</sup> <sup>]</sup> <sup>_}_</sup>
7: _M.con ←_ _vvar_ [ _i_ ] = 1 for _i ∈_ _I_
8: _M.con ←_ _vvar_ [ _j_ ] = 0 for _j_ _∈/_ _I_ _∪{lj}j∈Js_ _∪{tj}j∈Jb_
9: According to _NS_ and _µ_, deduce the ANFs of the dynamic values corresponding to the
dynamic variables, i.e., _{vlj_ _, fl_ <sup>(</sup> _j_ <sup>_µ_</sup> <sup>)</sup> <sup>_}_</sup> <sup>for</sup> <sup>_j_</sup> <sup>_∈_</sup> <sup>_Js_</sup> <sup>and</sup> <sup>_{vt_</sup> _j_ <sup>_, f_</sup> _l_ <sup>(</sup> _j_ <sup>_µ_</sup> <sup>)</sup> <sup>_}_</sup> <sup>for</sup> <sup>_j_</sup> <sup>_∈_</sup> <sup>_Jb_</sup> <sup>.</sup>
( _nr−j_ )1 <sup>)</sup> <sup>_}j∈J_</sup> _s_ <sup>_∪{_</sup> <sup>(</sup> <sup>_vt_</sup> _j_ <sup>_, b_</sup>
_l_ <sup>(</sup> _j_ <sup>_µ_</sup> <sup>)</sup> <sup>_}_</sup> <sup>for</sup> <sup>_j_</sup> <sup>_∈_</sup> <sup>_Js_</sup> <sup>and</sup> <sup>_{vt_</sup> _j_ <sup>_, f_</sup> _l_ <sup>(</sup> _j_ <sup>_µ_</sup> <sup>)</sup>
10: for _j_ _∈_ _Js_ do
11: _M.con ←_ ModelPoly( _M, vvar_ [ _lj_ ] _, fj_ <sup>_µ_</sup>
_l_ <sup>(</sup> _j_ <sup>_µ_</sup> <sup>)</sup> <sup>_}_</sup> <sup>for</sup> <sup>_j_</sup> <sup>_∈_</sup> <sup>_Jb_</sup> <sup>.</sup>
11: _M.con ←_ ModelPoly( _M, vvar_ [ _lj_ ] _, fj_ <sup>_µ,_</sup> <sup>_kvar_</sup> <sup>_,_</sup> <sup>_vvar_</sup> <sup>)</sup>
12: for _j_ _∈_ _Jb_ do
13: _M.con ←_ ModelPoly( _M, vvar_ [ _tj_ ] _, fj_ <sup>_µ,_</sup> <sup>_kvar_</sup> <sup>_,_</sup> <sup>_vvar_</sup> <sup>)</sup>
13: _M.con ←_ ModelPoly( _M, vvar_ [ _tj_ ] _, fj_ <sup>_µ,_</sup> <sup>_kvar_</sup> <sup>_,_</sup> <sup>_vvar_</sup> <sup>)</sup>
14: _M.con ←_ _bvar_ [ _i_ ] = _kvar_ [ _i_ ] for _i ∈{_ 0 _, . . ., n −_ 1 _}_
15: _M.con ←_ _svar_ [ _i_ ] = _vvar_ [ _i_ ] for _i ∈{_ 0 _, . . ., m −_ 1 _}_ _▷_ for Grain-128AEAD, there is a another
constraint, i.e., _M.con ←_ _svar_ [ _n −_ 1] = 0
16: return ( _M,_ _svar_ _,_ _bvar_ _,_ _kvar_ _,_ _vvar_ )
17: end procedure
In Algorithm 1, we added the algebraic relationship between dynamic variables and dynamic values as constraints into the model. The procedure ModelPoly adds polynomials
as constraints into the model. Algorithm 2 illustrates the application of algebraic structures for the Grain family in our new modeling technique. The procedures ModelFuncF,
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>211</u>
<u>Algorithm</u> <u>2:</u> A New MILP Model for the Grain family
1: procedure GrainFamilyModel(Cube _I_, Nullification strategy
_NS_ = _{_ ( _vlj_ _, s_ ( _nr−j_ )1 <sup>)</sup> <sup>_}j∈J_</sup> _s_ <sup>_∪{_</sup> <sup>(</sup> <sup>_vt_</sup> _j_ <sup>_, b_</sup> ( _nr−j_ )1 <sup>)</sup> <sup>_}j∈J_</sup> _b_ <sup>,</sup> <sup>Key-guess</sup> <sup>pattern</sup> <sup>_µ_</sup> <sup>)</sup>
_NS_ = _{_ ( _vlj_ _, s_ ( _nr−j_ )1 <sup>)</sup> <sup>_}j∈J_</sup> _s_ <sup>_∪{_</sup> <sup>(</sup> <sup>_vt_</sup> _j_ <sup>_, b_</sup> ( _nr−j_ )1 <sup>)</sup> <sup>_}j∈J_</sup> _b_ <sup>,</sup> <sup>Key-guess</sup> <sup>pattern</sup> <sup>_µ_</sup> <sup>)</sup>
2: Prepare an empty MILP model _M_
3: Update _M_ as ( _M,_ _svar_ _,_ _bvar_ _,_ _kvar_ _,_ _vvar_ ) _←_ GrainFamilyInit( _M, I, NS, µ_ )
( _nr−j_ )1 <sup>)</sup> <sup>_}j∈J_</sup> _s_ <sup>_∪{_</sup> <sup>(</sup> <sup>_vt_</sup> _j_ <sup>_, b_</sup>
4: According to _NS_ and _µ_, deduce the ANFs of the to-be-nullified state bits _{s_ ( _nr−j_ )1 <sup>_}j∈J_</sup> _s_ <sup>and</sup>
_{b_ ( _nr−j_ )1 <sup>_}j∈J_</sup> _b_ <sup>,</sup> <sup>denoted</sup> <sup>by</sup> <sup>_{φ_</sup> <sup>(</sup> _j_ <sup>_µ_</sup> <sup>)</sup> _}j∈Js_ and _{ψj_ <sup>(</sup> <sup>_µ_</sup> <sup>)</sup> _}j∈Jb_, respectively.
5: for _r_ from 1 to _R_ do
6: if _r_ _∈{/_ _rj}j∈Js∪Jb_ do
7: _M.var_ _←_ _fvar, gvar, zvar, zvar_ 1 _, zvar_ 2 _, newb, news_ as binary variables
8: _M.con ←_ ModelFuncF( _M, fvar,_ _svar_ )
9: _M.con ←_ ModelFuncG( _M, gvar,_ _bvar_ )
10: _M.con ←_ ModelFuncZ( _M, zvar,_ _bvar_ _,_ _svar_ )
11: _M.con ←_ _zvar_ = _zvar_ 1 _∨_ _zvar_ 2
12: _M.con ←_ _newb_ = _zvar_ 1 + _gvar_
13: _M.con ←_ _news_ = _zvar_ 2 + _fvar_
14: else if _r_ _∈{rj}j∈Js∩Jb_ do
15: _M.var_ _←_ _newb, news_ as binary variables
16: _M.con ←_ ModelPoly( _M, newb, φr,_ _kvar_ _,_ _vvar_ )
17: _M.con ←_ ModelPoly( _M, news, ψr,_ _kvar_ _,_ _vvar_ )
18: _M.con ←_ ( _bvar_ [0] _, svar_ [0]) = (0 _,_ 0)
19: else if _r_ _∈{rj}j∈Jb_ and _vtj_ involved in _z_ <sup>_′_</sup> do
20: _M.var_ _←_ _gvar, fvar, newb, news, xvar, xvar_ 1 _, xvar_ 2 as binary variables
21: _M.con ←_ ModelPoly( _M, xvar, φr,_ _kvar_ _,_ _vvar_ )
22: _M.con ←_ _xvar_ = _xvar_ 1 _∨_ _xvar_ 2
23: _M.con ←_ ModelFuncF( _M, fvar,_ _svar_ )
24: _M.con ←_ ModelFuncG( _M, gvar,_ _bvar_ )
25: _M.con ←_ _newb_ = _xvar_ 1
26: _M.con ←_ _news_ = _xvar_ 2 + _fvar_ + _gvar_
27: _M.con ←_ _svar_ [0] = 0
28: else if _r_ _∈{rj}j∈Jb_ and _vtj_ not involved in _z_ <sup>_′_</sup> do
29: _M.var_ _←_ _zvar, fvar, newb, news, xvar_ as binary variables
30: _M.con ←_ ModelPoly( _M, xvar, φr,_ _kvar_ _,_ _vvar_ )
31: _M.con ←_ ModelFuncF( _M, fvar,_ _svar_ )
32: _M.con ←_ ModelFuncZ( _M, zvar,_ _bvar_ _,_ _svar_ )
33: _M.con ←_ _newb_ = _xvar_
34: _M.con ←_ _news_ = _fvar_ + _zvar_
35: else if _r_ _∈{rj}j∈Js_ and _vlj_ involved in _z_ <sup>_′_</sup> do
36: _M.var_ _←_ _fvar, gvar, newb, news, xvar, xvar_ 1 _, xvar_ 2 as binary variables
37: _M.con ←_ ModelPoly( _M, xvar, ψr,_ _kvar_ _,_ _vvar_ )
38: _M.con ←_ _xvar_ = _xvar_ 1 _∨_ _xvar_ 2
39: _M.con ←_ ModelFuncF( _M, fvar,_ _svar_ )
40: _M.con ←_ ModelFuncG( _M, gvar,_ _bvar_ )
41: _M.con ←_ _newb_ = _xvar_ 1 + _fvar_ + _gvar_
42: _M.con ←_ _news_ = _xvar_ 2
43: _M.con ←_ _svar_ [0] = 0
44: else if _r_ _∈{rj}j∈Js_ and _vlj_ not involved in _z_ <sup>_′_</sup> do
45: _M.var_ _←_ _zvar, gvar, newb, news, xvar_ as binary variables
46: _M.con ←_ ModelPoly( _M, xvar, φr,_ _kvar_ _,_ _vvar_ )
47: _M.con ←_ ModelFuncG( _M, gvar,_ _bvar_ )
48: _M.con ←_ ModelFuncZ( _M, zvar,_ _bvar_ _,_ _svar_ )
49: _M.con ←_ _newb_ = _gvar_ + _zvar_
50: _M.con ←_ _news_ = _xvar_
51: ( _bvar_ [0] _, . . ., bvar_ [126] _, bvar_ [127]) _←_ ( _bvar_ [1] _, . . ., bvar_ [127] _, newb_ )
52: ( _svar_ [0] _, . . ., svar_ [126] _, svar_ [127]) _←_ ( _svar_ [1] _, . . ., svar_ [127] _, news_ )
53: _M.var_ _←_ _ovar_ as binary variable
54: _M.con ←_ ModelFuncZ( _M, ovar,_ _bvar_ _,_ _svar_ )
55: _M.con ←_ _bvar_ [ _i_ ] = 0 for _i ∈{_ 0 _, . . ., n −_ 1 _}_
56: _M.con ←_ _svar_ [ _i_ ] = 0 for _i ∈{_ 0 _, . . ., n −_ 1 _}_
57: return ( _M,_ _kvar_ _,_ _vvar_ )
58: end procedure
_{b_
( _nr−j_ )1 <sup>_}j∈J_</sup> _b_ <sup>,</sup> <sup>denoted</sup> <sup>by</sup> <sup>_{φ_</sup> <sup>(</sup> _j_ <sup>_µ_</sup> <sup>)</sup>
<sup>(</sup> _j_ <sup>_µ_</sup> <sup>)</sup> _}j∈Js_ and _{ψj_ <sup>(</sup> <sup>_µ_</sup> <sup>)</sup>
<u>212</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
ModelFuncG, and ModelFuncZ used in Algorithm 2 are specific implementations for
the function _g_ and the modified functions _f_ <sup>_′_</sup> and _z_ <sup>_′_</sup> .
The models established by Algorithm 2 can be used to estimate the algebraic degree of a
superpoly and recover the superpoly for a given cube. Moreover, by adjusting the objective
function as described in Algorithm 1 to _M.obj_ _←_ min _{_ <sup>�</sup> _i_ <sup>_n_</sup> =0 <sup>_−_</sup> <sup>1</sup> <sup>_kvar_</sup> <sup>[</sup> <sup>_i_</sup> <sup>]</sup> <sup>_}_</sup> <sup>,</sup> <sup>the</sup> <sup>modified</sup> <sup>model</sup>
can be employed to estimate the lower bound of the minimal algebraic degree of the
superpoly. Additionally, if the initially feasible models become infeasible by adding the
constraint _M ←_ _kvar_ [ _i_ ] = 0 to the model, then we can determine that the superpoly is
divisible by the key variable _ki_ . By solving _n_ MILP models with different constraints, i.e.,
_M ←_ _kvar_ [ _i_ ] = 0 for _i ∈{_ 0 _, . . ., n −_ 1 _}_, all key variables that divide the superpoly can be
identified.
## 6 Applications to Grain-128AEAD and Grain-128
In this section, we applied dynamic cube attacks based on the 3SDP/u to Grain-128AEAD
and Grain-128. As a result, we successfully conducted a key-recovery attack on 190-round
Grain-128AEAD, with the ability to recover 3 key bits with a probability exceeding 99.68%.
Additionally, we provided a feasibility analysis of a dynamic cube attack against full-version
Grain-128. Furthermore, we compared two different methods of bias evaluation. The solver
for the MILP model we used is: Gurobi Solver (version 9 _._ 0 _._ 3), and the platform we used
is: AMD Ryzen 5950X 16-core Processor 3.7 GHz, 128G RAM, and Ubuntu 22.04 LTS.
The source codes and experimental results are both available in our git [repository.](https://github.com/StrawberryBoy123/DynamicCubeAttack.git)
6.1 Dynamic cube attack on Grain-128AEAD
Through automated searching, we found a qualified nullification strategy _NS_, which contains
2 pairs: _NS_ = _{_ ( _v_ 23 _, b_ 151) _,_ ( _v_ 24 _, b_ 154) _}_ . We find that when _b_ 151 and _b_ 152 are nullified by
setting _v_ 23 and _v_ 24 to dynamic variables, the superpoly of _I_ = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _}_ at
round 190 is 0-constant polynomial. According to the ANFs of _b_ 151 and _b_ 152, the dynamic
variables _v_ 23 and _v_ 24 can be represented as follows,
_v_ 23 = _v_ 36 _v_ 43 _⊕_ _v_ 83 _⊕_ _k_ 118 _v_ 65 _⊕_ _k_ 35 _v_ 31 _⊕_ _g_ 0 _,_
(9)
_v_ 24 = _v_ 37 _v_ 44 _⊕_ _v_ 84 _⊕_ _k_ 119 _v_ 66 _⊕_ _k_ 36 _v_ 32 _⊕_ _g_ 1 _,_
where _g_ 0 and _g_ 1 are the polynomial of key variables. Let _κ_ 1 ≜ ( _g_ 0 _, k_ 35 _, k_ 118) and _κ_ 2 ≜
( _g_ 1 _, k_ 36 _, k_ 119). According to the expression, we need to guess the values of _κ_ ≜ ( _κ_ 1 _, κ_ 2).
Let _µ_ = ( _µ_ 1 _, µ_ 2) _∈_ Z <sup>2</sup> be the key-guess pattern of _κ_ . Under a key-guess pattern _µ_, the
corresponding key guess is
_κµ_ ≜ ( _g_ 0 _⊕_ _µ_ 1[0] _, k_ 35 _⊕_ _µ_ 1[1] _, k_ 118 _⊕_ _µ_ 1[2] _, g_ 1 _⊕_ _µ_ 2[0] _, k_ 36 _⊕_ _µ_ 2[1] _, k_ 119 _⊕_ _µ_ 2[2]) _._
According to the algebraic analysis method proposed in Section 5.1, the output of 190-round
Grain-128AEAD can be represented as follows,
_f_ ( _k_ _,_ _v_ ) = _f_ <sup>(0)</sup> _⊕_ _f_ <sup>(1)</sup> ( _k_ _,_ _v_ ) _·_ ( _µ_ 1[0] _⊕_ _µ_ 1[1] _· v_ 31 _⊕_ _µ_ 1[2] _· v_ 65)
_⊕_ _f_ <sup>(2)</sup> ( _k_ _,_ _v_ ) _·_ ( _µ_ 2[0] _⊕_ _µ_ 2[1] _· v_ 32 _⊕_ _µ_ 2[2] _· v_ 66)
_⊕_ _f_ <sup>(3)</sup> ( _k_ _,_ _v_ ) _·_ ( _µ_ 1[0] _⊕_ _µ_ 1[1] _· v_ 31 _⊕_ _µ_ 1[2] _· v_ 65) _·_ ( _µ_ 2[0] _⊕_ _µ_ 2[1] _· v_ 32 _⊕_ _µ_ 2[2] _· v_ 66)
= _f_ <sup>(0)</sup> _⊕_ ( _f_ 0 <sup>(1)</sup>
1 <sup>(1)</sup> _⊕_ _v_ 65 _f_ 2 <sup>(1)</sup>
0 <sup>(1)</sup> _⊕_ _v_ 31 _f_ 1 <sup>(1)</sup>
2 <sup>(1)</sup> _⊕_ _v_ 31 _v_ 65 _f_ 3 <sup>(1)</sup>
3 <sup>(1))</sup> <sup>_·_</sup> <sup>(</sup> <sup>_µ_</sup> <sup>1[0]</sup> <sup>_⊕_</sup> <sup>_µ_</sup> <sup>1[1]</sup> <sup>_· v_</sup> <sup>31</sup> <sup>_⊕_</sup> <sup>_µ_</sup> <sup>1[2]</sup> <sup>_· v_</sup> <sup>65)</sup>
(10)
_⊕_ ( _f_ 0 <sup>(2)</sup>
0 <sup>(2)</sup> _⊕_ _v_ 32 _f_ 1 <sup>(2)</sup>
1 <sup>(2)</sup> _⊕_ _v_ 66 _f_ 2 <sup>(2)</sup>
2 <sup>(2)</sup> _⊕_ _v_ 32 _v_ 66 _f_ 3 <sup>(2)</sup>
3 <sup>(2))</sup> <sup>_·_</sup> <sup>(</sup> <sup>_µ_</sup> <sup>2[0]</sup> <sup>_⊕_</sup> <sup>_µ_</sup> <sup>2[1]</sup> <sup>_· v_</sup> <sup>32</sup> <sup>_⊕_</sup> <sup>_µ_</sup> <sup>2[2]</sup> <sup>_· v_</sup> <sup>66)</sup>
_⊕_ _f_ <sup>(3)</sup> _·_ ( _µ_ 1[0] _⊕_ _µ_ 1[1] _· v_ 31 _⊕_ _µ_ 1[2] _· v_ 65) _·_ ( _µ_ 2[0] _⊕_ _µ_ 2[1] _· v_ 32 _⊕_ _µ_ 2[2] _· v_ 66) _._
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>213</u>
The superpolies in _v_ 31 _v_ 65 _fi_ <sup>(1)</sup>
_i_ <sup>(1)</sup> and _v_ 32 _v_ 66 _fi_ <sup>(2)</sup>
_i_ <sup>(2)</sup> are respectively denoted as _p_ <sup>(1)</sup> _i_
<sup>(1)</sup> _i_ and _p_ <sup>(2)</sup> _i_
The superpolies in _v_ 31 _v_ 65 _fi_ <sup>(1)</sup> and _v_ 32 _v_ 66 _fi_ <sup>(2)</sup> are respectively denoted as _p_ <sup>(1)</sup> _i_ and _p_ <sup>(2)</sup> _i_ <sup>,</sup>
where _i_ _∈{_ 1 _,_ 2 _,_ 3 _}_ . By analyzing Eq.(10), it is concluded that the key-guess patterns
_µ_ = (1 _,_ 0), (3 _,_ 0), (5 _,_ 0), (0 _,_ 1), (0 _,_ 3), (0 _,_ 5) are considered to be “bad”. The details are
listed in Table 3.
<u>Table</u> <u>3:</u> <u>The</u> <u>details</u> <u>for</u> <u>selected</u> <u>“bad”</u> <u>key-guess</u> <u>patterns</u>
_µ_ = ( _µ_ 1 _, µ_ 2) the superpoly _p_ <sup>_µ_</sup> _µ_ = ( _µ_ 1 _, µ_ 2) the superpoly _p_ <sup>_µ_</sup>
(1 _,_ 0) _p_ <sup>(1)</sup> 3
<sup>(1)</sup> 3 (0 _,_ 1) _p_ <sup>(2)</sup> 3
<sup>(1)</sup> 2 (0 _,_ 3) _p_ <sup>(2)</sup> 2
<sup>(1)</sup> 1 (0 _,_ 5) _p_ <sup>(2)</sup> 1
3 3
(3 _,_ 0) _p_ <sup>(1)</sup> 2 (0 _,_ 3) _p_ 2
(5 _,_ 0) _p_ <sup>(1)</sup> 1 (0 _,_ 5) _p_ 1
1
Table 4: The qualified cubes used for attacking 190-round Grain-128 AEAD. The nullification
strategy <u>is</u> _<u>NS</u>_ <u>=</u> _<u>{</u>_ <u>(</u> _<u>v</u>_ 23 _<u>, b</u>_ 151) _<u>,</u>_ <u>(</u> _<u>v</u>_ 24 _<u>, b</u>_ 152) _<u>}</u>_ <u>.</u>
cube _I_
the bias _ε_ ( _µ_ <u>1</u> _,µ_ <u>2)</u> under the “bad” key-guess patterns ( _µ_ 1 _, µ_ 2)
(1 _,_ 0) (3 _,_ 0) (5 _,_ 0) (0 _,_ 1) (0 _,_ 3) (0 _,_ 5)
_I_ 0 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 95 _}_ 0 _._ 353606 0 _._ 206203 0 _._ 234221 0 _._ 4230747 0 _._ 399117 0 _._ 4361982
_I_ 1 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 77 _,_ 40 _}_ 0 _._ 387184 0 _._ 299633 0 _._ 294281 0 _._ 4387169 0 _._ 354754 0 _._ 4249859
_I_ 2 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 71 _,_ 40 _}_ 0 _._ 387218 0 _._ 346762 0 _._ 344177 0 _._ 4813395 0 _._ 4379272 0 _._ 4396868
_I_ 3 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 68 _,_ 40 _}_ 0 _._ 316473 0 _._ 257362 0 _._ 241364 0 _._ 4721603 0 _._ 4406729 0 _._ 4352102
_I_ 4 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 67 _,_ 42 _}_ 0 _._ 367339 0 _._ 274574 0 _._ 250311 0 _._ 4757776 0 _._ 392146 0 _._ 4511347
_I_ 5 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 61 _,_ 55 _}_ 0 _._ 367626 0 _._ 24719 0 _._ 188051 0 _._ 4761515 0 _._ 4403486 0 _._ 4232893
_I_ 6 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 61 _,_ 52 _}_ 0 _._ 38121 0 _._ 281216 0 _._ 258658 0 _._ 4892836 0 _._ 4862223 0 _._ 472414
_I_ 7 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 60 _,_ 41 _}_ 0 _._ 370648 0 _._ 289206 0 _._ 250978 0 _._ 4867525 0 _._ 4836922 0 _._ 4671307
_I_ 8 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 55 _}_ 0 _._ 379585 0 _._ 20465 0 _._ 213818 0 _._ 4711533 0 _._ 4273214 0 _._ 4395924
_I_ 9 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 50 _}_ 0 _._ 339352 0 _._ 235249 0 _._ 221518 0 _._ 471941 0 _._ 4487085 0 _._ 4553604
_I_ 10 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 49 _,_ 41 _}_ 0 _._ 324727 0 _._ 18964 0 _._ 227296 0 _._ 4730148 0 _._ 4603596 0 _._ 4364719
_I_ 11 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 44 _,_ 33 _}_ 0 _._ 380052 0 _._ 292162 0 _._ 264006 0 _._ 49561977 0 _._ 49242878 0 _._ 456008
_I_ 12 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 42 _,_ 27 _}_ 0 _._ 387638 0 _._ 281886 0 _._ 278914 0 _._ 479454 0 _._ 4136972 0 _._ 470829
_I_ 13 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 77 _,_ 41 _,_ 40 _}_ 0 _._ 334992 0 _._ 212773 0 _._ 253929 0 _._ 4375563 0 _._ 315454 0 _._ 4094419
_I_ 14 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 71 _,_ 46 _,_ 40 _}_ 0 _._ 366632 0 _._ 309636 0 _._ 275089 0 _._ 480011 0 _._ 4891071 0 _._ 4603796
_I_ 15 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 71 _,_ 60 _,_ 40 _}_ 0 _._ 309626 0 _._ 140639 0 _._ 229797 0 _._ 388562 0 _._ 380021 0 _._ 335477
_I_ 16 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 49 _,_ 46 _,_ 35 _}_ 0 _._ 380275 0 _._ 284727 0 _._ 225223 0 _._ 49509048 0 _._ 49503422 0 _._ 4813623
_I_ 17 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 49 _,_ 46 _,_ 40 _}_ 0 _._ 341744 0 _._ 282315 0 _._ 250940 0 _._ 4590654 0 _._ 4652958 0 _._ 4487858
_I_ 18 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 49 _,_ 46 _,_ 41 _}_ 0 _._ 38393 0 _._ 253141 0 _._ 231102 0 _._ 4838247 0 _._ 4805527 0 _._ 4533014
_I_ 19 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 49 _,_ 46 _,_ 45 _}_ 0 _._ 329613 0 _._ 32315 0 _._ 206355 0 _._ 4760637 0 _._ 4771605 0 _._ 4480047
_I_ 20 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 60 _,_ 49 _,_ 46 _}_ 0 _._ 368801 0 _._ 283889 0 _._ 222698 0 _._ 4751892 0 _._ 4819527 0 _._ 4385643
_I_ 21 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 75 _,_ 49 _,_ 46 _}_ 0 _._ 380912 0 _._ 290606 0 _._ 224708 0 _._ 484374 0 _._ 4801178 0 _._ 450757
_I_ 22 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 49 _,_ 41 _,_ 35 _}_ 0 _._ 313745 0 _._ 148555 0 _._ 209636 0 _._ 49448395 0 _._ 4807119 0 _._ 4658022
_I_ 23 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 42 _,_ 41 _,_ 27 _}_ 0 _._ 389872 0 _._ 262617 0 _._ 244953 0 _._ 49575138 0 _._ 4516106 0 _._ 4830332
_I_ 24 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 76 _,_ 42 _}_ 0 _._ 356276 0 _._ 305232 0 _._ 317458 0 _._ 49332905 0 _._ 4739418 0 _._ 4831657
_I_ 25 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 72 _}_ 0 _._ 345942 0 _._ 207445 0 _._ 138506 0 _._ 4693813 0 _._ 4510098 0 _._ 4379272
_I_ 26 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 72 _,_ 61 _}_ 0 _._ 330338 0 _._ 189197 0 _._ 121749 0 _._ 4762859 0 _._ 4642897 0 _._ 4043407
_I_ 27 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 69 _,_ 29 _}_ 0 _._ 386326 0 _._ 318699 0 _._ 258453 0 _._ 4800005 0 _._ 4519835 0 _._ 4615879
_I_ 28 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 68 _,_ 46 _}_ 0 _._ 382341 0 _._ 299612 0 _._ 222552 0 _._ 486948 0 _._ 4850311 0 _._ 4703856
_I_ 29 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 61 _,_ 32 _}_ 0 _._ 372087 0 _._ 294085 0 _._ 227592 0 _._ 49308872 0 _._ 4638119 0 _._ 083961
_I_ 30 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 55 _,_ 41 _}_ 0 _._ 383193 0 _._ 254925 0 _._ 252210 0 _._ 4804106 0 _._ 4482346 0 _._ 4562445
_I_ 31 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 54 _}_ 0 _._ 379627 0 _._ 237605 0 _._ 28257 0 _._ 4856052 0 _._ 4630537 0 _._ 458209
_I_ 32 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 50 _,_ 44 _}_ 0 _._ 372524 0 _._ 228606 0 _._ 240152 0 _._ 4957962 0 _._ 484704 0 _._ 464653
_I_ 33 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 50 _,_ 41 _}_ 0 _._ 274916 0 _._ 172963 0 _._ 1509 0 _._ 4690971 0 _._ 430047 0 _._ 4502716
_I_ 34 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 49 _,_ 35 _}_ 0 _._ 385032 0 _._ 294983 0 _._ 27245 0 _._ 493433 0 _._ 4884911 0 _._ 4795504
_I_ 35 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 46 _,_ 28 _}_ 0 _._ 378247 0 _._ 299514 0 _._ 23912 0 _._ 4755831 0 _._ 489665 0 _._ 4692144
_I_ 36 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 41 _,_ 27 _}_ 0 _._ 344182 0 _._ 227023 0 _._ 221251 0 _._ 49296188 0 _._ 4623575 0 _._ 4599113
_I_ 37 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 70 _,_ 42 _,_ 41 _}_ 0 _._ 347362 0 _._ 274938 0 _._ 239745 0 _._ 49620628 0 _._ 4766798 0 _._ 4822416
_I_ 38 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 68 _,_ 61 _,_ 42 _}_ 0 _._ 378164 0 _._ 283128 0 _._ 267408 0 _._ 4750986 0 _._ 4426651 0 _._ 418539
_I_ 39 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 68 _,_ 46 _,_ 42 _}_ 0 _._ 352967 0 _._ 292024 0 _._ 218067 0 _._ 4866066 0 _._ 4863405 0 _._ 4649763
_I_ 40 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 68 _,_ 42 _,_ 41 _}_ 0 _._ 388642 0 _._ 27685 0 _._ 264484 0 _._ 49326611 0 _._ 463604 0 _._ 4774561
_I_ 41 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 76 _,_ 61 _,_ 41 _}_ 0 _._ 399852 0 _._ 237556 0 _._ 280949 0 _._ 49482155 0 _._ 4734402 0 _._ 4454041
_I_ 42 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 61 _,_ 60 _,_ 46 _}_ 0 _._ 378113 0 _._ 299518 0 _._ 25487 0 _._ 4923811 0 _._ 49433804 0 _._ 4730492
_I_ 43 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 61 _,_ 50 _,_ 44 _}_ 0 _._ 366341 0 _._ 222016 0 _._ 214379 0 _._ 49053955 0 _._ 4833498 0 _._ 4406195
_I_ 44 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 61 _,_ 46 _,_ 45 _}_ 0 _._ 338963 0 _._ 378028 0 _._ 230568 0 _._ 49240112 0 _._ 4890747 0 _._ 463501
_I_ 45 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 60 _,_ 46 _,_ 45 _}_ 0 _._ 310297 0 _._ 31269 0 _._ 185132 0 _._ 479125 0 _._ 4852772 0 _._ 454525
_I_ 46 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 51 _,_ 42 _,_ 41 _}_ 0 _._ 369997 0 _._ 322962 0 _._ 241527 0 _._ 495255 0 _._ 4258976 0 _._ 4170637
_I_ 47 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 50 _,_ 44 _,_ 41 _}_ 0 _._ 374805 0 _._ 191571 0 _._ 198668 0 _._ 49560547 0 _._ 49258804 0 _._ 4706526
_I_ 48 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 71 _,_ 49 _,_ 35 _}_ 0 _._ 309337 0 _._ 223654 0 _._ 200107 0 _._ 4647303 0 _._ 4269733 0 _._ 4178019
_I_ 49 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 75 _,_ 46 _,_ 42 _}_ 0 _._ 33437 0 _._ 248691 0 _._ 195266 0 _._ 4613829 0 _._ 4739819 0 _._ 45644
_I_ 50 = _{_ 0 _, . . .,_ 95 _}\{_ 23 _,_ 24 _,_ 76 _,_ 41 _,_ 40 _}_ 0 _._ 354204 0 _._ 222609 0 _._ 272528 0 _._ 4736853 0 _._ 446743 0 _._ 4405336
According to the definite nullification strategy _NS_ and these “bad” key-guess patterns,
we found some qualified cubes by constructing and solving corresponding MILP models,
denoted as _I_ 0 _, . . ., I_ 50. Their biases under “bad” key-guess patterns were detected by
conducting experimental testing on the corresponding superpolies that have been recovered.
The amount of data used to detect the biases is 2 <sup>20</sup>, which satisfies Equation (2). This
implies that the detected biases can be considered practical biases in these superpolies under
“bad” key-guess patterns. Both the cubes used and their biases under “bad” key-guess
patterns were listed in Table 4.
Our dynamic cube attack process is consistent with the one described in [HJL <sup>+</sup> 20]. It
<u>214</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
follows the steps outlined below.
1. Guess _κ_ 1 ≜ ( _g_ 0 _, k_ 35 _, k_ 118) and _κ_ 2 ≜ ( _g_ 1 _, k_ 36 _, k_ 119).
2. For each guess, compute the values of the superpolies of the cubes _I_ listed in 4 under
the predefined nullification strategy.
3. If any of the 51 values is non-zero, the key guess is wrong; otherwise, keep the key
guess as a correct key guess condidate.
Complexity and Success Probabilities. The time and data complexities of the attack
are both 2 <sup>6</sup> _·_ <sup>�</sup> _i_ <sup>50</sup> =0 <sup>2</sup> <sup>_|Ii|_</sup> <sup>= 2103</sup> <sup>_._</sup> <sup>44.</sup> <sup>The</sup> <sup>memory</sup> <sup>complexity</sup> <sup>is</sup> <sup>only</sup> <sup>26</sup> <sup>counters</sup> <sup>of</sup> <sup>51-bits,</sup>
are both 2 <sup>6</sup> _·_ <sup>�</sup> _i_ <sup>50</sup> =0 <sup>2</sup> <sup>_|Ii|_</sup> <sup>= 2103</sup> <sup>_._</sup> <sup>44.</sup> <sup>The</sup> <sup>memory</sup> <sup>complexity</sup> <sup>is</sup> <sup>only</sup> <sup>26</sup> <sup>counters</sup> <sup>of</sup> <sup>51-bits,</sup>
which is negligible. Since the correct key guess ensures 51 0-summations, evaluating the
success probability _PS_ is equivalent to evaluating the probability for a wrong key guess to
generate 51 zero summations. Therefore, for a key-guess pattern ( _µ_ 1 _, µ_ 2), the theoretically
success probability _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> can be evaluated as _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> = 1 _−_ <sup>�50</sup> _i_ =0 <sup>(2</sup> <sup>_−_</sup> <sup>1 +</sup> <sup>_ε_</sup> <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)).</sup> <sup>We</sup>
success probability _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> can be evaluated as _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> = 1 _−_ <sup>�50</sup> _i_ =0 <sup>(2</sup> <sup>_−_</sup> <sup>1 +</sup> <sup>_ε_</sup> <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)).</sup> <sup>We</sup>
list the theoretical success probabilities for selected “bad” key-guess patterns in Table 5.
It can be seen from Table 5 that the probability of successfully distinguishing between
the key-guess pattern _µ_ = (0 _,_ 0) and the “bad” key-guess pattern _µ_ = (0 _,_ 1) is the lowest
compared to all other bad key-guess patterns. It is because the corresponding superpolies
always have the most significant biases under the key-guess pattern _µ_ = (0 _,_ 1), approaching
2 <sup>_−_</sup> <sup>1</sup> .
_S_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> can be evaluated as _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup>
_S_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> = 1 _−_ <sup>�50</sup> _i_ =0
<u>Table</u> <u>5:</u> <u>the</u> <u>success</u> <u>probabilities</u> <u>for</u> <u>selected</u> <u>“bad”</u> <u>key-guess</u> <u>patterns</u>
_µ_ = ( _µ_ 1 _, µ_ 2) (1 _,_ 0) (3 _,_ 0) (5 _,_ 0) (0 _,_ 1) (0 _,_ 3) (0 _,_ 5)
_p_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> _p_ <sup>(1)</sup> 3
<sup>(1)</sup> 3 _p_ <sup>(1)</sup> 2
_p_ <sup>(1)</sup> 2 _p_ <sup>(1)</sup> 1
<sup>(1)</sup> 1 _p_ <sup>(2)</sup> 3
<sup>(2)</sup> 3 _p_ <sup>(2)</sup> 2
<sup>(2)</sup> 2 _p_ <sup>(2)</sup> 1
3 2 1 3 2 1
_PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> 0 _._ 9995967 0 _._ 9999992 0 _._ 9999999 0 _._ 6840611 0 _._ 8930240 0 _._
_S_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> 0 _._ 9995967 0 _._ 9999992 0 _._ 9999999 0 _._ 6840611 0 _._ 8930240 0 _._ 9540340
According to Eq.(2) and the conclusion described in Section 5.1, we can estimate the bias
of the superpoly under different key-guess patterns, thus evaluating the corresponding
success probability. For the key-guess patterns ( _µ_ 1 _, µ_ 2) where _µ_ 1 _>_ 0, the bias _ε_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup>
satisfies _ε_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> _≤_ _ε_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,_</sup> <sup>0)</sup>, which implies that the success probability _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup>
satisfies _ε_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> _≤_ _ε_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,_</sup> <sup>0)</sup>, which implies that the success probability _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> satisfies
_PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> _≥_ _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,_</sup> <sup>0)</sup> . Therefore, _PS_ <sup>((1</sup> <sup>_,_</sup> <sup>0))</sup>, _PS_ <sup>((3</sup> <sup>_,_</sup> <sup>0))</sup>, and _PS_ <sup>((5</sup> <sup>_,_</sup> <sup>0))</sup> can be used to evaluate the
lower bound for _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> . We have listed the estimated success probabilities for all key-guess
patterns in Table 6.
_S_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> _≥_ _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,_</sup> <sup>0)</sup>
_S_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,_</sup> <sup>0)</sup> . Therefore, _PS_ <sup>((1</sup> <sup>_,_</sup> <sup>0))</sup>
_S_ <sup>((1</sup> <sup>_,_</sup> <sup>0))</sup>, _PS_ <sup>((3</sup> <sup>_,_</sup> <sup>0))</sup>,
_S_ <sup>((3</sup> <sup>_,_</sup> <sup>0))</sup>, and _PS_ <sup>((5</sup> <sup>_,_</sup> <sup>0))</sup>
<u>Table</u> <u>6:</u> <u>the</u> <u>success</u> <u>probabilities</u> <u>for</u> <u>all</u> <u>key-guess</u> <u>patterns</u>
( _µ_ 1 _, µ_ 2) _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup>
_S_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup> ( _µ_ 1 _, µ_ 2) _PS_ <sup>(</sup> <sup>_µ_</sup> <sup>1</sup> <sup>_,µ_</sup> <sup>2)</sup>
_S_
(1 _, ∗_ ) _PS_ <sup>(1</sup> <sup>_,_</sup> <sup>0)</sup>
_S_ <sup>(1</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 1) _PS_ <sup>(0</sup> <sup>_,_</sup> <sup>1)</sup>
_S_ <sup>(3</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 2) _PS_ <sup>(0</sup> <sup>_,_</sup> <sup>3)</sup>
_S_ <sup>(3</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 3) _PS_ <sup>(0</sup> <sup>_,_</sup> <sup>3)</sup>
_S_ <sup>(5</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 4) _PS_ <sup>(0</sup> <sup>_,_</sup> <sup>5)</sup>
_S_ <sup>(5</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 5) _PS_ <sup>(0</sup> <sup>_,_</sup> <sup>5)</sup>
_S_ <sup>(5</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 6) _PS_ <sup>(0</sup> <sup>_,_</sup> <sup>5)</sup>
_S_ <sup>(5</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 7) _PS_ <sup>(0</sup> <sup>_,_</sup> <sup>5)</sup>
_S_ _S_
(2 _, ∗_ ) _PS_ <sup>(3</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 2) _PS_
(3 _, ∗_ ) _PS_ <sup>(3</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 3) _PS_
(4 _, ∗_ ) _PS_ <sup>(5</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 4) _PS_
(5 _, ∗_ ) _PS_ <sup>(5</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 5) _PS_
(6 _, ∗_ ) _PS_ <sup>(5</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 6) _PS_
(7 _, ∗_ ) _PS_ <sup>(5</sup> <sup>_,_</sup> <sup>0)</sup> (0 _,_ 7) _PS_
_S_
We present the attack results in Table 7. We explain the contents in the table,
taking the second row as an example. We can successfully identify the key-guess patterns
_{_ ( _µ_ 1 _, µ_ 2) _|_ 0 _< µ_ 1 _≤_ 7 _,_ 0 _≤_ _µ_ 2 _≤_ 7 _}_ with a theoretical success rate of 99 _._ 68% as the wrong
key guesses. That is, out of 64 different key guesses, we can filter out 56 wrong key guesses
with a success rate of 99 _._ 68%, providing log2( <sup><u>64</u></sup> 8 <sup>) = 3</sup> <sup>bits</sup> <sup>key</sup> <sup>information.</sup>
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>215</u>
<u>Table</u> <u>7:</u> <u>The</u> <u>dynamic</u> <u>cube</u> <u>attack</u> <u>against</u> <u>190-round</u> <u>Grain-128AEAD</u>
Excludable key guessing The success Key information
patterns ( _µ_ 1 _, µ_ 2) probability available
_{_ ( _µ_ 1 _, µ_ 2) _|_ 0 _< µ_ 1 _≤_ 7 _,_ 0 _≤_ _µ_ 2 _≤_ 7 _}_ 99 _._ 68% log2( 6464 _−_ 56 <sup>) = 3</sup> <sup>bits</sup>
_{_ ( _µ_ 1 _, µ_ 2) _|_ 0 _≤_ _µ_ 1 _, µ_ 2 _≤_ 7 _}\{_ (0 _, µ_ 2) _|_ 0 _≤_ _µ_ 2 _≤_ 3 _}_ 82 _._ 57% log2( 6464 _−_ 60 <sup>) = 4</sup> <sup>bits</sup>
_{_ ( _µ_ 1 _, µ_ 2) _|_ 0 _≤_ _µ_ 1 _, µ_ 2 _≤_ 7 _}\{_ (0 _, µ_ 2) _|_ 0 _≤_ _µ_ 2 _≤_ 1 _}_ 65 _._ 85% log2( 6464 _−_ 62 <sup>) = 5</sup> <sup>bits</sup>
_{_ ( _µ_ 1 _, µ_ 2) _|_ 0 _≤_ _µ_ 1 _, µ_ 2 _≤_ 7 _}\{_ (0 _,_ 0) _}_ 45 _._ 04% log2( 6464 _−_ 63 <sup>) = 6</sup> <sup>bits</sup>
6.2 Zero-sum distinguisher for Full Grain-128
In this subsection, we provide a further discussions on the feasibility of Hao et al’s dynamic
cube attack against the full Grain-128.
Under the same nullification strategy _NS_ = _{_ 90 _, b_ 158 _}_, we applied our new MILP
modeling method to evaluate the cubes used in [HJL <sup>+</sup> 20]. We found that their superpolies
are 0-constant polynomials under both correct and wrong key guesses. This indicates that
these cubes were unable to distinguish between correct and wrong key guesses.
By searching for cubes with dimensions ranging from 70 to 80, we found a batch of
qualified cubes that meet the requirements: under the correct key guess, their superpolies
are 0-constant polynomials; under wrong key guesses, their superpolies are non-constant
polynomials with high degrees. However, these cubes were also unable to distinguish
between correct and wrong key guesses because their superpolies have a bias of almost 2 <sup>_−_</sup> <sup>1</sup>
under wrong key guesses. Additionally, we observed that under wrong key guesses, the
minimal algebraic degrees of their superpolies are generally high, ranging from a minimum
of 9 to a maximum of 23. That is why their superpolies have biases very close, even equal
to 2 <sup>_−_</sup> <sup>1</sup> . We presented some cubes along with their respective minimal algebraic degrees in
Table 11 (available in Appendix B) and Table 8. The comprehensive results have been
uploaded to our Git repository.
Table <u>8:</u> <u>The</u> <u>minimal</u> <u>algebraic</u> <u>degrees</u> <u>of</u> <u>the</u> <u>superpolies</u> <u>under</u> <u>the</u> <u>“bad”</u> <u>key-guess</u> <u>patterns</u>
<u>cube</u> _<u>I</u>_ _<u>µ</u>_ <u>=</u> <u>1</u> _<u>µ</u>_ <u>=</u> <u>3</u> _<u>µ</u>_ <u>=</u> <u>5</u> <u>cube</u> _<u>I</u>_ _<u>µ</u>_ <u>=</u> <u>1</u> _<u>µ</u>_ <u>=</u> <u>3</u> _<u>µ</u>_ <u>=</u> <u>5</u>
_I_ 0 15 14 13 _I_ 25 13 10 9
_I_ 1 13 11 12 _I_ 26 12 10 11
_I_ 2 10 9 9 _I_ 27 15 13 13
_I_ 3 13 11 12 _I_ 28 19 17 18
_I_ 4 14 12 12 _I_ 29 19 19 15
_I_ 5 13 11 12 _I_ 30 19 15 17
_I_ 6 11 10 10 _I_ 31 20 18 19
_I_ 7 14 9 13 _I_ 32 20 19 17
_I_ 8 12 11 11 _I_ 33 22 21 19
_I_ 9 14 12 10 _I_ 34 20 17 17
_I_ 10 12 11 12 _I_ 35 23 21 19
_I_ 11 15 14 15 _I_ 36 23 17 18
_I_ 12 10 9 9 _I_ 37 21 17 17
_I_ 13 11 10 10 _I_ 38 14 9 11
_I_ 14 16 14 15 _I_ 39 21 20 18
_I_ 15 15 13 11 _I_ 40 18 16 16
_I_ 16 14 12 12 _I_ 41 18 16 17
_I_ 17 16 13 13 _I_ 42 19 18 16
_I_ 18 15 11 12 _I_ 43 21 18 18
_I_ 19 16 12 13 _I_ 44 17 17 16
_I_ 20 15 13 12 _I_ 45 17 14 15
_I_ 21 16 12 14 _I_ 46 17 14 15
_I_ 22 13 10 11 _I_ 47 17 13 14
_I_ 23 16 12 14 _I_ 48 20 17 16
_I_ 24 16 12 15 _I_ 49 18 15 15
<u>216</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
As the dimension of cubes decreases and the search space increases, it becomes challenging to find cubes with 0-constant superpolies under the correct key guess. To further
explore the structural characteristics of Grain-128, we attempted to recover the superpolies
of the full-version Grain-128 without applying any nullification strategies. As a result, we
successfully recovered the superpolies of a batch of cubes with 80 dimensions, including 9
0-constant superpolies. These cubes with 0-constant superpolies can serve as the zero-sum
distinguishers for the full-version Grain-128, and listed in Table 9. All the recovered
superpolies have been uploaded to our git repository.
<u>Table</u> <u>9:</u> <u>The</u> <u>zero-sum</u> <u>distinguishers</u> <u>for</u> <u>the</u> <u>full-version</u> <u>Grain-128</u>
_{_ 0 _, . . .,_ 95 _}\{_ 12 _,_ 25 _,_ 27 _,_ 29 _,_ 30 _,_ 35 _,_ 39 _,_ 40 _,_ 41 _,_ 43 _,_ 57 _,_ 62 _,_ 67 _,_ 70 _,_ 76 _,_ 91 _}_
_{_ 0 _, . . .,_ 95 _}\{_ 28 _,_ 29 _,_ 30 _,_ 31 _,_ 35 _,_ 39 _,_ 40 _,_ 41 _,_ 43 _,_ 44 _,_ 45 _,_ 61 _,_ 71 _,_ 76 _,_ 85 _,_ 89 _}_
_{_ 0 _, . . .,_ 95 _}\{_ 13 _,_ 20 _,_ 29 _,_ 30 _,_ 38 _,_ 39 _,_ 40 _,_ 41 _,_ 43 _,_ 49 _,_ 52 _,_ 54 _,_ 63 _,_ 70 _,_ 76 _,_ 81 _}_
_{_ 0 _, . . .,_ 95 _}\{_ 26 _,_ 30 _,_ 38 _,_ 40 _,_ 41 _,_ 43 _,_ 44 _,_ 50 _,_ 69 _,_ 72 _,_ 73 _,_ 75 _,_ 78 _,_ 84 _,_ 87 _,_ 90 _}_
_{_ 0 _, . . .,_ 95 _}\{_ 17 _,_ 30 _,_ 33 _,_ 38 _,_ 39 _,_ 40 _,_ 41 _,_ 43 _,_ 44 _,_ 54 _,_ 60 _,_ 66 _,_ 70 _,_ 71 _,_ 92 _,_ 94 _}_
_{_ 0 _, . . .,_ 95 _}\{_ 30 _,_ 31 _,_ 38 _,_ 39 _,_ 40 _,_ 41 _,_ 42 _,_ 43 _,_ 50 _,_ 53 _,_ 56 _,_ 69 _,_ 76 _,_ 81 _,_ 90 _,_ 93 _}_
_{_ 0 _, . . .,_ 95 _}\{_ 15 _,_ 27 _,_ 32 _,_ 35 _,_ 38 _,_ 39 _,_ 40 _,_ 41 _,_ 43 _,_ 44 _,_ 50 _,_ 67 _,_ 72 _,_ 80 _,_ 86 _,_ 90 _}_
_{_ 0 _, . . .,_ 95 _}\{_ 26 _,_ 30 _,_ 32 _,_ 39 _,_ 40 _,_ 41 _,_ 43 _,_ 44 _,_ 50 _,_ 55 _,_ 59 _,_ 67 _,_ 68 _,_ 73 _,_ 76 _,_ 90 _}_
_{_ 0 _, . . .,_ 95 _}\{_ 18 _,_ 26 _,_ 30 _,_ 38 _,_ 39 _,_ 40 _,_ 41 _,_ 43 _,_ 44 _,_ 49 _,_ 50 _,_ 52 _,_ 53 _,_ 85 _,_ 90 _,_ 92 _}_
In our experiments without any nullification strategy, we observed that all of the
recovered superpolies of high-dimensional cubes exhibit significant biases close to 2 <sup>_−_</sup> <sup>1</sup>,
along with having a high algebraic degree and minimal algebraic degree. Additionally,
these superpolies are very sparse. Based on the above experimental results, we infer that
the superpolies of high-dimensional cubes in the full Grain-128 generally exhibit significant
biases, as well as high algebraic degree and minimal algebraic degree. Moreover, when
a nullification strategy is applied to the full Grain-128, even under wrong key guesses,
the superpolies may still be simplified, particularly for the “bad” key guesses. Besides,
the biases of superpolies may be more significant, approaching 2 <sup>_−_</sup> <sup>1</sup> . Therefore, under
the framework of the dynamic cube attack proposed by Hao et al., we consider that it is
difficult to carry out key-recovery attacks solely by altering the nullification strategy.
6.3 Comparison of two different bias evaluation methods
In this section, we will compare the accuracy of bias estimation method based on the PAB
technique given in Section 4.2 and the method based on the minimal split set given in
[HJL <sup>+</sup> 20] by experimental testing on the reduced-round Grain-128AEAD. The nullification
strategy and cubes employed were derived from Section 6.1. We apply the two methods
to the superpolies under the key-guess pattern _µ_ = (5 _,_ 0), respectively. The results are
explicitly shown in Table 10. We provide a straightforward explanation of the data
in Table 10, using the data from the 30th row as an example, which is “ _I_ 30, 0 _._ 252210,
_{_ ( _k_ 88 _,_ 5) _,_ ( _k_ 89 _,_ 4) _}_, 0 _._ 242751, Λ = _{_ 46 _,_ 47 _,_ 88 _,_ 89 _}_, 0 _._ 03125”. For the cube _I_ 30, the practical
bias obtained by directly testing the recovered superpoly is 0 _._ 252210. By using the PAB
technique, we can represent the superpoly as _p_ <sup>_′_</sup> _I_ <sup>=</sup> <sup>_ps ⊕_</sup> <sup>_k_</sup> <sup>88</sup> <sup>_g_</sup> <sup>1</sup> <sup>_⊕_</sup> <sup>_k_</sup> <sup>89</sup> <sup>_g_</sup> <sup>2,</sup> <sup>where</sup> <sup>deg</sup> _m_ <sup>(</sup> <sup>_g_</sup> <sup>1) = 5</sup>
and deg _m_ ( _g_ 2) = 4. Furthermore, by using the corresponding approximate polynomial, the
bias of the superpoly is evaluated to be 0 _._ 242751. As for the method based on the minimal
split set, the minimal split set is given by Λ = _{_ 46 _,_ 47 _,_ 88 _,_ 89 _}_, and the estimated bias of
the superpoly is 2 <sup>_−_</sup> <sup>(</sup> <sup>_|_</sup> <sup>Λ</sup> <sup>_|_</sup> <sup>+1)</sup> = 0 _._ 03125.
It can be seen from Table 10 that the accuracy of the new bias evaluation method
is much better than that of the minimal split method for Grain-128AEAD. We further
investigate the reason for this phenomenon. Based on numerous experiments, we have
observed that the minimal algebraic degrees of the superpolies in Grain-128AEAD are
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>217</u>
Table 10: Bias evaluation for 190-round Grain-128AEAD under _NS_ = _{_ ( _v_ 23 _, b_ 151) _,_ ( _v_ 24 _, b_ 152) _}_
<u>and</u> _<u>µ</u>_ <u>= (5</u> _<u>,</u>_ <u>0).</u>
Cube Superpoly PAB the minimal split set
_I_ Recovery _{_ ( _k_ <sup>_µω_</sup> _, d_ _ω_ ) _}_ evaluated bias the minimal split set Λ evaluated bias
_I_ 0 0 _._ 234221 _{_ ( _k_ 88 _k_ 89 _,_ 3) _}_ 0 _._ 236503 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 1 0 _._ 294281 _{_ ( _k_ 88 _k_ 89 _,_ 3) _}_ 0 _._ 289374 Λ = _{_ 47 _,_ 57 _,_ 64 _,_ 89 _}_ 0 _._ 03125
_I_ 2 0 _._ 344177 _{_ ( _k_ 89 _,_ 5) _}_ 0 _._ 343991 Λ = _{_ 36 _,_ 47 _,_ 57 _,_ 89 _}_ 0 _._ 03125
_I_ 3 0 _._ 241364 _{_ ( _k_ 89 _,_ 4) _}_ 0 _._ 241931 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 4 0 _._ 250311 _{_ ( _k_ 88 _k_ 89 _,_ 3) _}_ 0 _._ 244338 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 5 0 _._ 188051 _{_ ( _k_ 88 _,_ 4) _,_ ( _k_ 89 _,_ 4) _}_ 0 _._ 18449 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 6 0 _._ 258658 _{_ ( _k_ 88 _k_ 89 _,_ 2) _}_ 0 _._ 252482 Λ = _{_ 47 _,_ 57 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 7 0 _._ 250978 _{_ ( _k_ 88 _k_ 89 _,_ 3) _}_ 0 _._ 246790 Λ = _{_ 46 _,_ 64 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 8 0 _._ 213818 _{_ ( _k_ 88 _,_ 4) _,_ ( _k_ 89 _,_ 4) _}_ 0 _._ 207318 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 9 0 _._ 221518 _{_ ( _k_ 89 _,_ 4) _}_ 0 _._ 231354 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 10 0 _._ 227296 _{_ ( _k_ 88 _k_ 89 _,_ 4) _}_ 0 _._ 225621 Λ = _{_ 46 _,_ 58 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 11 0 _._ 264006 _{_ ( _k_ 88 _k_ 89 _,_ 3) _}_ 0 _._ 263735 Λ = _{_ 46 _,_ 56 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 12 0 _._ 278914 _{_ ( _k_ 88 _k_ 89 _,_ 4) _,_ ( _k_ 88 _k_ 103 _,_ 4) _}_ 0 _._ 271873 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 13 0 _._ 253929 _{}_ 0 _._ 253144 Λ = _{_ 46 _,_ 47 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 14 0 _._ 275089 _{_ ( _k_ 89 _,_ 4) _}_ 0 _._ 269062 Λ = _{_ 57 _,_ 64 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 15 0 _._ 229797 _{_ ( _k_ 89 _,_ 3) _}_ 0 _._ 217179 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 16 0 _._ 225223 _{_ ( _k_ 88 _,_ 3) _}_ 0 _._ 217594 Λ = _{_ 46 _,_ 64 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 17 0 _._ 250940 _{_ ( _k_ 89 _,_ 5) _}_ 0 _._ 247095 Λ = _{_ 58 _,_ 64 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 18 0 _._ 231102 _{_ ( _k_ 88 _,_ 3) _}_ 0 _._ 223129 Λ = _{_ 46 _,_ 64 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 19 0 _._ 206355 _{_ ( _k_ 88 _,_ 2) _,_ ( _k_ 89 _,_ 5) _}_ 0 _._ 189639 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 20 0 _._ 222698 _{_ ( _k_ 88 _,_ 3) _,_ ( _k_ 89 _,_ 5) _}_ 0 _._ 210399 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 21 0 _._ 224708 _{_ ( _k_ 88 _,_ 3) _,_ ( _k_ 89 _,_ 5) _}_ 0 _._ 216341 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 22 0 _._ 209636 _{_ ( _k_ 89 _,_ 4) _}_ 0 _._ 204303 Λ = _{_ 46 _,_ 88 _,_ 89 _}_ 0 _._ 0625
_I_ 23 0 _._ 244953 _{_ ( _k_ 89 _,_ 4) _}_ 0 _._ 236709 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 24 0 _._ 317458 _{_ ( _k_ 89 _,_ 7) _}_ 0 _._ 317111 Λ = _{_ 46 _,_ 47 _,_ 48 _,_ 88 _}_ 0 _._ 03125
_I_ 25 0 _._ 138506 _{_ ( _k_ 89 _,_ 3) _}_ 0 _._ 140588 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 26 0 _._ 121749 _{_ ( _k_ 89 _,_ 2) _}_ 0 _._ 115462 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 27 0 _._ 258453 _{_ ( _k_ 89 _,_ 3) _}_ 0 _._ 247838 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 28 0 _._ 222552 _{_ ( _k_ 89 _,_ 4) _}_ 0 _._ 225904 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 29 0 _._ 227592 _{_ ( _k_ 89 _,_ 3) _}_ 0 _._ 219513 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 30 0 _._ 252210 _{_ ( _k_ 88 _,_ 5) _,_ ( _k_ 89 _,_ 4) _}_ 0 _._ 242751 Λ = _{_ 46 _,_ 47 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 31 0 _._ 28257 _{_ ( _k_ 88 _k_ 89 _,_ 4) _}_ 0 _._ 280329 Λ = _{_ 46 _,_ 47 _,_ 58 _,_ 88 _}_ 0 _._ 03125
_I_ 32 0 _._ 240152 _{_ ( _k_ 89 _,_ 4) _}_ 0 _._ 243257 Λ = _{_ 46 _,_ 88 _,_ 89 _,_ 124 _}_ 0 _._ 03125
_I_ 33 0 _._ 1509 _{_ ( _k_ 89 _,_ 3) _}_ 0 _._ 164343 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 34 0 _._ 27245 _{_ ( _k_ 89 _,_ 3) _}_ 0 _._ 251105 Λ = _{_ 46 _,_ 47 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 35 0 _._ 23912 _{_ ( _k_ 88 _k_ 89 _,_ 4) _}_ 0 _._ 237271 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 36 0 _._ 221251 _{_ ( _k_ 89 _,_ 4) _}_ 0 _._ 222968 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 37 0 _._ 239745 _{_ ( _k_ 89 _,_ 5) _}_ 0 _._ 238529 Λ = _{_ 19 _,_ 46 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 38 0 _._ 267408 _{_ ( _k_ 88 _k_ 89 _,_ 4) _}_ 0 _._ 269031 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 39 0 _._ 218067 _{_ ( _k_ 88 _,_ 2) _}_ 0 _._ 205309 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 40 0 _._ 264484 _{_ ( _k_ 89 _,_ 4) _}_ 0 _._ 257638 Λ = _{_ 46 _,_ 58 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 41 0 _._ 280949 _{_ ( _k_ 88 _k_ 89 _,_ 4) _}_ 0 _._ 286235 Λ = _{_ 46 _,_ 64 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 42 0 _._ 25487 _{_ ( _k_ 89 _,_ 3) _}_ 0 _._ 242833 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 43 0 _._ 214379 _{_ ( _k_ 89 _,_ 3) _}_ 0 _._ 216105 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 44 0 _._ 230568 _{_ ( _k_ 89 _,_ 3) _}_ 0 _._ 22729 Λ = _{_ 47 _,_ 57 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 45 0 _._ 185132 _{_ ( _k_ 88 _,_ 2) _,_ ( _k_ 89 _,_ 3) _}_ 0 _._ 163287 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 46 0 _._ 241527 _{}_ 0 _._ 241939 Λ = _{_ 40 _,_ 46 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 47 0 _._ 198668 _{_ ( _k_ 89 _,_ 3) _}_ 0 _._ 200201 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 48 0 _._ 200107 _{_ ( _k_ 89 _,_ 4) _,_ ( _k_ 88 _,_ 3) _}_ 0 _._ 18751 Λ = _{_ 46 _,_ 64 _,_ 88 _,_ 89 _}_ 0 _._ 03125
_I_ 49 0 _._ 195266 _{_ ( _k_ 88 _,_ 2) _}_ 0 _._ 187071 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
_I_ 50 0 _._ 272528 _{_ ( _k_ 89 _,_ 5) _}_ 0 _._ 277182 _|_ Λ _|_ _≥_ 5 _≤_ 0 _._ 015625
typically very high under wrong key guesses. Therefore, for the identified minimal split
set, the superpoly still exhibits a high minimal algebraic degree and significant bias over
its complement space, leading to the failure of Assumption 1 on Grain-128AEAD in
the method based on the minimal split set. For the full version of Grain-128, we also
observed similar algebraic properties for superpolis under the wrong key guesses, which
fails Assumption 1 on Grain-128.
## 7 Conclusion
In this paper, we explain that the dynamic cube attack proposed by Hao et al. against
Grain-128 is invalid. Furthermore, we present a reliable implementation of dynamic cube
attacks against the Grain family of ciphers, including wrong key-guess analysis and a
more accurate MILP modeling method based on 3SDP/u. Additionally, we introduce a
<u>218</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
new technique called Polynomial Approximation with respect to Bias (PAB), which can
provide a more accurate bias evaluation. As an application, we implement a dynamic
cube attack against the Grain family of ciphers. As a result, we present a key-recovery
attack on 190-round Grain-128AEAD and discuss the feasibility of dynamic cube attacks
on full-version Grain-128. Furthermore, through experiments, we demonstrate that the
bias estimation method based on the minimal split set is unsuitable for the Grain family
of ciphers. Simultaneously, we show the effectiveness and accuracy of our new method for
evaluating bias. We believe this new method can play an important role in dynamic cube
attacks on more rounds.
## References
[ADMS09] Jean-Philippe Aumasson, Itai Dinur, Willi Meier, and Adi Shamir. Cube
testers and key recovery attacks on reduced-round MD6 and Trivium. In
Orr Dunkelman, editor, _Fast_ _Software_ _Encryption,_ _16th_ _International_ _Work-_
_shop,_ _FSE_ _2009,_ _Leuven,_ _Belgium,_ _February_ _22-25,_ _2009,_ _Revised_ _Selected_
_Papers_, volume 5665 of _Lecture_ _Notes_ _in_ _Computer_ _Science_, pages 1–22, Berlin,
Heidelberg, 2009. Springer.
[ÅHJM11] Martin Ågren, Martin Hell, Thomas Johansson, and Willi Meier. Grain-128a:
a new version of grain-128 with optional authentication. _Int._ _J._ _Wirel._ _Mob._
_Comput._, 5(1):48–59, 2011.
[DGP <sup>+</sup> 11] Itai Dinur, Tim Güneysu, Christof Paar, Adi Shamir, and Ralf Zimmermann.
An experimentally verified attack on full Grain-128 using dedicated reconfigurable hardware. In Dong Hoon Lee and Xiaoyun Wang, editors, _Advances_ _in_
_Cryptology_ _-_ _ASIACRYPT_ _2011_ _-_ _17th_ _International_ _Conference_ _on_ _the_ _Theory_
_and_ _Application_ _of_ _Cryptology_ _and_ _Information_ _Security,_ _Seoul,_ _South_ _Korea,_
_December_ _4-8,_ _2011._ _Proceedings_, volume 7073 of _Lecture_ _Notes_ _in_ _Computer_
_Science_, pages 327–343, Berlin, Heidelberg, 2011. Springer.
[DS09] Itai Dinur and Adi Shamir. Cube attacks on tweakable black box polynomials.
In Antoine Joux, editor, _Advances_ _in_ _Cryptology_ _-_ _EUROCRYPT_ _2009,_ _28th_
_Annual_ _International_ _Conference_ _on_ _the_ _Theory_ _and_ _Applications_ _of_ _Crypto-_
_graphic Techniques,_ _Cologne,_ _Germany,_ _April 26-30,_ _2009. Proceedings_, volume
5479 of _Lecture_ _Notes_ _in_ _Computer_ _Science_, pages 278–299, Berlin, Heidelberg,
2009. Springer.
[DS11] Itai Dinur and Adi Shamir. Breaking grain-128 with dynamic cube attacks. In
Antoine Joux, editor, _Fast_ _Software_ _Encryption_ _-_ _18th_ _International_ _Workshop,_
_FSE_ _2011,_ _Lyngby,_ _Denmark,_ _February_ _13-16,_ _2011,_ _Revised_ _Selected_ _Papers_,
volume 6733 of _Lecture_ _Notes_ _in_ _Computer_ _Science_, pages 167–187. Springer,
2011.
[HHPW22] Jiahui He, Kai Hu, Bart Preneel, and Meiqin Wang. Stretching cube attacks:
Improved methods to recover massive superpolies. In Shweta Agrawal and
Dongdai Lin, editors, _Advances_ _in_ _Cryptology_ _-_ _ASIACRYPT_ _2022_ _-_ _28th_
_International_ _Conference_ _on_ _the_ _Theory_ _and_ _Application_ _of_ _Cryptology_ _and_
_Information_ _Security,_ _Taipei,_ _Taiwan,_ _December_ _5-9,_ _2022,_ _Proceedings,_ _Part_
_IV_, volume 13794 of _Lecture_ _Notes_ _in_ _Computer_ _Science_, pages 537–566, Cham,
2022. Springer.
[HIJ <sup>+</sup> 19] Yonglin Hao, Takanori Isobe, Lin Jiao, Chaoyun Li, Willi Meier, Yosuke Todo,
and Qingju Wang. Improved division property based cube attacks exploiting
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>219</u>
algebraic properties of superpoly. _IEEE_ _Trans._ _Computers_, 68(10):1470–1486,
2019.
[HJL <sup>+</sup> 20] Yonglin Hao, Lin Jiao, Chaoyun Li, Willi Meier, Yosuke Todo, and Qingju
Wang. Links between division property and other cube attack variants. _IACR_
_Trans._ _Symmetric_ _Cryptol._, 2020(1):363–395, 2020.
[HLM <sup>+</sup> 20] Yonglin Hao, Gregor Leander, Willi Meier, Yosuke Todo, and Qingju Wang.
Modeling for three-subset division property without unknown subset - improved cube attacks against Trivium and Grain-128AEAD. In Anne Canteaut
and Yuval Ishai, editors, _Advances_ _in_ _Cryptology_ _-_ _EUROCRYPT_ _2020_ _-_ _39th_
_Annual_ _International_ _Conference_ _on_ _the_ _Theory_ _and_ _Applications_ _of_ _Crypto-_
_graphic_ _Techniques,_ _Zagreb,_ _Croatia,_ _May_ _10-14,_ _2020,_ _Proceedings,_ _Part_ _I_,
volume 12105 of _Lecture_ _Notes_ _in_ _Computer_ _Science_, pages 466–495, Cham,
2020. Springer.
[HLM <sup>+</sup> 21] Yonglin Hao, Gregor Leander, Willi Meier, Yosuke Todo, and Qingju Wang.
Modeling for three-subset division property without unknown subset. _J._
_Cryptol._, 34(3):22, 2021.
[HST <sup>+</sup> 21] Kai Hu, Siwei Sun, Yosuke Todo, Meiqin Wang, and Qingju Wang. Massive
superpoly recovery with nested monomial predictions. In Mehdi Tibouchi and
Huaxiong Wang, editors, _Advances_ _in_ _Cryptology_ _-_ _ASIACRYPT_ _2021_ _-_ _27th_
_International_ _Conference_ _on_ _the_ _Theory_ _and_ _Application_ _of_ _Cryptology_ _and_
_Information_ _Security,_ _Singapore,_ _December_ _6-10,_ _2021,_ _Proceedings,_ _Part_ _I_,
volume 13090 of _Lecture_ _Notes_ _in_ _Computer_ _Science_, pages 392–421, Cham,
2021. Springer.
[HTZ13] Robert V. Hogg, Elliot A. Tanis, and Dale L. Zimmerm. _Probability_ _and_
_statistical_ _inference_ _(ninth_ _Edition)_ . Pearson Education, Inc., 2013.
[RBMA16] Majid Rahimi, Mostafa Barmshory, Mohammad Hadi Mansouri, and Mo
hammad Reza Aref. Dynamic cube attack on grain-v1. _IET_ _Inf._ _Secur._,
10(4):165–172, 2016.
[Sun21] Yao Sun. Automatic search of cubes for attacking stream ciphers. _IACR_ _Trans._
_Symmetric_ _Cryptol._, 2021(4):100–123, 2021.
<u>220</u> <u>Dynamic</u> <u>Cube</u> <u>Attacks</u> <u>against</u> <u>Grain-128AEAD</u>
## A The MILP models of the 3SDP/u for three basic func- tions
We introduce the MILP models for the three basic functions COPY, AND, and XOR. Note
that these models are first proposed in [HLM <sup>+</sup> 20, HLM <sup>+</sup> 21], and describe the generalized
forms of their propagation rules, which are easily deduced from their original forms. When
constructing the MILP model, we usually initialize an empty model _M_, then generate some
MILP variables _v_ 1 _, . . ., vm_ by _M.var_ _←_ _v_ 1 _, . . ., vm_, which are used in the inequalities.
Next, the inequality is added to the model _M.con_ _←_ _v_ 2 + _· · ·_ + _vm_ _≥_ _v_ 1. Finally, we
can call an off-the-shelf MILP solver to solve the model and obtain the results, including
feasible or infeasible. In this paper, the MILP tool we used is the Gurobi optimizer.
_COP Y_
Proposition 4 (MILP model for COPY) . _Let a_ _−−−−→_ ( _b_ 0 _, b_ 1 _, . . ., bm−_ 1) _be a three-subset_
_division_ _trail_ _of_ _COPY_ _._ _The_ _following_ _inequalities_ _are_ _sufficient_ _to_ _describe_ _the_ _propagation_
_of_ _the_ _modified_ _three-subset_ _division_ _property_ _for_ _COPY_ _._
- _M.var_ _←_ _a, b_ 0 _, . . ., bm−_ 1 _as_ _binary;_
_M.con ←_ _a_ = _b_ 0 _∨_ _b_ 1 _∨· · · ∨_ _bm−_ 1 _._
_Note_ _that_ _the_ _Gurobi_ _optimizer_ _supports_ _the_ _Or_ ( _∨_ ) _operation._
_AND_
Proposition 5 (MILP model for AND) . _Let_ ( _a_ 0 _, a_ 1 _, . . ., am−_ 1) _−−−→_ _b_ _be_ _a_ _three-subset_
_division_ _trail_ _of_ _AND_ _._ _The_ _following_ _inequalities_ _are_ _sufficient_ _to_ _describe_ _the_ _propagation_
_of_ _the_ _modified_ _three-subset_ _division_ _property_ _for_ _AND_ _._
- _M.var_ _←_ _a_ 0 _, . . ., am−_ 1 _, b_ _as_ _binary;_
_M.con ←_ _b_ = _ai, ∀i ∈{_ 0 _,_ 1 _, . . ., m −_ 1 _}._
_XOR_
Proposition 6 (MILP model for XOR) . _Let_ ( _a_ 0 _, a_ 1 _, . . ., am−_ 1) _−−−→_ _b_ _be_ _a_ _three-subset_
_division_ _trail_ _of_ _XOR_ _._ _The_ _following_ _inequalities_ _are_ _sufficient_ _to_ _describe_ _the_ _propagation_
_of_ _the_ _modified_ _three-subset_ _division_ _property_ _for_ _XOR_ _._
- _M.var_ _←_ _a_ 0 _, . . ., am−_ 1 _, b_ _as_ _binary;_
_M.con ←_ _b_ = _a_ 0 + _a_ 1 + _· · ·_ + _am−_ 1 _._
<u>Chen</u> <u>Liu</u> <u>and</u> <u>Tian</u> <u>Tian</u> <u>221</u>
## B The cubes used in Section 6.2
<u>Table</u> <u>11:</u> <u>The</u> <u>cubes</u> <u>used</u> <u>in</u> <u>Section</u> <u>6.2</u>
_<u>I</u>_ <u>0</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>87</u> _<u>}</u>_
_<u>I</u>_ <u>1</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>73</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>}</u>_
_<u>I</u>_ <u>2</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>73</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>89</u> _<u>}</u>_
_<u>I</u>_ <u>3</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>73</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>87</u> _<u>}</u>_
_<u>I</u>_ <u>4</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>92</u> _<u>}</u>_
_<u>I</u>_ <u>5</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>91</u> _<u>,</u>_ <u>92</u> _<u>}</u>_
_<u>I</u>_ <u>6</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>73</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>86</u> _<u>}</u>_
_<u>I</u>_ <u>7</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>92</u> _<u>}</u>_
_<u>I</u>_ <u>8</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>73</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>86</u> _<u>,</u>_ <u>87</u> _<u>}</u>_
_<u>I</u>_ <u>9</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>89</u> _<u>}</u>_
_<u>I</u>_ <u>10</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>54</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>89</u> _<u>}</u>_
_<u>I</u>_ <u>11</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>55</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>87</u> _<u>}</u>_
_<u>I</u>_ <u>12</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>73</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>89</u> _<u>}</u>_
_<u>I</u>_ <u>13</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>89</u> _<u>,</u>_ <u>91</u> _<u>}</u>_
_<u>I</u>_ <u>14</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>55</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>}</u>_
_<u>I</u>_ <u>15</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>55</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>89</u> _<u>}</u>_
_<u>I</u>_ <u>16</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>8</u> _<u>,</u>_ <u>25</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>59</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>91</u> _<u>}</u>_
_<u>I</u>_ <u>17</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>26</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>86</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>18</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>26</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>86</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>19</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>26</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>86</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>20</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>26</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>60</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>86</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>21</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>26</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>31</u> _<u>,</u>_ <u>32</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>36</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>46</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>50</u> _<u>,</u>_ <u>51</u> _<u>,</u>_ <u>54</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>62</u> _<u>,</u>_ <u>68</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>22</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>26</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>31</u> _<u>,</u>_ <u>32</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>36</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>46</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>50</u> _<u>,</u>_ <u>51</u> _<u>,</u>_ <u>54</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>62</u> _<u>,</u>_ <u>68</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>23</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>26</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>31</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>36</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>46</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>50</u> _<u>,</u>_ <u>51</u> _<u>,</u>_ <u>54</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>62</u> _<u>,</u>_ <u>68</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>24</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>26</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>31</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>36</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>46</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>50</u> _<u>,</u>_ <u>51</u> _<u>,</u>_ <u>54</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>62</u> _<u>,</u>_ <u>68</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>25</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>26</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>86</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>26</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>26</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>76</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>86</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>27</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>26</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>84</u> _<u>,</u>_ <u>86</u> _<u>,</u>_ <u>92</u> _<u>,</u>_ <u>94</u> _<u>}</u>_
_<u>I</u>_ <u>28</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>42</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>50</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>55</u> _<u>,</u>_ <u>56</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>82</u> _<u>,</u>_ <u>87</u> _<u>}</u>_
_<u>I</u>_ <u>29</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>94</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>30</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>55</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>31</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>32</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>55</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>33</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>34</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>35</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>36</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>37</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>38</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>23</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>28</u> _<u>,</u>_ <u>31</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>37</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>50</u> _<u>,</u>_ <u>51</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>62</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>73</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>87</u> _<u>}</u>_
_<u>I</u>_ <u>39</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>33</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>47</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>40</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>31</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>41</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>42</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>66</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>43</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>44</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>45</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>94</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>46</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>45</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>47</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>30</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>69</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_<u>I</u>_ <u>48</u> _<u>{</u>_ <u>0</u> _<u>, . . .,</u>_ <u>95</u> _<u>}\{</u>_ <u>21</u> _<u>,</u>_ <u>27</u> _<u>,</u>_ <u>29</u> _<u>,</u>_ <u>35</u> _<u>,</u>_ <u>39</u> _<u>,</u>_ <u>40</u> _<u>,</u>_ <u>41</u> _<u>,</u>_ <u>43</u> _<u>,</u>_ <u>44</u> _<u>,</u>_ <u>49</u> _<u>,</u>_ <u>53</u> _<u>,</u>_ <u>57</u> _<u>,</u>_ <u>61</u> _<u>,</u>_ <u>67</u> _<u>,</u>_ <u>70</u> _<u>,</u>_ <u>71</u> _<u>,</u>_ <u>74</u> _<u>,</u>_ <u>75</u> _<u>,</u>_ <u>77</u> _<u>,</u>_ <u>83</u> _<u>,</u>_ <u>87</u> _<u>,</u>_ <u>95</u> _<u>}</u>_
_I_ 49 _{_ 0 _, . . .,_ 95 _}\{_ 21 _,_ 27 _,_ 29 _,_ 35 _,_ 39 _,_ 40 _,_ 41 _,_ 43 _,_ 44 _,_ 49 _,_ 53 _,_ 57 _,_ 61 _,_ 67 _,_ 70 _,_ 71 _,_ 74 _,_ 77 _,_ 83 _,_ 87 _,_ 94 _,_ 95 _}_