Have a personal or library account? Click to login
Tight Analysis of Grover-Meets-Simon and Alg-PolyQ2 Attacks via Formalizing Quantum Rank-Solving under Deferred Measurement Cover

Tight Analysis of Grover-Meets-Simon and Alg-PolyQ2 Attacks via Formalizing Quantum Rank-Solving under Deferred Measurement

By: Qiqing Xia,  Qianru Zhu,  Huiqin Xie and  Li Yang  
Open Access
|Dec 2025

Full Article

1.
Introduction

The development of large-scale quantum computers will have a significant impact on the security of many cryptographic schemes currently in use [1]. In particular, the introduction of Shor’s algorithm [2,3] can solve factorization and discrete logarithm problems in polynomial time. Since almost all current public key schemes are built on the assumption of these computationally difficult problems, this will have a devastating impact on asymmetric cryptographic schemes. This situation has triggered a new line of research, namely post-quantum cryptography, which aims to develop new cryptographic primitives in the hope of resisting attackers equipped with quantum computers. NIST has proposed the post-quantum asymmetric scheme project [47] to standardize several quantum-resistant publickey cryptographic algorithms. It is crucial to start the transition to quantum-resistant cryptography before quantum computers are truly available. Fully exploring the potential of quantum algorithms to attack cryptographic schemes and effectively assessing the quantum security of existing schemes under quantum computing will help better design cryptographic algorithms to resist attacks from future quantum computers.

However, the situation for symmetric cryptographic schemes is less clear: universal attacks define the security of ideal symmetric primitives and will achieve a quadratic speed-up through Grover’s algorithm [8,9], implying that in a post-quantum world, doubling the key length can restore equivalent ideal security. For nearly 20 years, it was believed that Grover’s algorithm was the only advantage attackers had when attacking symmetric cryptography using quantum computers. Although the community seems to think that this solution [10,11] has solved the problem, knowledge about practical attacks is still very limited. At present, the impact of many quantum attacks on symmetric cryptography remains unclear, and potential threats need to be explored. The National Academy of Sciences report on the rise of quantum computing [12] also pointed out that there may be some currently unknown clever quantum attacks, such as Simon’s algorithm. Indeed, cryptographers have made significant progress against quantum attackers using superposition queries, which can break many symmetric key schemes in polynomial time.

Quantum algorithms have become a central focus in the field of symmetric cryptanalysis. Grover’s algorithm is one of the most widely applied algorithms in this field, as it can speed up the search efficiency in an unstructured database of size 2n, reducing the complexity of exhaustive search attacks from 𝒪(2n) to 𝒪(2n){\cal O}\left( {\sqrt {{2^n}} } \right). Then, Brassard et al. generalized Grover’s algorithm and developed the famous quantum amplitude amplification (QAA) algorithm [13]. Compared with Grover’s algorithm, the QAA algorithm extends the preparation of the initial state from the n Hadamard gates to any quantum algorithm 𝒜, thus expanding the application range. Based on Grover’s algorithm, Brassard et al. [14] proposed a quantum collision search algorithm (BHT algorithm) for the 2-to-1 function over a domain of size 2n, which can find a set of collisions with high probability through 𝒪(2n3){\cal O}\left( {{2^{{n \over 3}}}} \right) queries. Ambainis [15] extends this result to arbitrary functions, showing that 𝒪(22n3){\cal O}\left( {{2^{{{2n} \over 3}}}} \right) queries suffice to find a set of collisions. Furthermore, Aaronson and Shi [16] established a lower bound of 𝒪(2n3){\cal O}\left( {{2^{{n \over 3}}}} \right) for the BHT algorithm, which is lower than the original optimal lower bound. Zhandry [17] proved that the probability of finding a collision after performing q queries is at most q32n{{{q^3}} \over {{2^n}}}. Additionally, Hosoyamada et al. [18] explored multiple collisions and proposed a new quantum algorithm that, for l-collisions with small l, gets collisions in 2n×(3l11)2×3l1{2^{{{n \times \left( {{3^{l - 1}} - 1} \right)} \over {2 \times {3^{l - 1}}}}}} queries. Apart from Grover’s algorithm, Simon’s algorithm [19] is also the current research focus in symmetric cryptanalysis. Kuwakado and Morii [20] proved that Simon’s algorithm can distinguish a three-round Feistel structure from a random permutation using the parallelism of quantum computation—an impossible task for classical computers. Similarly, many quantum cryptanalysis works [2123] are carried out based on the periodicity-finding feature of Simon’s algorithm. These include attacks on working modes such as CBC-MAC, PMAC, GMAC, GCM, OCB, and constructions like LRW, etc. Many common quantum attack methods [2427] are also built upon or inspired by Simon’s algorithm.

In recent years, a significant focus of research has been the development of new quantum attack algorithms targeting cryptographic schemes. One popular approach involves combining different quantum algorithms to achieve more efficient attacks, such as Grover-meets-Kuperberg algorithm [28], Bernstein–Vazirani-meets-Grover algorithm [29], etc. The Grover-meets-Simon algorithm proposed by Leander and May [30] is the most widely applied among them, where Grover’s algorithm serves as the outer structure and Simon’s algorithm as the inner structure. The period identified by Simon’s algorithm is used as the decision condition of Grover’s search. The introduction of the Grover-meets-Simon has enabled its application to search for two keys in function structures that can be modeled as periodic functions [3133]. Building on this idea, Bonnetain [34] proposed two improved combinations of Grover’s algorithm and Simon’s algorithm under the Q1 model (attackers perform offline quantum computations but make only classical online queries) and Q2 model (attackers can make superposition queries to a quantum oracle), where the one in the Q2 model is called Alg-PolyQ2 algorithm. This Alg-PolyQ2 algorithm leverages a combination of online queries and offline computation to achieve an exponential reduction in quantum query complexity.

Despite the promising structure of these combined quantum algorithms, the actual attack success probability and the required number of iterations, especially under practical constraints such as deferred measurement, remain insufficiently characterized. This motivates our work: to analyze in detail how the internal structure of these algorithms affects their success probability under deferred measurement, and to derive tight bounds on the attack success probability and the required number of iterations. Through this analysis, we aim to better understand the real-world effectiveness of such combined quantum attacks, going beyond asymptotic query complexity and providing quantitative insight into their feasibility.

Our contributions In this paper, we mainly study the Grover-meets-Simon and Alg-PolyQ2 algorithms in detail under deferred measurement. We analyze the generalized success probability of these two algorithms in detail from a novel perspective based on the initial amplitude, thereby confirming their effectiveness. To the best of our knowledge, such a detailed analysis has not been done before. In more detail, our main contributions are as follows:

  • Since both algorithms involve the rank-solving problem of a system of linear equations, we provide a formal analysis of the generalized quantum Gauss-Jordan elimination. Through the formal description, we discuss the situation (quantum state form) of obtaining the reduced row echelon form matrix based on this method, demonstrate the necessity of auxiliary qubits, and provide its formal proof. Based on the deferred measurement principle to solve the rank, we further analyze the rank-solving process and provide the number of matrices with rank-(n – 1) in both n-dimensional and (n – 1)-dimensional linear spaces, respectively, along with the corresponding proofs. This is the first time to consider in detail the formal analysis of quantum Gauss–Jordan elimination as a subroutine to solve the rank in the parallel Simon’s algorithms under deferred measurement.

  • We provide a tight analysis of the Grover-meets-Simon and Alg-PolyQ2 algorithms under deferred measurement in detail. Specifically, considering that when Simon’s algorithm is used as the internal structure, the key space will collapse if the intermediate measurements are made. Therefore, combined with the deferred measurement principle, we examine the challenges arising from deferring all measurements in Simon’s algorithm to the end of the entire computation during the iteration process. Based on the oscillation amplitude of the initial state, the tight bounds of the generalized success probability and the optimal number of iterations of the Grover-meets-Simon algorithm are analyzed in detail. Similarly, we also provide a tight analysis of the Alg-PolyQ2 algorithm to demonstrate its effectiveness as a quantum attack. This paper provides a novel perspective for assessing the practical effectiveness of quantum algorithms—one that does not rely on assumptions about quantum input length, such as the number of parallel instances of Simon’s algorithm and the choice of plaintext pairs in the classifier of the Grover-meets-Simon algorithm.

Outline The rest of the paper is organized as follows: Section 2 introduces the relevant knowledge of quantum circuit models and quantum algorithms; Section 3 provides a formal analysis of the generalized quantum Gauss-Jordan elimination; Section 4 provides a tight analysis of the Grover-meets-Simon and Alg-PolyQ2 algorithms under deferred measurement via formalizing quantum rank-solving; Section 5 discusses some future research directions; Section 6 summarizes this paper.

2.
Preliminaries

In this section, we introduce some concepts of quantum computation and review Simon’s and Grover’s algorithms.

2.1.
Quantum Circuit Model

A circuit consisting of a series of quantum gates applied to a group of qubits is called a quantum circuit, which can be used to describe the change of quantum state in Hilbert space. Each quantum logic gate can be represented by a unitary matrix. These unitary operators in Hilbert space are all invertible, and it may be necessary to use enough auxiliary qubits to achieve the required goal. A single qubit has two quantum ground states |0〉, |1〉. If the quantum state |φ〉 can be linearly represented by |0〉, |1〉, then this state is called a superposition state |φ〉 = α|0〉 + β|1〉. Among them, the probability amplitudes α and β are complex numbers, and |α|2 + |β|2 = 1. When an n-qubit is given, the computational basis has 2n vectors. After applying a series of quantum gates to the initial state, the original superposition state changes. Finally, the system is measured and some n-qubit vectors are obtained on the computational basis to get the desired result.

Quantum computing takes advantage of parallel computing by utilizing quantum phenomena such as quantum superposition and entanglement, allowing multiple computable states to be processed simultaneously, thereby improving efficiency and speed. The unique capabilities of quantum computers enable them to surpass classical computers in certain computing tasks.

Principle of quantum parallel computing

Assume f(x) : {0,1}n → {0,1}m, the mapping of this function in the quantum setting can be used as an oracle Uf : |x, y〉 → |x, yf(x)〉. When the initial state |0〉n|0〉m is input, Hn|0n|0mUf12nx|x|f(x){H^{ \otimes n}}|0{\rangle ^{ \otimes n}}|0{\rangle ^{ \otimes m}}{1 \over {\sqrt {{2^n}} }}\sum\limits_x | \;x\rangle |f(x)\rangle , which can calculate all values of this function f. This oracle Uf is widely used in various quantum algorithms.

In addition, the following two important principles regarding quantum circuits are very practical. For detailed proof, refer to [35].

Principle of deferred measurement

Measurements can always be moved from the intermediate stage of a quantum circuit to the end of the circuit. Any measurement that occurs inside a quantum circuit can be deferred to the end of the circuit.

Principle of implicit measurement

Any unmeasured qubit at the end of a quantum circuit can be assumed to be measured.

2.2.
Parallel Simon’s Algorithm

Simon’s algorithm [19] aims to solve the periodic problem of hidden subgroups, which can be described as follows:

Simon’s Problem with promise: suppose there is a quantum oracle to a function f: {0,1}n → {0,1}m such that ∃ s ∈ {0,1}n, ∀ x ∈ {0,1}n, f(x) = f(xs). The goal is to find the period s.

An individual Simon’s algorithm can be performed by the following steps, with the corresponding quantum circuit shown in Figure 1.

  • Prepare the initial state |0In|0IIm|0\rangle _I^{ \otimes n}|0\rangle _{II}^{ \otimes m} and perform the Hadamard transform Hn on the first register. The following quantum states can be obtained: 12nx{0,1}n|xI|0II.{1 \over {\sqrt {{2^n}} }}\sum\limits_{x \in {{\{ 0,1\} }^n}} | \;x{\rangle _I}|0{\rangle _{II}}.

  • Perform a quantum query on the function f, mapping to the following quantum state: 12nx{0,1}n|xI|f(x)II.{1 \over {\sqrt {{2^n}} }}\sum\limits_{x \in {{\{ 0,1\} }^n}} | \;x{\rangle _I}|f(x){\rangle _{II}}.

  • Perform the Hadamard transform Hn on the first register, and the following quantum state can be obtained: 12ny{0,1}nx{0,1}n(1)x·y|yI|f(x)II.{1 \over {{2^n}}}\sum\limits_{y \in {{\{ 0,1\} }^n}} {\sum\limits_{x \in {{\{ 0,1\} }^n}} {{{( - 1)}^{x\;\cdoty}}} } |y{\rangle _I}|f(x){\rangle _{II}}.

    Suppose there is some s ≠ 0, for each y, then |y, f(x)〉 = |y, f(xs〉, and the amplitude of this configuration is: 1α(x,y)=12n[ (1)x·y+(1)(xs)·y ]=12n(1)x·y[ (1+(1)s·y ].\alpha (x,y) = {1 \over {{2^n}}}\left[ {{{( - 1)}^{x\;\cdoty}} + {{( - 1)}^{(x \oplus s)\cdoty}}} \right] = {1 \over {{2^n}}}{( - 1)^{x\;\cdoty}}\left[ {\left( {1 + {{( - 1)}^{s\;\cdoty}}} \right].} \right.

    Let X1 be an ((n – 1)-dimensional subspace of F2n_2^n, and divide F2n_2^n into coset X1 and X1 + s, sF2n\X1s \in _2^n\backslash {X_1}. In this setting, we assume xX1.

  • Measure the first register, and it will collapse to a value that satisfies y · s = 0.

Figure 1.

Quantum circuit of Simon’s algorithm.

When y · s = 1, the amplitude of α(x, y) is 0. Hence, we can only get the vector y orthogonal to period s. The parallel Simon’s algorithms under deferred measurement only need 𝒪(n) oracle queries, n – 1 linearly independent values of y are obtained with high probability, then s can be obtained by solving the following linear equations: 2{ y1·s=0y2·s=0yn·s=0. \left\{ {\matrix{ {{y_1}\;\cdot\;s = 0} \hfill \cr {{y_2}\;\cdot\;s = 0} \hfill \cr {\;\;\; \vdots } \hfill \cr {{y_n}\;\cdot\;s = 0.} \hfill \cr } } \right.

Simon’s algorithm is a probabilistic algorithm, and the promise of Simon’s problem is not always fully satisfied in cryptanalysis. We introduce a theorem to quantify the relationship between the number of parallel instances of Simon’s algorithm and the success probability. The proof can be found in [23]:

Theorem 1.

Given f : {0,1}n → {0,1}m and s as an actual period of f, ∃ t ∈ {0,1}n\{0, s} such that the input x ∈ {0,1}n satisfies f(xt) = f(x). Define 3ε(f)=maxt{0,1}n\{0,s}Prx[f(x)=f(xt)].\varepsilon (f) = \mathop {\max }\limits_{t \in {{\{ 0,1\} }^n}\backslash \{ 0,{\rm{s}}\} } P{r_x}[f(x) = f(x \oplus t)].

If ε(f) ≤ p0 < 1, after performing l instances of Simon’s algorithm in parallel, the success probability of outputting the actual period s is at least 12n(1+p02)l1 - {2^n}{\left( {{{1 + {p_0}} \over 2}} \right)^l}. Choosing l ≥ 3n/(1 – p0), ε(f) is far enough away from 1.

2.3.
Generalized Grover’s Algorithm

Grover’s algorithm [8,9] aims to quickly search for r marked solution elements in an unstructured database of size N, which can achieve a quadratic speedup compared to the time complexity of classical exhaustive algorithms. It can be described as follows:

Grover’s problem: given a search space N whose elements are represented on n = log2 N qubits, suppose there is a quantum oracle to a function f: {0,1}n → {0,1} such that xN, f(x) = 1. The goal is to find these r marked solution elements.

Amplitude amplification is a natural generalization of the original Grover’s algorithm. The result of amplitude amplification is described in the following theorem [13], with the corresponding quantum circuit shown in Figure 2.

Figure 2.

Quantum circuit of generalized Grover’s algorithm.

Here, 𝒜 is the Hadamard transform Hn in the original Grover’s algorithm.

Theorem 2.

Let 𝒜 be any quantum algorithm without measurement, and let f: {0, 1}n → {0, 1} be a Boolean function that distinguishes between good and bad states from the output of the algorithm 𝒜. Let p > 0 be the initial success probability of 𝒜|0〉. We define 𝒬 = –𝒜U0𝒜−1Uf, where U0 = 2|0〉n〈0|nI, Uf is performed: Uf|x={ |x, if f(x)=1|x, if f(x)=0, {U_f}|x\rangle = \left\{ {\matrix{ { - |x\rangle,{\rm{ }}if{\rm{ }}f(x) = 1} \cr {|x\rangle,{\rm{ }}if{\rm{ }}f(x) = 0,} \cr } } \right. if the state is good, then the phase is reversed.

After T iterations 𝒬T 𝒜|0〉, the outcome is good with probability at least max {p, 1 – p} under deferred measurement, where T= π4θ T = \left\lfloor {{\pi \over {4\theta }}} \right\rfloor and sin2(θ) = p.

3.
Formal Analysis of Generalized Quantum Gauss-Jordan Elimination

Quantum Gauss-Jordan elimination (QGJE) was first proposed by Do et al. [36] to solve the linear system of n equations on n variables AX = b, aijA, with the goal of achieving a speedup over classical computing techniques. However, no formal proof has been provided yet. In this section, we provide a formal analysis of the generalized QGJE, in particular the existence of a full rank or rank-(n – 1) check in a quantum oracle of cryptographic algorithms. The following are the formal steps to perform it. For detailed quantum gate operations of the generalized QGJE, please refer to [37,38].

Formal description of the generalized QGJE

Given a quantum coefficient matrix |Amn=iαi|Aimn|A{\rangle _{m \otimes n}} = \sum\nolimits_i {{\alpha _i}{{\left| {{A_i}} \right\rangle }_{m \otimes n}}} of linear systems of equations, there exists a unitary operator UQGJE such that iαi|Ai|0numUQGJEiαi|Ai|εi\sum\nolimits_i {{\alpha _i}} \left| {{A_i}} \right\rangle |0{\rangle ^{ \otimes num}}\buildrel {{U_{{\rm{QGJE}}}}} \over \longrightarrow \sum\nolimits_i {{\alpha _i}} \left| {A_i^\prime } \right\rangle \left| {{\varepsilon _i}} \right\rangle , where |Ai\left| {A_i^\prime } \right\rangle is the reduced row echelon form (RREF) matrix corresponding to different |Ai〉, and |εi〉 corresponding to each superposition component are auxiliary qubits after applying the generalized QGJE.

Quantum Gauss-Jordan Elimination (QGJE) [36]

Step 1: First, find out the first non-zero |ai,1〉 ≠ 0 using Grover’s Search algorithm.

Step 2: If successful, take the first leading |1〉 in the first position as |a1,1〉, otherwise change to the next column and repeat step 1.

Step 3: Eliminate all other elements |a2,1〉, ⋯, |an,1〉, in the first column.

Step 4: Change n to n – 1, control if still n > 0, repeat step 1.

Step 5 In backward eliminate all |an–1,n〉, ⋯, |a1,n〉.

Step 6: Check if n > 0, change n to n – 1, and repeat step 5.

Remark 1.

The QGJE is chosen because it is a generalized quantum extension of the classical Gauss-Jordan elimination, which serves as the foundational algorithm for rank-solving problems. The algorithm proposed by Bonnetain and Jaques is specifically tailored to determine the full-rank property of certain structured matrices derived from symmetric cryptographic primitives and its core technique still relies on Gauss-Jordan elimination to transform the matrix into an upper triangular form. The quantum algorithms proposed by Xia et al. are universal and can compute both the rank and the general solution of arbitrary quantum linear systems with a single measurement. Therefore, for the detailed steps of quantum rank-solving, please refer to [37,38].

In brief, if the rank is required through deferred measurement, then these auxiliary qubits |ε=i|εi|\varepsilon \rangle = \sum\nolimits_i {\left| {{\varepsilon _i}} \right\rangle } can contain the solution of the rank corresponding to iαiAi\sum\nolimits_i {{\alpha _i}} {A_i}. The rank of a linear system of equations is solved without any intermediate measurement that would cause superposition state collapse. The specific operation is as follows: the pivot |aii\left| {a_{ii}^\prime } \right\rangle , i ≤ min {m, n} in |Ai\left| {A_i^\prime } \right\rangle is used as the control qubit of the CNOT gate, XORed to these all-zero auxiliary qubit inputs, and finally the rank is obtained by measuring these auxiliary qubits after the operation.

In formal description of the generalized QGJE, auxiliary qubits |0〉num are necessary to complete the generalized QGJE. Next, we provide a lemma to prove its necessity.

Lemma 1.

There exists a unitary operation UQGJE such that UQGJE(|A〉|0〉num) = |A′〉|ε〉. Then it always holds that num > 0.

Proof.

Consider the first non-zero element |ak,j〉 in the column as a pivot and an element |ai,j〉(i > k) of its column. In the generalized QGJE, these two elements not only serve as control qubits but must also be transformed as target qubits during the elimination process.

Assume for contradiction that there exists a unitary operator U without auxiliary qubits such that U|00〉 = |00〉,U|01〉 = |10〉,U|10〉 = |10〉,U|11〉 = |11〉. From this, we can find that { U|01=|10U|10=|10{ U(0,0,1,0)T=(0,1,0,0)T(i)U(0,1,0,0)T=(0,1,0,0)T(ii). \left\{ {\matrix{ {U|01\rangle = \;|10\rangle } \hfill \cr {U|10\rangle = \;|10\rangle } \hfill \cr } \Rightarrow \left\{ {\matrix{ {U{{(0,0,1,0)}^T} = {{(0,1,0,0)}^T}\;(i)} \cr {U{{(0,1,0,0)}^T} = {{(0,1,0,0)}^T}\;(ii).} \cr } } \right.} \right.

If we do (i) – (ii), we get U(0, –1, 1, 0)T = (0,0,0,0)T, violating unitarity since U−1 cannot recover the original state, contradicts! There is no inverse operator such that U−1 (0,0,0,0)T = (0, –1,1,0)T. As a result, there exists no such unitary operator U. Thus, the assumption does not hold.

It can be seen that auxiliary qubits are necessary to store the values of data qubits to control the transformation.

Lemma 1 demonstrates the necessity of auxiliary qubits in the generalized QGJE. This naturally raises an important question: we need to consider whether the auxiliary qubits can be disentangled. Next, we provide a theorem to state the issue and show the form of the quantum state after the generalized QGJE.

Theorem 3.

There is no operator U = U′ · UQGJE such that iαi|Ai|0numU(jβj|Bj)(kγk|ck),\sum\limits_i {{\alpha _i}} \left| {{A_i}} \right\rangle |0{\rangle ^{ \otimes num}}\buildrel U \over \longrightarrow \left( {\sum\limits_j {{\beta _j}} \left| {{B_j}} \right\rangle } \right) \otimes \left( {\sum\limits_k {{\gamma _k}} \left| {{c_k}} \right\rangle } \right), where Bj is the same RREF matrix corresponding to multiple different Ai. The coefficient βj is the probability amplitude associated with |Bj〉 and γk is the probability amplitude associated with |ck〉, where |ck〉 are different auxiliary states for different k.

Proof.

This means that the auxiliary qubits cannot be disentangle with other registers and thus iαi|Ai|0numUQGJEiαi|Ai|εi\sum\nolimits_i {{\alpha _i}} \left| {{A_i}} \right\rangle |0{\rangle ^{ \otimes num}}\buildrel {{U_{{\rm{QGJE}}}}} \over \longrightarrow \sum\nolimits_i {{\alpha _i}} \left| {A_i^\prime } \right\rangle \left| {{\varepsilon _i}} \right\rangle .

Next, we use the method of contradiction. Suppose that there is an operator U such that iαi|Ai|0num(jβj|Bj)(kγk|ck)\sum\nolimits_i {{\alpha _i}} \left| {{A_i}} \right\rangle |0{\rangle ^{ \otimes num}} \to \;\left( {\sum\nolimits_j {{\beta _j}} \left| {{B_j}} \right\rangle } \right) \otimes \left( {\sum\nolimits_k {{\gamma _k}\left| {{c_k}} \right\rangle } } \right). We divide U into the product of two unitary operators UQGJE and U′.

4UQGJE(iαi|Ai|0num)=iαi(|Ai|εi)U(jβj|Bj)(kγk|ck)=j,kβjγk(|Bj|ck).\matrix{ {{U_{{\rm{QGJE}}}}\left( {\sum\limits_i {{\alpha _i}} \left| {{A_i}} \right\rangle \otimes |0{\rangle ^{ \otimes num}}} \right)} \hfill & { = \sum\limits_i {{\alpha _i}} \left( {\left| {A_i^\prime } \right\rangle \otimes \left| {{\varepsilon _i}} \right\rangle } \right)} \hfill \cr {} \hfill & {\left( {\sum\limits_j {{\beta _j}} \left| {{B_j}} \right\rangle } \right) \otimes \left( {\sum\limits_k {{\gamma _k}} \left| {{c_k}} \right\rangle } \right)} \hfill \cr {} \hfill & { = \sum\limits_{j,k} {{\beta _j}} {\gamma _k}\left( {\left| {{B_j}} \right\rangle \otimes \left| {{c_k}} \right\rangle } \right).} \hfill \cr }

While the RREF of a matrix is unique, the reduction process may not be, which results in different auxiliary states. Multiple different Ai may correspond to the same RREF matrix Bj. Hence, ji always holds. The original problem can be reduced to whether the auxiliary states added during the operation can be disentangled through U′. If both Σj=1{\Sigma _j} = 1 and Σk=1{\Sigma _k} = 1, then the space containing iαi(|Ai|εi)\sum\nolimits_i {{\alpha _i}} \left( {\left| {A_i^\prime } \right\rangle \otimes \left| {{\varepsilon _i}} \right\rangle } \right) has the same dimension as that of j,kβjγk|Bjck\sum\nolimits_{j,k} {{\beta _j}} {\gamma _k}\left| {{B_j} \otimes {c_k}} \right\rangle since U′ is a unitary operator and they are both one-dimensional, which contradicts the fact that multiple |Ai〉 map to the same |Bj〉. Thus, it is evident that the case satisfying both Σj=1{\Sigma _j} = 1 and Σk=1{\Sigma _k} = 1 clearly cannot hold. There may exist the following cases:

  • Case 1:

    Σj=1{\Sigma _j} = 1 and k1\sum\nolimits_k \ne 1.

    Since auxiliary qubits record the information of |Ai〉, it is generally the case that |εi〉 ≠ |εi〉 when ii′. However, due to Σj=1{\Sigma _j} = 1, all different |Ai〉 correspond to the same RREF matrix |B1〉, which is clearly not the case.

  • Case 2:

    Σj1{\Sigma _j} \ne 1 and Σk=1{\Sigma _k} = 1.

    According to Formula (4), when k = 1, that is, auxiliary qubits are disentangled and can return to all-zero states |0 〉num. Thus, we can get that iαi|AiUjβj|Bj\sum\nolimits_i {{\alpha _i}} \left| {{A_i}} \right\rangle \sum\nolimits_j {{\beta _j}} \left| {{B_j}} \right\rangle . Different matrices may get the same RREF matrix after the generalized QGJE, that is |{Ai}| > |{Bj}|. Suppose that |B1〉 is the RREF matrix corresponding to |A11}, |A12〉. And |B2〉 is the RREF matrix corresponding to |A21〉, |A22〉. There are superposition states 12|A11+12|A21{1 \over {\sqrt 2 }}\left| {{A_{11}}} \right\rangle + {1 \over {\sqrt 2 }}\left| {{A_{21}}} \right\rangle and 12|A12+12|A22{1 \over {\sqrt 2 }}\left| {{A_{12}}} \right\rangle + {1 \over {\sqrt 2 }}\left| {{A_{22}}} \right\rangle . We get that 5U(12|A11+12|A21)=U(12|A12+12|A22)=12|B1+12|B2.U\left( {{1 \over {\sqrt 2 }}\left| {{A_{11}}} \right\rangle + {1 \over {\sqrt 2 }}\left| {{A_{21}}} \right\rangle } \right) = U\left( {{1 \over {\sqrt 2 }}\left| {{A_{12}}} \right\rangle + {1 \over {\sqrt 2 }}\left| {{A_{22}}} \right\rangle } \right) = {1 \over {\sqrt 2 }}\left| {{B_1}} \right\rangle + {1 \over {\sqrt 2 }}\left| {{B_2}} \right\rangle.

    Consider the invertibility of the unitary operator U, U1(12|B1+12|B2){U^{ - 1}}\left( {{1 \over {\sqrt 2 }}\left| {{B_1}} \right\rangle + {1 \over {\sqrt 2 }}\left| {{B_2}} \right\rangle } \right) must have only unique preimage. Contradicting with the above Formula (5), this case does not hold.

  • Case 3:

    j1\sum\nolimits_j \ne \;1 and k1\sum\nolimits_k \ne \;1.

    In this case, suppose that there are k1 original matrices |Ai1〉 corresponding to the same RREF matrix |B1〉 and there are k2 original matrices |Ai2〉 corresponding to the same RREF matrix |B2〉. Since the inputs are distinct and unitary operators are invertible, we have 6{ UQGJE(|Ai10num)=|B1εi1,i1{ 1,2,k1 }UQGJE(|Ai20num)=|B2εi2,i2{ 1,2,k2 }. \left\{ {\matrix{ {{U_{{\rm{QGJE}}}}\left( {\left| {{A_{{i_1}}} \otimes {0^{num}}} \right\rangle } \right) = \left| {{B_1} \otimes {\varepsilon _{{i_1}}}} \right\rangle,} \hfill & {{i_1} \in \left\{ {1,2, \cdots {k_1}} \right\}} \hfill \cr {{U_{{\rm{QGJE}}}}\left( {\left| {{A_{{i_2}}} \otimes {0^{num}}} \right\rangle } \right) = \left| {{B_2} \otimes {\varepsilon _{{i_2}}}} \right\rangle,} \hfill & {{i_2} \in \left\{ {1,2, \cdots {k_2}} \right\}.} \hfill \cr } } \right.

According to Formula (6), the number of original matrices corresponding to different RREF matrices may be different. Hence, there is no such unitary operation U’ that iαi(|Ai|εi)Uj,kβjγk(|Bj|ck)\sum\nolimits_i {{\alpha _i}} \left( {\left| {A_i^\prime } \right\rangle \otimes \left| {{\varepsilon _i}} \right\rangle } \right)\sum\nolimits_{j,k} {{\beta _j}} {\gamma _k}\left( {\left| {{B_j}} \right\rangle \otimes \left| {{c_k}} \right\rangle } \right).

Besides, if iαi|Ai|0numU(jβj|Bj)(kγk|ck)\sum\limits_i {{\alpha _i}} \left| {{A_i}} \right\rangle |0{\rangle ^{ \otimes num}}\buildrel U \over \longrightarrow \left( {\sum\nolimits_j {{\beta _j}} \left| {{B_j}} \right\rangle } \right) \otimes \left( {\sum\nolimits_k {{\gamma _k}} \left| {{c_k}} \right\rangle } \right) holds, then there is always a unitary transformation that changes auxiliary qubits kγk|ck\sum\nolimits_k {{\gamma _k}} \left| {{c_k}} \right\rangle into all-zero states. As in case 2, this case does not hold. In summary, there is no unitary transformation U’, equivalent to this theorem, which does not hold. Thus, the generalized QGJE can only realize iαi|Ai|0numUQGJEiαi|Ai|εi\sum\nolimits_i {{\alpha _i}} \left| {{A_i}} \right\rangle |0{\rangle ^{ \otimes num}}\buildrel {{U_{{\rm{QGJE}}}}} \over \longrightarrow \sum\nolimits_i {{\alpha _i}} \left| {A_i^\prime } \right\rangle \left| {{\varepsilon _i}} \right\rangle .

According to the above analysis, we provide a formal description and analysis of the generalized QGJE, demonstrating that it can serve as a subroutine for determining whether a matrix is of full rank or rank-(n – 1) in the quantum setting (see Remark 1).

In particular, since the registers of multiple instances of Simon’s algorithm form a tensor product, the resulting matrix is randomly generated. If Simon’s promise holds—i.e., there exists a hidden period, and then the rank of the resulting matrix is at most n – 1. In the following, we consider these cases and express them as a lemma.

Lemma 2.

Let l, n be integers such that l ≥ n, and consider matrices over the binary field 𝔽2 Then, the number of l × n matrices with rank-(n – 1) is given by NF2n(n1)=(2n1)i=0n2(2l2i){N_{_2^n}}(n - 1) = \left( {{2^n} - 1} \right)\prod\nolimits_{i = 0}^{n - 2} {\left( {{2^l} - {2^i}} \right)} over F2n_2^n and NF2n1(n1)=i=0n2(2l2i){N_{_2^{n - 1}}}(n - 1) = \prod\nolimits_{i = 0}^{n - 2} {\left( {{2^l} - {2^i}} \right)} over F2n1_2^{n - 1}.

Proof

Let us consider the set of all l × n matrices over 𝔽2 whose rank is exactly n – 1. The idea is to count the number of such matrices using a combinatorial argument based on matrix factorizations and properties of linear independence over finite fields. A matrix AF2l×nA \in _2^{l \times n} has rank-(n – 1) if and only if:

  • The row space of A has dimension n – 1 (i.e., n – 1 linearly independent rows);

  • The column space of A has dimension n – 1 (i.e., n – 1 linearly independent columns).

Every rank-(n – 1) matrix A can be written as a product A = UV, where:

  • UF2l×(n1)U \in _2^{l \times (n - 1)} is a full-rank matrix (its columns span a rank-(n – 1) subspace of F2l_2^l);

  • VF2(n1)×nV \in _2^{(n - 1) \times n} is a full-rank matrix (its rows span a rank-(n – 1) subspace of F2n_2^n).

Tight Bounds and Approximation

Let P=i=0n2(2l2i)=2i=0n2i·i=0n2(2li1)P = \prod\nolimits_{i = 0}^{n - 2} {\left( {{2^l} - {2^i}} \right)} = {2^{\sum\nolimits_{i = 0}^{n - 2} i }}\;\cdot\;\prod\nolimits_{i = 0}^{n - 2} {\left( {{2^{l - i}} - 1} \right)} , Q=i=0n2(2li1)Q = \prod\nolimits_{i = 0}^{n - 2} {\left( {{2^{l - i}} - 1} \right)} and thus P=2(n2)(n1)2·QP = {2^{{{(n - 2)(n - 1)} \over 2}}}\cdot\;Q

Lower Bound: Since 2li – 1 ≥ 2li–1 for li ≥ 1, we have Qi=0n22li1=2i=0n2(li1)=2(n1)(l1)(n2)(n1)2,P2(n2)(n1)2·2(n1)(l1)(n2)(n1)2=2(n1)(l1).\matrix{ {Q \ge \prod\limits_{i = 0}^{n - 2} {{2^{l - i - 1}}} = {2^{\sum\limits_{i = 0}^{n - 2} {(l - i - 1)} }} = {2^{(n - 1)(l - 1) - {{(n - 2)(n - 1)} \over 2}}},} \cr {P \ge {2^{{{(n - 2)(n - 1)} \over 2}}}\cdot\;{2^{(n - 1)(l - 1) - {{(n - 2)(n - 1)} \over 2}}} = {2^{(n - 1)(l - 1)}}.} \cr }

Upper Bound: Since 2li – 1 ≤ 2li, we have Qi=0n22li=2i=0n2(li)=2(n1)l(n2)(n1)2,P2(n2)(n1)2·2(n1)l(n2)(n1)2=2(n1)l.\matrix{ {Q \le \prod\limits_{i = 0}^{n - 2} {{2^{l - i}}} = {2^{\sum\nolimits_{i = 0}^{n - 2} {(l - i)} }} = {2^{(n - 1)l - {{(n - 2)(n - 1)} \over 2}}},} \cr {P \le {2^{{{(n - 2)(n - 1)} \over 2}}}\cdot\;{2^{(n - 1)l - {{(n - 2)(n - 1)} \over 2}}} = {2^{(n - 1)l}}.} \cr }

Summary of Bounds: 2(n – 1)(l – 1)P ≤ 2(n – 1)l.

Asymptotic Approximation: For large ln, the terms 2–(li) become negligible. Rewrite P as P=2(n1)li=0n2(12(li)).P = {2^{(n - 1)l}}\prod\limits_{i = 0}^{n - 2} {\left( {1 - {2^{ - (l - i)}}} \right)}.

Taking the logarithm: ln P=(n1)l·ln2+i=0n2ln(12(li))P = (n - 1)l\;\cdot\;\ln 2 + \sum\nolimits_{i = 0}^{n - 2} {\ln } \left( {1 - {2^{ - (l - i)}}} \right). For ln, 2–(li) ≈ 0, so ln(1 – 2–(li)) ≈ –2–(li). Thus, i=0n2ln(12(li))i=0n22(li)=2l(2n11).\sum\nolimits_{i = 0}^{n - 2} {\ln } \left( {1 - {2^{ - (l - i)}}} \right) \approx - \sum\limits_{i = 0}^{n - 2} {{2^{ - (l - i)}}} = - {2^{ - l}}\left( {{2^{n - 1}} - 1} \right).

Exponentiating: P ≈ 2(n–1)l exp(–2–(ln+1)) ≈ 2(n–1)l (1 – 2–(ln+1)).

Final Results

  • Tight Bounds: 72(n1)(l1)i=0n2(2l2i)2(n1)l.{2^{(n - 1)(l - 1)}} \le \prod\limits_{i = 0}^{n - 2} {\left( {{2^l} - {2^i}} \right)} \le {2^{(n - 1)l}}.

  • Approximation (for ln): 8i=0n2(2l2i)2(n1)l(12(ln+1)).\prod\limits_{i = 0}^{n - 2} {\left( {{2^l} - {2^i}} \right)} \approx {2^{(n - 1)l}}\left( {1 - {2^{ - (l - n + 1)}}} \right).

However, this factorization is not unique because different pairs (U, V) can give rise to the same matrix A. Specifically, for any invertible matrix T ∈ GLn–1 (𝔽2), we have A = UV = (UT)(T−1V), and both UT and T−1V are still full-rank. Therefore, to avoid overcounting, we divide by the number of invertible (n – 1) × (n – 1) matrices over 𝔽2. We proceed as follows:

  • First, we count the number of full-rank (n – 1)-dimensional column spaces over F2l_2^l. This is the number of ordered sets of (n – 1) linearly independent column vectors over F2l_2^l, which is i=0n2(2l2i)\prod\nolimits_{i = 0}^{n - 2} {\left( {{2^l} - {2^i}} \right)} .

  • Next, we proceed to count the number of full-rank (n – 1)-dimensional row spaces over F2n_2^n, which is i=0n2(2n2i)\prod\nolimits_{i = 0}^{n - 2} {\left( {{2^n} - {2^i}} \right)} .

  • Finally, we divide by the number of invertible (n – 1) × (n – 1) matrices over 𝔽2, which is | GLn1(F2) |=i=0n2(2n12i)\left| {{\rm{G}}{{\rm{L}}_{n - 1}}\left( {{_2}} \right)} \right| = \prod\nolimits_{i = 0}^{n - 2} {\left( {{2^{n - 1}} - {2^i}} \right)} .

Combining all the above parts, we can obtain: NF2n(n1)=i=0n2(2l2i)(2n2i)2n12i=(2n1)i=0n2(2l2i){N_{_2^n}}(n - 1) = \prod\nolimits_{i = 0}^{n - 2} {{{\left( {{2^l} - {2^i}} \right)\left( {{2^n} - {2^i}} \right)} \over {{2^{n - 1}} - {2^i}}}} = \left( {{2^n} - 1} \right)\prod\nolimits_{i = 0}^{n - 2} {\left( {{2^l} - {2^i}} \right)} .

Consider the set of all l × n matrices over 𝔽2 whose rank is exactly n – 1, and it is equivalent to a full-rank matrix associated with a homogeneous system of linear equations, i.e., the number of ordered sets of (n – 1) linearly independent column vectors over F2l_2^l, which is NF2n1(n1)=i=0n2(2l2i){N_{_2^{n - 1}}}(n - 1) = \prod\nolimits_{i = 0}^{n - 2} {\left( {{2^l} - {2^i}} \right)} .

For subsequent calculations, we provide the tight bound and approximation on this value of i=0n2(2l2i)\prod\nolimits_{i = 0}^{n - 2} {\left( {{2^l} - {2^i}} \right)} , as summarized in Tight Bounds and Approximation.

4.
Tight Analysis of Grover-Meets-Simon and Alg-PolyQ2 under Deferred Measurement

In this section, we analyze and discuss the generalized success probability of the Grover-meets-Simon and Alg-PolyQ2 algorithms without relying on assumptions about quantum input length under deferred measurement. Both quantum algorithms can be applicable to the FX construction Enc (k, x) = E (k, xk1) ⊕ k2 shown in Figure 3, where k ∈ {0,1 }m, k1,k2 ∈ { 0,1 }n. The key k2 is independent of the keys k,k1. Once the keys k and k1 are recovered, the key k2 can be naturally derived. Hence, the attack goal is to focus on recovering the keys k, k1.

Figure 3.

FX-construction.

Previous works In the Grover-meets-Simon algorithm [30], assuming that the periodic function has been sampled uniformly at random, the success probability is shown to be at least 25{2 \over 5}, using m+4n(n+n)m + 4n(n + \sqrt n ) qubits and 2m2𝒪(m+n){2^{{m \over 2}}}{\cal O}(m + n) oracle queries; in the Alg-PolyQ2 algorithm [34], it shows that the error produced in each iteration of this algorithm, i.e., the function has a period but does not return the actual period, is bounded by the maximum on the index i of p(i) ≤ 2(n+1) ((1 + p0)/2)l only using 𝒪(n) oracle queries, where l is the number of parallel Simon’s algorithms and p0 is the upper bound of ϵ (f) in Theorem 1.

Our work Our work begins with a formal analysis of the generalized quantum Gauss–Jordan elimination method for the rank problem in Section 3. From a novel perspective that does not rely on assumptions about quantum input length, we provide a tight analysis of the generalized success probability and the optimal number of iterations for the Grover-meets-Simon and Alg-PolyQ2 algorithms, based on the amplitudes of their initial states. The results demonstrate that both algorithms are effective quantum attacks, with generalized success probabilities close to 1.

4.1.
Generalized Success Probability of Grover-Meets-Simon

Leander and May [30] proposed a key-recovery attack leveraging a combination of Grover’s algorithm and Simon’s algorithm. The method embeds Simon’s algorithm within the iterations of Grover’s search, using Simon’s algorithm as the internal decision function and Grover’s algorithm as the outer search procedure. They also provided a relatively loose success probability of 25{2 \over 5} by choosing a specific quantum input length, such as the number of parallel instances of Simon’s algorithm. In this subsection, we provide the generalized success probability and the optimal number of iterations of the Grover-meets-Simon algorithm, along with their proofs.

Indeed, the Grover-meets-Simon algorithm is the generalized Grover’s algorithm shown in Figure 2, where 𝒜 is l(≥ n) parallel Simon’s algorithms, Uf is used to determine whether the rank is n – 1 by applying the generalized QGJE, and U0 changes the phase of the amplitude only for the zero state.

Let f : { 0,1 }m × { 0,1 }n → { 0,1 }n be a function such that f(k,x)=Enc(k,x)+E(k,x)f\left( {k',x} \right) = Enc\left( {k',x} \right) + E\left( {k',x} \right). It is evident that f (k′,x) has the period s = k1 when k′ = k. Applying algorithm 𝒜 on |0〉m+2nl, the initial input state of Grover-meets-Simon algorithm is 9|φ=12m(12n)lkF2mx1,,x1F2ny1,,ylF2n(1)x1·y1(1)xl·yl|y1,y2,yl|f(k,x1),,f(k,xl)|k.|\varphi \rangle = {1 \over {\sqrt {{2^m}} }}{\left( {{1 \over {{2^n}}}} \right)^l}\sum\limits_{\scriptstyle k' \in _2^m \atop {\scriptstyle {x_1}, \cdots,{x_1} \in _2^n \atop \scriptstyle {y_1}, \cdots,{y_l} \in _2^n}} {{{( - 1)}^{{x_1}\cdot{y_1}}}} \cdots {( - 1)^{{x_l}\cdot{y_l}}}\left| {{y_1},{y_2} \cdots,{y_l}} \right\rangle \left| {f\left( {k',{x_1}} \right), \cdots,f\left( {k',{x_l}} \right)} \right\rangle \left| {k'} \right\rangle.

Next, we analyze the initial state |φ〉 in detail. The key space kF2n|k\sum\nolimits_{k' \in _2^n} {\left| {k'} \right\rangle } to be searched is entangled with the superposition state of the matrices y1,,ylF2n|y1,,yl\sum\nolimits_{{y_1}, \cdots,{y_l} \in _2^n} {\left| {{y_1}, \cdots,{y_l}} \right\rangle } generated in parallel multiple Simon’s registers. Suppose that ϒ1={ (y1,y2,,yl)F2nlyis,s0 }{Y_1} = \left\{ {\left( {{y_1},{y_2}, \cdots,{y_l}} \right) \in _2^{nl}\mid {y_i} \bot s,s \ne 0} \right\} and ϒ2={ (y1,y2,,yl)F2nlyiF2n }{Y_2} = \left\{ {\left( {{y_1},{y_2}, \cdots,{y_l}} \right) \in _2^{nl}\mid {y_i} \in F_2^n} \right\}. When |k′〉 is the correct key |k〉, the row vector |y1〉 (i ∈ 1,2 ⋯ l) of the corresponding matrix |y1, y2, ⋯, y1 satisfies that yi ∈ ϒ1. Otherwise, the row vector |yi〉 (i ∈ 1,2 ⋯ l) only satisfies y1 ∈ ϒ2. If we consider the intermediate measurement in the original Simon’s algorithm, the key space kF2n|k\sum\nolimits_{k' \in _2^n} {\left| {k'} \right\rangle } will collapse so that we cannot search for the correct key |k〉. Therefore, we can measure only at the end of the algorithm according to the principle of deferred measurement.

In addition, when l = 𝒪(n), Simon’s algorithms are executed in parallel, the linear systems of equations generated are different from the linear systems of equations generated by a single Simon’s algorithm running 𝒪 (n) times. After O (n) Simon’s algorithms via measurement, we can obtain a determined classical matrix. Whereas as the number of parallel instances increases, the dimension of the span dim(span(( y1, y2, ⋯, yl))) = n – 1 can be obtained with a high probability [23], enabling recovery of the period s. However, without intermediate measurement after 𝒪(n) Simon’s algorithms in parallel, the resulting superposition state of matrices y1,y2,,ylF2n|y1,y2,,yl\sum\nolimits_{{y_1},{y_2}, \cdots,{y_l} \in _2^n} {\left| {{y_1},{y_2}, \cdots,{y_l}} \right\rangle } would contain all matrices generated by a row vector y that satisfies the promise. That is, the matrix components with rank less than n – 1 will inevitably be present in the superposition. For example, one of the components of the superposition state is |y1, y2, ⋯,y1〉, that is, all row vectors are the same and dim((y1, y1y1)) = 1. Therefore, under this deferred measurement setting, one must not only search for the correct key |k〉, but also identify and extract the appropriate components |y1, y2, ⋯,yl〉 by applying the generalized QGJE.

Consider that if k is the correct key, then the function f (k, x) has a non-zero period s such that f (k, x) = f (k, xs). To simplify the representation, we define a set X1 that is the n – 1 dimensional subspace of F2n_2^n and divide F2n{\left( {{1 \over {{2^{n - 1}}}}} \right)^l}\sum\limits_{\scriptstyle x \in {X_1} \atop \scriptstyle {y_1}, \cdots,{y_l} \in _2^n,y \bot s} {{{( - 1)}^{{x_1}\cdot{y_1}}}} \cdots {( - 1)^{{x_l}\cdot{y_l}}}\left| {{y_1},{y_2}, \cdots,{y_l}} \right\rangle \left| {f\left( {k',{x_1}} \right), \cdots,f\left( {k',{x_l}} \right)} \right\rangle. into cosets X1 and X1 + s. We suppose that the ground states can be combined to obtain the following result by applying parallel Simon’s algorithms: 10(12n1)lxX1y1,,ylF2n,ys(1)x1·y1(1)xl·yl|y1,y2,,yl|f(k,x1),,f(k,xl).{\left( {{1 \over {{2^{n - 1}}}}} \right)^l}\sum\limits_{\scriptstyle x \in {X_1} \atop \scriptstyle {y_1}, \cdots,{y_l} \in _2^n,y \bot s} {{{( - 1)}^{{x_1}\cdot{y_1}}}} \cdots {( - 1)^{{x_l}\cdot{y_l}}}\left| {{y_1},{y_2}, \cdots,{y_l}} \right\rangle \left| {f\left( {k',{x_1}} \right), \cdots,f\left( {k',{x_l}} \right)} \right\rangle.

Suppose that k is the correct key for the function f (k′, x).If k′ = k, the period s is not 0; if k′ ≠ k, the function f (k′, x) has no period. Then the initial state can be further written as 11|φ=12m(12n)lkF2m,kkx1,,xlFnny1,,ylF2n(1)x1·y1(1)xl·yl|y1,y2,,yl|f(k,x1),,f(k,xl)|k+12m(12n1)lx1,,xlX1y1,,yls,s0(1)x1·y1(1)xl·yl|y1,y2,yl|f(k,x1),,f(k,xl)|k.\matrix{ {|\varphi \rangle = {1 \over {\sqrt {{2^m}} }}{{\left( {{1 \over {{2^n}}}} \right)}^l}\sum\limits_{\scriptstyle k' \in _2^m,k' \ne k \atop {\scriptstyle {x_1}, \cdots,{x_l} \in _n^n \atop \scriptstyle {y_1}, \cdots,{y_l} \in _2^n}} {{{( - 1)}^{{x_1}\cdot{y_1}}}} \cdots {{( - 1)}^{{x_l}\cdot{y_l}}}\left| {{y_1},{y_2}, \cdots,{y_l}} \right\rangle \left| {f\left( {k',{x_1}} \right), \cdots,f\left( {k',{x_l}} \right)} \right\rangle \left| {k'} \right\rangle } \hfill \cr { + {1 \over {\sqrt {{2^m}} }}{{\left( {{1 \over {{2^{n - 1}}}}} \right)}^l}\sum\limits_{\scriptstyle {x_1}, \cdots,{x_l} \in {X_1} \atop \scriptstyle {y_1}, \cdots,{y_l} \bot s,s \ne 0} {{{( - 1)}^{{x_1}\cdot{y_1}}}} \cdots {{( - 1)}^{{x_l}\cdot{y_l}}}\left| {{y_1},{y_2} \cdots,{y_l}} \right\rangle \left| {f\left( {k,{x_1}} \right), \cdots,f\left( {k,{x_l}} \right)} \right\rangle |k\rangle.} \hfill \cr }

In the Grover-meets-Simon algorithm, the above process is equivalent to moving all the measurements of the parallel Simon’s algorithms during the iteration process to the end of the entire algorithm, satisfying the principle of deferred measurement.

Here, the quantum classifier Uf is defined as follows: Uf:F2m×(F2n)l{0,1} with (k,y1,,yl){0,1}.{U_f}:_2^m \times {\left( {_2^n} \right)^l} \to \{ 0,1\} {\rm{ }}with{\rm{ }}\left( {k',{y_1}, \cdots,{y_l}} \right) \to \{ 0,1\}.

  • (1)

    If dim(y1, y2, ⋯, yl) = n ≠ 1, the output will be 0. Otherwise compute a basis of |y1, y2, ⋯, yl〉 by applying the generalized QGJE and the unique vector k1F2n\{0}k_1^\prime \in _2^n\backslash \{ {\bf{0}}\} orthogonal to y.

  • (2)

    Check (k,k1)=?(k,k1)\left( {{k^\prime },k_1^\prime } \right)\mathop = \limits^? \left( {k,{k_1}} \right) for arbitrary provided plaintext pairs (mi,mi)RF2n\left( {{m_i},m_i^\prime } \right){ \in _R}_2^n. If all identities hold, the output will be 1, otherwise it will be 0.

Therefore, the operator Uf can be defined like: 12|φ{ |φ, if Uf|φ=1|φ, if Uf|φ=0, \left| {\varphi '} \right\rangle \to \left\{ {\matrix{ { - \left| {\varphi '} \right\rangle,{\rm{ }}if{\rm{ }}{U_f}\left| {\varphi '} \right\rangle = 1} \cr {\left| {\varphi '} \right\rangle,{\rm{ }}if{\rm{ }}{U_f}\left| {\varphi '} \right\rangle = 0,} \cr } } \right. where |φ′〉 is the component of the superposition state |φ〉.

From Formula (11), we know that the initial state of the Grover-meets-Simon algorithm is not a uniform superposition and there is an amplitude of oscillation due to the entanglement between the key space |k′〉 and Simon’s registers |y1, ⋯, yl). Specifically, amplitudes for k′ = k (correct key) scale as 1/2(m+2(n–1)l)/2, while others scale as 1/2(m+2nl)/2, creating an oscillating imbalance.

In [39], Biron et al. discussed the maximum success probability and the optimal number of iterations of Grover’s algorithm in an arbitrary initial state. They depend only on the standard deviation of the initial amplitude distributions of the marked or unmarked states. Hence, we can provide a tight bound of the generalized success probability of the Grover-meets-Simon algorithm based on the initial amplitude from a novel perspective without considering quantum input length.

Biron et al. [39] obtained first-order linear difference equations for the time evolution of the amplitudes of r marked states and Nr unmarked states and solved them exactly. The results of the maximum success probability and the optimal number of iterations are summarized in the following theorem.

Theorem 4 ([39]).

Suppose that the number of correct solutions is r and the size of the database searched is N. When r / N ≪ 1, the optimal number of iterations T of the search and the success probability of these marked states in the measurement at time t at the end satisfy T=12k(0)¯l(0)¯+π4N/rπ24r/N+O(r/N),P(t)=Pmax(Nr)|l(0)¯|2,Pmax=1(Nr)σl2,\matrix{ T & { = - {1 \over 2}{{\overline {k(0)} } \over {\overline {l(0)} }} + {\pi \over 4}\sqrt {N/r} - {\pi \over {24}}\sqrt {r/N} + {\cal O}(r/N),} \cr {P(t)} & { = {P_{max}} - (N - r)|\overline {l(0)} {|^2},{P_{max}} = 1 - (N - r)\sigma _l^2,} \cr } where k(0)¯\overline {k(0)} represents the average of the initial amplitude of the marked states (i.e., correct solutions), l(0)¯\overline {l(0)} represents the average of the initial amplitude of the unmarked states, σl2\sigma _l^2 is the variance of the initial amplitude of the unmarked states, and Pmax is a time-independent quantity that serves as a tight bound on the success probability.

As shown in Formula (11), when k′ is the correct key k, the matrices generated by them contain cases with rank less than or equal to n – 1. We can calculate the number of marked correct solutions r (matrices with rank-(n – 1)) according to Lemma 2. For l parallel instances of Simon’s algorithm, the size of the overall state space is 22(n–1)l.

Then, we discuss the initial success probability based on the initial amplitudes. According to the calculation method of the maximum success probability in [39,40], we can get that the maximum success probability in the initial state is Pmax=1(Nr)σl2,{P_{max}} = 1 - (N - r)\sigma _l^2,, where the variance σl2=1Nri=1Nr| li(0)l(0)¯ |2=1Nri(li(0))2(1Nrili(0))2\sigma _l^2 = {1 \over {N - r}}\sum\nolimits_{i = 1}^{N - r} {{{\left| {{l_i}(0) - \overline {l(0)} } \right|}^2}} = {1 \over {N - r}}\sum\limits_i {{{\left( {{l_i}(0)} \right)}^2}} - {\left( {{1 \over {N - r}}\sum\limits_i {{l_i}} (0)} \right)^2}. From Formula (11), we can know that li(0)2={ 12m(122nl),kk12m(122(n1)l),k=k. {l_i}{(0)^2} = \left\{ {\matrix{ {{1 \over {{2^m}}}\left( {{1 \over {{2^{2nl}}}}} \right),\quad k' \ne k} \hfill \cr {{1 \over {{2^m}}}\left( {{1 \over {{2^{2(n - 1)l}}}}} \right),\quad k' = k.} \hfill \cr } } \right.

Note that k′ = k but dim(span(y1, y2, ⋯, yl)) < n – 1 are unmarked states. In unmarked states, when k′ ≠ k, the number is (2m – 1)22nl and when k′ = k, the number is 22(n–1)lr. Hence, we can get 13i(li(0))2=(2m1)22nl2m22nl+22(n1)lr2m22(n1)l)=1r2m22(n1)l).\sum\limits_i {{{\left( {{l_i}(0)} \right)}^2}} = {{\left( {{2^m} - 1} \right){2^{2nl}}} \over {{2^m}{2^{2nl}}}} + {{{2^{2(n - 1)l}} - r} \over {{2^m}{2^{2(n - 1)l)}}}} = 1 - {r \over {{2^m}{2^{2(n - 1)l)}}}}.

Then, we show ili(0)=k=k,dim(span(y1,,yl))<n1li(0)+kkli(0)\sum\nolimits_i {{l_i}} (0) = {\sum _{k' = k}}, where k=kdim(span(y1,,yl))<n1li(0)=12m(12n1)lx1,,xlX1dim(span(y1,,yl))<n1(1)x1·y1(1)xl·yl\left. {\left( {{y_1}, \cdots,{y_l}} \right)} \right) < n - {1^{{l_i}}}(0) + \sum\nolimits_{k' \ne k} {{l_i}} (0) and kkli(0)=12m(12n1)lx1,,xlFnny1,,ylF2n(1)x1·y1(1)xl·yl.\sum\limits_{\scriptstyle k' = k \atop \scriptstyle \dim \left( {{\mathop{\rm span}\nolimits} \left( {{y_1}, \cdots,{y_l}} \right)} \right) < n - 1} {{l_i}} (0) = {1 \over {\sqrt {{2^m}} }}{\left( {{1 \over {{2^{n - 1}}}}} \right)^l}\sum\limits_{\scriptstyle {x_1}, \cdots,{x_l} \in {X_1} \atop \scriptstyle \dim \left( {{\mathop{\rm span}\nolimits} \left( {{y_1}, \cdots,{y_l}} \right)} \right) < n - 1} {{{( - 1)}^{{x_1}\cdot{y_1}}}} \cdots {( - 1)^{{x_l}\cdot{y_l}}}

When computing the value of ili(0)\sum\limits_{\scriptstyle {x_1}, \cdots,{x_1} \in _2^n \atop \scriptstyle {y_1}, \cdots,{y_l} \in _2^n} {{{( - 1)}^{{x_1}\cdot{y_1}}}} \cdots {( - 1)^{{x_l}\cdot{y_l}}}, we need to get the value of x1,,x1F2ny1,,ylF2n(1)x1·y1(1)xl·yl\sum\limits_{x \in _2^n} {{{( - 1)}^{x\cdoty}}} = \sum\limits_{x \in {X_1}} {{{( - 1)}^{x\cdoty}}} + \sum\limits_{x \oplus s \in _2^n/{X_1}} {{{( - 1)}^{(x \oplus s)\cdoty}}} = \left\{ {\matrix{ {0,} \hfill & {y \ne 0} \hfill \cr {{2^n},} \hfill & {y = 0.} \hfill \cr } } \right.. According to theorem in [35], we know that xF2n(1)x·y=xX1(1)x·y+xsF2n/X1(1)(xs)·y={ 0,y02n,y=0. \sum\nolimits_{x \in _2^n} {{{( - 1)}^{x\cdoty}}} = 2\sum\nolimits_{x \in {X_1}} {{{( - 1)}^{x\cdoty}}}

Because of ys, we can get xF2n(1)x·y=2xX1(1)x·y\sum\nolimits_{x \in _2^n} {{{( - 1)}^{x\cdoty}}} = 2\sum\nolimits_{x \in {X_1}} {{{( - 1)}^{x\cdoty}}} . Thus, we can get 14xX1(1)x·y={ 0,y02n1,y=0. \sum\limits_{x \in {X_1}} {{{( - 1)}^{x\cdoty}}} = \left\{ {\matrix{ {0,y \ne 0} \hfill \cr {{2^{n - 1}},y = 0.} \hfill \cr } } \right.

According to the implementation of Uf, we know that xX1, only when y1, y2, ⋯, yl are all 0, the value of k=k,dim(span(y1,,yl))<n1li(0)0{\sum _{k' = k,\dim \left( {{\mathop{\rm span}\nolimits} \left( {{y_1}, \cdots,{y_l}} \right)} \right) < n - 1}}{l_i}(0) \ne 0; otherwise, it is 0. Likewise, kkli(0)\sum\nolimits_{k' \ne k} {{l_i}} (0) is the same. According to Formula (14), k=k,dim(span(y1,,yl))<n1li(0)=2(n1)l2m2(n1)l\sum\nolimits_{k' = k,\dim \left( {{\mathop{\rm span}\nolimits} \left( {{y_1}, \cdots,{y_l}} \right)} \right) < n - 1} {{l_i}(0) = {{{2^{(n - 1)l}}} \over {\sqrt {{2^m}} {2^{(n - 1)l}}}}} and kkli(0)=(2m1)2nl2m2nl\sum\nolimits_{k' \ne k} {{l_i}} (0) = {{\left( {{2^m} - 1} \right){2^{nl}}} \over {\sqrt {{2^m}} {2^{nl}}}}. Hence, 15(1Nrili(0))2=(1Nr((2m1)2nl2m2nl+2(n1)l2m2(n1)l))2=2m(Nr)2.{\left( {{1 \over {N - r}}\sum\limits_i {{l_i}} (0)} \right)^2} = {\left( {{1 \over {N - r}}\left( {{{\left( {{2^m} - 1} \right){2^{nl}}} \over {\sqrt {{2^m}} {2^{nl}}}} + {{{2^{(n - 1)l}}} \over {\sqrt {{2^m}} {2^{(n - 1)l}}}}} \right)} \right)^2} = {{{2^m}} \over {{{(N - r)}^2}}}.

By calculation, we can get the time-independent quantity Pmax and the initial success probability P(0) based on the initial amplitudes as follows: 16Pmax=1(Nr)σl2=r2m22(n1)l+2mNr,{P_{max}} = 1 - (N - r)\sigma _l^2 = {r \over {{2^m}{2^{2(n - 1)l}}}} + {{{2^m}} \over {N - r}}, 17P(0)=Pmax(Nr)|l(0)¯|2=r2m22(n1)l.P(0) = {P_{max}} - (N - r)|\overline {l(0)} {|^2} = {r \over {{2^m}{2^{2(n - 1)l}}}}.

Remark 2.

When dim(spa(y1, ⋯, yl)) = n – 1, the vector (y1, ⋯, yl) is not the all-zero vector. It follows from Formula (14) that k=k,dim(span(y1,,yl))=n1ki(0)=0\sum\nolimits_{k' = k,\dim \left( {{\mathop{\rm span}\nolimits} \left( {{y_1}, \cdots,{y_l}} \right)} \right) = n - 1} {{k_i}(0) = 0} , and thus the initial average amplitude of the marked states k(0)¯=0\overline {k(0)} = 0. Therefore, the optimal number T= π4N/r T = \left\lfloor {{\pi \over 4}\sqrt {N/r} } \right\rfloor of iterations has nothing to do with the initial state.

The size of the database searched is N = (2m – 1)22nl + 22(n–1)l. The number of marked correct solutions is r = 2(n–1)lP = Ω(2(n–1)(2l–1)), where the scaling behavior of P is given in Formula (7). According to Theorem 4, we can compute the optimal number of iterations as follows: 18T= π4N/r ~𝒪(N/r)=𝒪(2m+n+2l2).T = \left\lfloor {{\pi \over 4}\sqrt {N/r} } \right\rfloor \~{\cal O}(\sqrt {N/r} ) = {\cal O}\left( {{2^{{{m + n + 2l} \over 2}}}} \right).

The initial angle θ=arcsin(P(0))P(0)\theta = \arcsin (\sqrt {P(0)} ) \approx \sqrt {P(0)} for small values of P(0), where P(0)=r2m22(n1)lP(0) = {r \over {{2^m}{2^{2(n - 1)l}}}}. Each iteration of Grover’s algorithm increases the angle by 2θ, reaching (2T + 1)θ after T iterations. Therefore, the generalized success probability is 19psuccess=sin2((2T+1)θ)Θ(1).{p_{success}} = {\sin ^2}((2T + 1)\theta ) \approx \Theta (1).

Therefore, we can obtain (k,y1, ⋯, yl) with the probability of Θ(1), where dim(span(y1, ⋯, yl)) = n – 1, thereby recovering the keys k, k1.

When considering the amplitude of the initial state, the initial amplitude is not a uniform superposition state, and there is an oscillation in the amplitude. After analyzing the Grover-meets-Simon algorithm in detail, we know that the Grover-meets-Simon algorithm is an effective algorithm to obtain the correct key with the generalized success probability close to 1 under deferred measurement when moving the measurement of all parallel Simon’s algorithms during the iterative process to the end of the entire algorithm. Specifically, we provide a generalized success probability of the Grover-meets-Simon algorithm, which is independent of the length of the key of the block cipher and the number of parallel Simon’s algorithms. The advantage of the above analysis is that the generalized success probability in any different cases can be calculated without relying on assumptions about the number of plaintext pairs in the classifier or the number of parallel Simon’s algorithms.

4.2.
Generalized Success Probability of Alg-PolyQ2

Bonnetain et al. [34] proposed a new algorithm that also uses a combination of Grover’s algorithm and Simon’s algorithm for solving the asymmetric search problem of a period. This method can also be applied to the FX construction and can exponentially reduce query complexity. However, they do not provide a tight analysis of the generalized success probability of this algorithm.

Asymmetric Search of a Period. There are two functions F : {0,1}m × {0,1}n → {0,1}n and g : {0,1}n → {0,1}n. F is a family of functions and can be written F(i, ·) = fi(). There exists a unique i0 ∈ {0,1}m such that x{ 0,1 }n,fi0(x)g(x)=fi0(xs)g(xs).\forall x \in {\{ 0,1\} ^n},{f_{{i_0}}}(x) \oplus g(x) = {f_{{i_0}}}(x \oplus s) \oplus g(x \oplus s)..

In the FX construction shown in Figure 3, g = Enc(i, x) is a secret key function that the adversary can query online to evaluate it, while fi(x) = E(i, x) is a function that the adversary can evaluate it offline. Then, the function fig has a period k1 if i = k, whereas it does not have any period if ik. Therefore, we can guess whether i is equal to the key k by testing whether fig has a period. The index i can be tested in superposition due to quantum queries to F and g. Thus, the uniform superposition over indices is created as follows: i{0,1}m|i|ψg\sum\limits_{i \in {{\{ 0,1\} }^m}} | \;i\rangle \otimes \left| {{\psi _g}} \right\rangle , where |ψg=l(x{0,1}n|x|g(x)).\left| {{\psi _g}} \right\rangle = \mathop \otimes \limits^l \left( {\sum\limits_{x \in {{\{ 0,1\} }^n}} | \;x\rangle |g(x)\rangle } \right).

Similar to the Grover-meets-Simon algorithm, the Alg-PolyQ2 algorithm is also a generalized Grover’s algorithm shown in Figure 2, where 𝒜 is l(≥ n) parallel Simon’s algorithms for solving the asymmetric search of a period, Uf is used to determine whether the rank is n by applying the generalized QGJE, and U0 changes the phase of the amplitude only for the zero state. Applying 𝒜 ⊗ I1 on |0〉m+2nl+1, the initial input state of Alg-PolyQ2 algorithm is 20|φ=12m(12n)li{0,1}mx1,,xlFnny1,,ylF2n|i(1)x1·y1(1)xl·yl|y1,,yl|(fig)(x1),,(fig)(xl)|b.|\varphi \rangle = {1 \over {\sqrt {{2^m}} }}{\left( {{1 \over {{2^n}}}} \right)^l}\sum\limits_{\scriptstyle i \in {\{ 0,1\} ^m} \atop {\scriptstyle {x_1}, \ldots,{x_l} \in _n^n \atop \scriptstyle {y_1}, \ldots,{y_l} \in _2^n}} | \;i\rangle {( - 1)^{{x_1}\cdot{y_1}}} \cdots {( - 1)^{{x_l}\cdot{y_l}}}\left| {{y_1}, \ldots,{y_l}} \right\rangle \otimes \left| {\left( {{f_i} \oplus g} \right)\left( {{x_1}} \right), \ldots,\left( {{f_i} \oplus g} \right)\left( {{x_l}} \right)} \right\rangle |b\rangle.

Suppose that k is the correct key for the function (fig)(x).If i = k, the period s is not 0; if ik, there may be values that are not actual non-zero periods t. For b ∈ {0,1}, compute |b ⊕ 1〉 if dim(span(y1, ⋯, yl)) < n; otherwise |b〉 if dim(span(y1, ⋯, yl)) = n. Then the initial state can be further written as 21|φ=α(iF2m,ikx1,,xlF2ny1,,ylF2n(1)x1·y1(1)xl·yl|y1,,yl|(fig)(x1),,(fig)(xl)|i|b)+β(x1,,xlX1y1,,yls,s0(1)x1·y1(1)xl·yl|y1,,yl|(fig)(x1),,(fig)(xl)|k|b1),\matrix{ {|\varphi \rangle = \alpha \left( {\sum\limits_{\scriptstyle i \in _2^m,i \ne k \atop {\scriptstyle {x_1}, \cdots,{x_l} \in _2^n \atop \scriptstyle {y_1}, \cdots,{y_l} \in _2^n}} {{{( - 1)}^{{x_1}\cdot{y_1}}}} \cdots {{( - 1)}^{{x_l}\cdot{y_l}}}\left| {{y_1}, \cdots,{y_l}} \right\rangle \left| {\left( {{f_i} \oplus g} \right)\left( {{x_1}} \right), \cdots,\left( {{f_i} \oplus g} \right)\left( {{x_l}} \right)} \right\rangle |i\rangle |b\rangle } \right)} \hfill \cr { + \beta \left( {\sum\limits_{\scriptstyle {x_1}, \cdots,{x_l} \in {X_1} \atop \scriptstyle {y_1}, \cdots,{y_l} \bot s,s \ne 0} {{{( - 1)}^{{x_1}\cdot{y_1}}}} \cdots {{( - 1)}^{{x_l}\cdot{y_l}}}\left| {{y_1}, \cdots,{y_l}} \right\rangle \left| {\left( {{f_i} \oplus g} \right)\left( {{x_1}} \right), \cdots,\left( {{f_i} \oplus g} \right)\left( {{x_l}} \right)} \right\rangle |k\rangle |b \oplus 1\rangle } \right),} \hfill \cr } where α=12m(12n)l\alpha = {1 \over {\sqrt {{2^m}} }}{\left( {{1 \over {{2^n}}}} \right)^l} and β=12m(12n1)l\beta = {1 \over {\sqrt {{2^m}} }}{\left( {{1 \over {{2^{n - 1}}}}} \right)^l}.

In the Alg-PolyQ2 algorithm, the above process also satisfies the principle of deferred measurement.

Here, the quantum oracle Uf is defined as follows: Uf:iF2m{0,1}.{U_f}:i \in _2^m \to \{ 0,1\}.

Once we have the superposition |ψg〉 and given a quantum oracle access to Uf, we can know if fig has a period or not without making new queries to g by the test oracle. This test oracle is a subroutine of the quantum oracle Uf. Next, the test oracle can be defined as follows:

|iψg|btest{ |iψg|b, if (fig) has no period|iψg|b1, if (fig) has a period. \left\langle {|i\rangle {\psi _g}} \right.|b\rangle \buildrel {{\bf{test}}} \over \longrightarrow \left\{ {\matrix{ {\left\langle {|i\rangle {\psi _g}} \right.|b\rangle,\quad {\rm{ }}if{\rm{ }}\left( {{f_i} \oplus g} \right){\rm{ has no period}}} \hfill \cr {\left\langle {|i\rangle {\psi _g}} \right.|b \oplus 1\rangle,{\rm{ }}if{\rm{ }}\left( {{f_i} \oplus g} \right){\rm{ has a period}}{\rm{.}}} \hfill \cr } } \right.

If we obtain |b⊕1〉 for b ∈ {0,1}, the output will be 1. Otherwise, the output will be 0. Therefore, the unitary operator Uf can be defined as in Formula (12). Note that even if fig has no period, it is not necessarily equal to |iψg〉|b〉 and Formula (3) holds when ik are almost random according to Theorem 1. However, we expect that test|iψg〉|b〉 = |iψg〉|b〉 + |δ〉 holds for small error |δ〉.

Next, we provide a tight analysis of the generalized success probability of the Alg-PolyQ2 algorithm. According to the above analysis, test|kψg〉|b〉 = |kψg〉|b ⊕ 1〉 always holds when i = k, showing that there must be a nonzero period in the case. Thus, dim(span(y1, y2, ⋯, yl)) < n always holds when i = k and (k, y1, y2, ⋯, yl) are marked states only in the case; all other states are unmarked states.

It follows from Formula (21) that there must be a non-zero period when i = k. As a result of executing the parallel Simon’s algorithms, the quantum states in the overall state space are marked states. Consequently, we have r = 22(n–1)l. From the perspective of the time evolution of the amplitude of the initial state, similar to the initial success probability analysis in the Grover-meets-Simon algorithm, the sum of the initial probability of the unmarked states is i(li(0))2=112m\sum\nolimits_i {{{\left( {{l_i}(0)} \right)}^2}} = 1 - {1 \over {{2^m}}} and the sum of their initial amplitude is ik(0)=(2m1)2nl2m2nl\sum\nolimits_{i \ne k} {(0) = {{\left( {{2^m} - 1} \right){2^{nl}}} \over {\sqrt {{2^m}} {2^{nl}}}}} . Thus, according to the definitions in Formulas (16) and (17), we obtain P(0)=12mP(0) = {1 \over {{2^m}}}. This verifies that this algorithm essentially applies Grover’s algorithm only on the index i. After an optimal number of iterations T=𝒪(N/r)=𝒪(2m+2l2)T = {\cal O}(\sqrt {N/r} ) = {\cal O}\left( {{2^{{{m + 2l} \over 2}}}} \right), the key k can be recovered with the probability of Θ(1). We will further interpret the results using joint and conditional probabilities in the following discussion.

Let this event i = k be represented as A and this event dim(span(y1, y2, ⋯, yl)) = n as B. We divide the discussion into three points as follows:

  • The event (i = k) ⋂ (dim(span(y1, y2, ⋯, yl)) < n) by applying Grover’s search can be represented as AB¯A \cap \bar B and its probability is Pr[AB¯]=Θ(1)Pr[A \cap \bar B] = \Theta (1) according to the above analysis. Due to the property of conditional probability Pr[AB¯]=Pr[B¯A]·Pr[A]Pr[A \cap \bar B] = Pr[\bar B\mid A]\cdotPr[A], then Pr[B¯A]=Pr[A]=Θ(1)Pr[\bar B\mid A] = \Pr [A] = \Theta (1). This again illustrates that Grover’s algorithm, as a subroutine of Alg-PolyQ2, is essentially just a search for index i with the probability of Θ(1).

  • The initial state can be written as ikαi|i|ψg|b+i=kβi|i|ψg|b\sum\nolimits_{i \ne k} {{\alpha _i}} |i\rangle \left| {{\psi _g}} \right\rangle |b\rangle + \sum\nolimits_{i = k} {{\beta _i}} |i\rangle \left| {{\psi _g}} \right\rangle |b\rangle , it changes to ikαi|i|ψg|b+i=kβi|i|ψg|b1\sum\nolimits_{i \ne k} {{\alpha _i}} |i\rangle \left| {{\psi _g}} \right\rangle |b\rangle + \sum\nolimits_{i = k} {{\beta _i}} |i\rangle \left| {{\psi _g}} \right\rangle |b \oplus 1\rangle after applying the test oracle. Due to Pr[B¯A]=Θ(1)Pr[\bar B\mid A] = \Theta (1) at point 1, then Pr[B|A] ≈ 0, showing that when i = k, fig have a non-zero period with the probability of Θ(1).

  • The event (ik) ⋂ (dim(span(y1, y2, ⋯, yl)) < n) by applying Grover’s search can be represented as A¯B¯\bar A \cap \bar B and its probability is Pr[A¯B¯]=Pr[B¯A¯]·Pr[A¯]Pr[\bar A \cap \bar B] = \Pr [\bar B\mid \bar A]\cdotPr[\bar A]. According to Lemma 1 in [34], δ2=Pr[B¯A¯]2n+1(1+p02)l\delta {^2} = Pr[\bar B\mid \bar A] \le {2^{n + 1}}{\left( {{{1 + {p_0}} \over 2}} \right)^l}, it follows that the probability of returning the incorrect period is far enough away from 1 by choosing l ≥ 3n/(1 – p0) according to Theorem 1. Due to Pr[A] = Θ(1) at point 1, hence Pr[A¯B¯]0Pr[\bar A \cap \bar B] \approx 0. Similarly, Pr[A¯B]0Pr[\bar A \cap B] \approx 0. Thus, Pr[A¯(BB¯)]0Pr[\bar A \cap (B \cup \bar B)] \approx 0. This shows that the event ik independent of this event that dim(span(y1, y2, ⋯, yl)) returns a certain answer.

The above analysis indicates that k can be searched and fig have a non-zero period with the probability of Θ(1) when i = k; otherwise (y1, y2, ⋯, yl) are almost random and return incorrect answers when ik. However, the ultimate goal of applying the Alg-PolyQ2 algorithm to the FX construction is to recover not only the key k but also the key k1. This algorithm indicates that, once k has been obtained, if the hidden shift is still required, one instance of Simon’s algorithm may be applied to obtain k1.

Let this event dim(span(y1, y2, ⋯, yl)) = n – 1 as B1¯\overline {{B_1}} and the event dim(span(y1, y2, ⋯, yl)) < n – 1 as B2¯(B¯=B1¯B2¯)\overline {{B_2}} \left( {\bar B = \overline {{B_1}} \cup \overline {{B_2}} } \right). Then Pr[B¯A]=Pr[ B1¯A ]+Pr[ B2¯A ]Pr[\bar B\mid A] = Pr\left[ {\overline {{B_1}} \mid A} \right] + Pr\left[ {\overline {{B_2}} \mid A} \right], where Pr[ B1¯A ]12n(1+p02)lPr\left[ {\overline {{B_1}} \mid A} \right] \ge 1 - {2^n}{\left( {{{1 + {p_0}} \over 2}} \right)^l} and Pr[ B2¯A ]2n(1+p02)lPr\left[ {\overline {{B_2}} \mid A} \right] \le {2^n}{\left( {{{1 + {p_0}} \over 2}} \right)^l} according to Theorem 1. This shows that the Alg-PolyQ2 is an effective algorithm that can solve the keys k, k1 with the probability of Θ(1).

5.
Discussion

When analyzing quantum algorithms related to cryptanalysis, it is crucial to evaluate their practical effectiveness in real-world quantum computing environments. While theoretical constructions often assume idealized quantum systems, practical quantum computing must cope with issues such as the complexity of quantum measurements. These practical issues are particularly prominent when considering combinations of different quantum algorithms—for example, when other quantum algorithms are embedded in Grover’s algorithm or when integrating multiple quantum subroutines into a composite algorithm.

We emphasize the role of measurement in such combinatorial algorithms. The interaction between Grover’s amplitude amplification and other quantum components introduces subtle constraints and design considerations. Specifically, we analyze existing algorithms, including the Grover-meets-Simon algorithm and the Alg-PolyQ2 algorithm, from the perspective of initial state success probability under deferred measurement. This provides a unified approach to understanding how to defer intermediate measurements, which is particularly important for preserving quantum superpositions between algorithmic modules. Our analysis highlights that deferred measurement is an important principle in quantum algorithm design.

This research inspires two promising directions. First, inspired by our analysis of the combination of Grover’s and Simon’s algorithms from a novel perspective, we believe that further investigation of the effectiveness of other quantum cryptanalysis techniques is warranted. Many classical cryptanalysis strategies (e.g., differential and linear cryptanalysis) have been partially applied to the quantum realm, but a comprehensive evaluation of them remains incomplete. By leveraging insights from deferred measurement and algorithm decomposition, we can better understand which classical strategies are amenable to efficient quantum implementations to analyze the security of key alternation ciphers against quantum-CPA attacks (quantum chosen-plaintext attack, where the adversary has superposition access to the encryption oracle). Second, our discussion of rank problems and linear algebraic structures focuses on quantum Gauss-Jordan elimination. Future research could revisit the basic assumptions behind the classical methods and explore whether similar algorithmic primitives can be constructed or optimized in a quantum setting. A deeper understanding of the structure and algebraic foundations of these problems will help develop more efficient and general quantum solvers.

6.
Conclusion

In this paper, we mainly study the Grover-meets-Simon and Alg-PolyQ2 Attacks via formalizing quantum ranksolving under deferred measurement in detail. First, we provide a formal analysis of the generalized quantum Gauss-Jordan elimination for the rank problem. In the formal description under deferred measurement, we discuss the situation of obtaining the reduced row echelon form matrix based on this method, including the form of the resulting quantum state and entanglement characteristics. Then, we apply it as a subroutine to the Grover-meets-Simon algorithm and the Alg-PolyQ2 algorithm, achieving full quantum treatment and ensuring its theoretical feasibility in a quantum environment.

In these two original algorithms, each Grover’s iteration involves the rank-solving process. The core of these two algorithms lies in the relationship between the two keys, that is, the periodic relationship. The output of multiple Simon’s registers is a superposition state of the matrix in the non-measurement state. If the measurement operation in Simon’s algorithm is considered, the search space will change due to collapse, which will affect the search of Grover’s algorithm. Based on the formal analysis of the generalized quantum Gauss-Jordan elimination, only the parallel Simon’s algorithms are considered, and their measurement can be postponed to the end according to the principle of deferred measurement. From a novel perspective without relying on assumptions about quantum input length, we analyze the tight bounds of the generalized success probability and the optimal number of iterations of the Grover-meets-Simon algorithm and the Alg-PolyQ2 algorithm in detail based on the initial state amplitude, showing that they are effective attack algorithms with the generalized success probability close to 1.

DOI: https://doi.org/10.2478/qic-2025-0024 | Journal eISSN: 3106-0544 | Journal ISSN: 1533-7146
Language: English
Page range: 421 - 437
Submitted on: Jul 24, 2025
|
Accepted on: Aug 18, 2025
|
Published on: Dec 31, 2025
In partnership with: Paradigm Publishing Services
Publication frequency: 1 issue per year

© 2025 Qiqing Xia, Qianru Zhu, Huiqin Xie, Li Yang, published by Cerebration Science Publishing Co., Limited
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License.