Abstract
Recent rank-based attacks have reduced the security of Rainbow, which is one of the multi-layer UOV signatures, below the NIST security requirements by speeding up iterative kernel-finding operations using classical mathematics techniques. If quantum algorithms are applied to perform these iterative operations, the rank-based attacks may be more threatening to multi-layer UOV, including Rainbow. In this paper, we propose a quantum rectangular MinRank attack called the Q-rMinRank attack, the first quantum approach to key recovery attacks on multi-layer UOV signatures. Our attack is a general model applicable to multi-layer UOV signature schemes, and in this paper, we provide examples of its application to Rainbow and the Korean TTA standard, HiMQ. We design two quantum oracle circuits to find the kernel in consideration of the depth-width trade-off of quantum circuits. One is to reduce the width of the quantum circuits using qubits as a minimum, and the other is to reduce the depth using parallelization instead of using a lot of qubits. By designing quantum circuits to find kernels with fewer quantum resources and complexity by adding mathematical techniques, we achieve quadratic speedup for the MinRank attack to recover the private keys of multi-layer UOV signatures. We also estimate quantum resources for the designed quantum circuits and analyze quantum complexity based on them. The width-optimized circuit recovers the private keys of Rainbow parameter set V with only 1089 logical qubits. The depth-optimized circuit recovers the private keys of Rainbow parameter set V with a quantum complexity of , which is lower than the complexity of recovering the secret key of AES-192, which provides the same security level as parameter set III.
Subject terms: Quantum information, Information technology
Introduction
Due to recent advances in the development of quantum computers, such as Google’s 53-qubit quantum processor “Sycamore”1 and IBM’s 127-qubit quantum processor “Eagle”2, the National Institute of Standards and Technology (NIST) estimates that quantum computers will be capable of breaking 2048-bit RSA as early as 2026. This is because 4096 qubits in a quantum computing environment using Shor’s quantum algorithm3 are enough to break 2048-bit RSA4. The possibility that current public-key cryptographic algorithms such as RSA and ECDSA will be broken in a quantum computing environment has led NIST to conduct a Post-Quantum Cryptography (PQC) standardization project. To be securely used in quantum computing environments, the PQC candidates must meet the security requirements set out by NIST, from 128-bit security for Level I to 256-bit security for Level V.
Among the PQC candidates for the NIST standardization project, Multivariate Quadratic (MQ)-based signature schemes are expected to be highly utilized in IoT devices with limited resources due to the advantages of short signature length as well as fast signature generation and verification speed5. One of the prominent MQ-based signature schemes widely studied is the Unbalanced Oil and Vinegar (UOV) signature, known for its simplicity and security. Since the UOV signature is constructed as a single-layer structure, which generates signatures by finding solutions for all oil variables in the MQ system at once, the signature generation is somewhat slow. To improve performance speeds, multi-layer UOV signature schemes have been proposed, where the oil variables of the MQ system are divided into layers. The multi-layer UOV signatures improve the signature generation speed by finding solutions for fewer oil variables in each layer. One such scheme is Rainbow, proposed by Jintai Ding6. It had been considered one of the NIST PQC standardization finalists until recently. In Korea, HiMQ, a multi-layer UOV signature, was standardized by the Korean Telecommunications Technology Association (TTA) in 20207. HiMQ utilizes a sparse central map to achieve a small private key size and fast signature generation.
The security of prominent MQ-based signatures, such as UOV, mainly relies on the hardness of the MQ problem and the Extended Isomorphism of Polynomials (EIP) problem. Among them, multi-layer UOV signatures require the additional hardness of the MinRank problem to ensure security. The existential unforgeability of multi-layer UOV signatures is based on the intractability of the MQ problem (solving multivariate systems of quadratic equations). The difficulty of recovering private keys from the public keys of multi-layer UOV signatures depends on the difficulties of the EIP and the MinRank (finding a non-zero k-tuple such that the rank of a linear combination of some matrices is less than some small rank) problems. Thus, signature forgery attacks and key recovery attacks on multi-layer UOV signatures have attempted to solve these underlying problems.
So far, there have been several attempts to forge multi-layer UOV signatures, especially the Rainbow signature scheme, by trying to solve the MQ problem using mathematical techniques such as XL8 and Grbner Basis algorithms9, but they have not been successful. Since Olivier Billet et al. proposed a MinRank attack algorithm to recover private keys from the public keys of Rainbow in 200610, key recovery attacks such as the MinRank attack have become a potential threat to Rainbow. In 2020, Bardet et al. reduced the complexity of the MinRank attacks on Rainbow to of the existing MinRank attacks in parameter sets III and V of Rainbow11. However, the attack proposed by Bardet et al. did not even threaten the parameter sets submitted for the second round of the NIST PQC project.
In 2021, Ward Beullens proposed a rectangular MinRank attack12. He converted the public keys of Rainbow to polar forms and reduced the size of the input matrices of the MinRank attack using the polar forms. Then, he recovered the private keys of Rainbow using the Support Minors Modeling algorithm11. This attack reduced the security level of parameter sets I, III, and V of Rainbow to 127-bit, 177-bit, and 226-bit security levels, respectively. In 2022, Ward Beullens proposed two new key recovery attacks (a simple attack and a combined attack) against Rainbow, further reducing the security level of Rainbow13. He reduced the complexity of the MinRank attack by suggesting a method to guess the kernel with a high probability in a simple attack. They also reduced the attack complexity for parameter sets III and V by combining a rectangular MinRank attack12 with a simple attack. Moreover, he reduced the security level of parameter sets I, III, and V of Rainbow to 69-bit, 160-bit, and 257-bit security levels in their simple attack and 99-bit, 157-bit, and 206-bit security levels in their combined attack, respectively. Parameter set I of Rainbow does not fall short of the minimum security requirement, the 128-bit security level, against such key recovery attacks. However, parameter sets III and V of Rainbow still satisfy the 128-bit (I) and 196-bit (III) security levels set by NIST, even against the most threatening key recovery attack proposed by Ward Beullens12,13.
The cost of iterative operations to find a kernel dominates the complexity of rank-based attacks against multi-layer UOV signatures. Until now, classical key recovery attacks10–13 have improved attack complexity by using mathematical techniques such as the Support Minors Modeling algorithm11 and the Wiedemann algorithm14 to find the kernel quickly. If quantum properties such as superposition to find the kernel are utilized, we could achieve speed-ups in kernel search. The Rainbow team evaluated the security level of Rainbow against Grover’s algorithm-based quantum attacks by simple numerical calculation (). They did not show any concrete oracle circuits for the quantum attacks. For accurate quantum complexity estimation, it is necessary to present Grover oracle quantum circuits and estimate their quantum resources.
We present complete Grover oracle circuits, called Q-rMinRank-Grover, for quantum key recovery attacks on multi-layer UOV signatures for the first time. In contrast to the Rainbow team’s quantum analysis approach, we obtained precise and reliable estimates of the quantum resources required to compute these kernel searching operations using our Grover oracle circuits, called Q-rMinRank_Oracle. We achieved speed-ups in kernel search by combining quantum properties and classical techniques for the MinRank attack. Moreover, we reduced the size of the quantum search domain through the polar form conversion of the public key matrix to rectangular forms.
To design the quantum circuit, Q-rMinRank_Oracles, we reflect the depth-width trade-off considering the Quantum Volume (QV). The QV is a benchmark measure to quantify the capability of Noisy Intermediate-Scale Quantum (NISQ) devices. The QV measures the performance of a quantum circuit by considering the width and depth of a quantum circuit15. The width of a quantum circuit represents the number of qubits used, and the depth describes the number of layers composed of quantum gates that are executed simultaneously in parallel. A quantum circuit with a small width means using less memory on a quantum computer, and a short depth ensures a fast running time. The depth of a quantum circuit is essential for NIST’s quantum complexity analysis. NIST defines metrics reflecting a variety of predictions about the development of quantum computing technology to evaluate security against such quantum attacks16. The metrics are based on an approach that restricts quantum attacks to a fixed running time or circuit depth. Therefore, we design the Q-rMinRank_Oracles in two ways considering these depth-width trade-offs. The first is a depth-optimized oracle , and the second is a width-optimized oracle . In environments where fast running time is important, the quantum circuit can be constructed with . In environments where the number of available qubits is small, the circuit can be constructed with .
We also estimate the quantum resources of the Q-rMinRank-Grover. The quantum circuits consisting of require 1097, 5757, and 8057 logical qubits for key recovery of Rainbow’s parameter sets I, III, and V, respectively, and 3662, 6459, and 7036 logical qubits for key recovery of HiMQ’s parameter sets HiMQ-128, HiMQ-160, and HiMQ-192, respectively. And the quantum circuits consisting of require 289, 833, and 1089 logical qubits for key recovery of Rainbow’s parameter sets I, III, and V, respectively, and 665, 1121, and 1312 logical qubits for key recovery of HiMQ’s parameter sets HiMQ-128, HiMQ-160, and HiMQ-192, respectively. Based on the quantum resource estimations, we analyze the complexity of the Q-rMinRank-Grover based on NIST’s quantum complexity estimation. In the submission requirements document for the PQC standardization project in 201616, NIST specified the quantum complexity criteria that PQCs must meet, based on the quantum resource estimates of Grover’s algorithm for AES key recovery by M. Grassl et al17. This criterion was revised in 2022 for the additional digital signature standardization project18 to reflect the quantum resource estimates of the improved Grover’s algorithm by S. Jaques et al. in 202019. NIST notes that the quantum complexities of , , and correspond to PQC security levels I, III, and V, respectively. The quantum complexity for key recovery of Rainbow parameter set V is , which is lower than the complexity of quantum key search attacks on AES-192 presented by NIST (), and the quantum complexity for parameter set III is , which is close to the quantum complexity for AES-128 (). Inevitably, the quantum complexity for parameter set I () is far below the quantum complexity for AES-128. While the existing classical attacks on Rainbow only succeed up to parameter set I (reducing the security level of parameter set III from 192 to 157, but still considerably larger than 128), our Q-rMinRank attacks can succeed up to parameter set III if more efficient quantum arithmetic circuits are available in the future. For the key recovery of HiMQ, the quantum complexity of our Q-rMinRank attack on parameter set HiMQ-128 is around , which does not satisfy NIST’s security level I. The remaining parameter sets (HiMQ-160 and HiMQ-192) do not satisfy NIST’s security level III. To verify the feasibility of our oracle, we implemented the quantum circuit designed for a toy example of Rainbow with the quantum simulators Qiskit20 and ProjectQ21.
The remaining paper is organized as follows: The “Preliminaries” section provides preliminary information of the elementary quantum gates, the Rainbow signature scheme, the MinRank attack, and Grover’s algorithm22. In the “Quantum rectangular MinRank attack” section, we present a quantum rectangular MinRank attack. The design methods of oracle circuits for the quantum rectangular MinRank attack are shown in the “Oracle circuit designs” section. In the ”Complexity analysis” section, we evaluate the security level of the Rainbow scheme against the Q-rMinRank attack and estimate the quantum resources required for the Q-rMinRank-Grover and quantum complexities. Finally, we show the quantum simulation result in the “Quantum simulation result” section. For the sake of convenience in the explanation, in the “Quantum rectangular MinRank attack” and “Oracle circuit designs” sections, we describe our attack method based on Rainbow. Our attack and analysis of HiMQ are detailed in the Supplementary Material as an appendix.
Preliminaries
We introduce the elementary quantum gates of quantum circuits, the Rainbow signature scheme, and Grover’s quantum algorithm in this section.
Elementary quantum gates
NOT gate
The quantum gate is also called a gate. The quantum gate flips the quantum state to and to as shown in Fig. 1.
Figure 1.

The quantum gate.
CNOT gate
The quantum - () gate takes in two qubits, and , and outputs and as shown in Fig. 2. In quantum circuits, gates are used for XOR (addition over modulo 2) operations.
Figure 2.

The quantum gate.
CN-NOT gate
Gate The quantum -- () gate, also called a gate, has two control qubits and one target qubit as inputs. The gate flips the target qubit only when the two control qubits and are both in state , i.e. the state of the target qubit is . gates are often used in quantum circuits for bitwise multiplication Fig. 3.
- Gate The - gate in Fig. 4 reverses qubit z when N control qubits are all 1. That is, when qubits , , ... , , and z are input to this - gate, the result of this - gate is , , ... , , and . The - gate consists of gates, and there are two methods to implement the - gate23. The first implementation method, named , has a small depth but many ancilla qubits, while the second implementation method, named -, has a large depth but only one ancilla qubit. Figure 5a and b show the circuits of - and - when , respectively. Table 1 shows the number of gates, depth, and ancillary qubits required to implement the - gate.
Figure 3.

The quantum gate.
Figure 4.

The quantum - gate.
Figure 5.
The examples of - decomposition ().
Table 1.
resources to impelment - gate combining gates.
| Implementation methods | #Toffoli | #TD | #AQB |
|---|---|---|---|
| - | |||
| - | 1 |
#Toffoli: The number of Toffoli gates
#TD: The depth of Toffoli gates
#AQB: The number of ancilla qubits.
Quantum adder and multiplier over
The addition on the finite field consists of bitwise XOR operations. So, the quantum adder over , named , is simply implemented with only the gates, as shown in Fig. 6. The quantum adder over requires n gates with depth one.
Figure 6.

The quantum adder over ( gate).
Since multiplication requires a reduction step, how efficiently reduction is calculated when implementing it as a quantum circuit is important. In 2020, Cho et al. proposed efficient quantum multipliers over and , as shown in Fig. 724. They reduced the number of quantum gates and depth by half. In 2022, Jang et al. proposed quantum multipliers with Toffoli depth one, as shown in Fig. 825. They iterated the Karatsuba multiplication method and reduced the depth to one by adding ancilla qubits. A quantum-classical version of the multiplier of Jang et al.25 has depth one of the gate. Table 2 shows the quantum resources for two quantum multipliers24,25.
Figure 7.
The quantum multiplier over ( gate) proposed by Cho et al.24.
Figure 8.
The quantum multiplier over ( gate) proposed by Jang et al.25.
Table 2.
Quantum resources of quantum multipliers .
Rainbow signature scheme
Rainbow, proposed by Jintai Ding6, was the only MQ-based cryptography candidate for the third round of the NIST Post Quantum Cryptography (PQC) standardization project. Rainbow’s layered structure has a relatively short signature length compared to other NIST PQC standardization candidates and enables efficient signature generation and verification. In this section, we describe the key generation, signature generation, and signature verification algorithms of Rainbow.
- Parameters
- a finite field with q elements,
- index sets (). Note that each is contained in exactly one of the sets .
- we have and set ()
- the number of equations: ()
- the number of variables:
- Key generation
- Private Key The private key of Rainbow consists of two affine maps and , and the central map . The central map F consists of two layers, as shown in Fig. 9. The central map of the first layer consists of multivariate equations , and the central map of the second layer consists of multivariate equations . When and l is the number of layers, is as follows:
1 - Public Key The public key P of Rainbow is the composition of the private keys S, F, and T.
2
- Signature generation Given a message d to be signed and a hash function , the signature generation process is as follows:
- Compute the hash value
- Compute
- Find y that satisfies
- Compute the signature
- Signature verification Given a message d and a signature z, the signature verification process is as follows:
- Compute the hash value
- Compute the
- If , the signature z is verified
Figure 9.
The configuration of the central map F.
MinRank attack
The MinRank problem asks to find coefficients (), not all zero, such that the linear combination has rank at most r, given m matrices with n rows and n columns and a target rank r. The MinRank attack is the most efficient attack for recovering the private key of Rainbow by solving the MinRank problem. The underlying idea in solving the MinRank problem is to search for a vector lying in the kernel of the desired linear combination Q10. So, the MinRank attack’s complexity is dominated by finding the kernel vector. In the case of the MinRank attack on Rainbow, it attempts to find the central map F of Rainbow by solving the MinRank problem. In the Rainbow scheme, a linear combination of public keys with rank corresponds to a linear combination of central maps in the first layer. By finding linear combinations, the central maps of the first layer can be reconstructed, thereby finding the private keys of Rainbow. Here, is the number of vinegar variables in the second layer , and is the number of oil variables in the first layer. Algorithm 1 shows the overall process of the MinRank attack on Rainbow10.
Algorithm 1.
The MinRank attack.
As in line 2 of Algorithm 1, a linear combination Q is computed for a random vector such that the rank of P is greater than 1 and less than n. The probability of finding such a vector is 1/q, which makes the kernel vector non-trivial. The central maps of the first layer have non-zero entries at the first part, part, and part. Other parts are all zero. So the kernel vectors have only non-zero entries, so the central maps multiplied by the kernel vector become vectors whose last entries are zero, as shown in Fig. 10. Then, we must find the remaining first entries to be zero. The probability is close to . Consequently, finding a kernel vector as shown in line 4 of Algorithm 1 takes . Because the kernel should be non-trivial, a probability 1/q that the kernel is non-trivial should be considered additionally.
Figure 10.

The form of kernel vectors to reduce the complexity of searching kernel.
This process is repeated times to recover central maps. Considering all these steps, the complexity of fully recovering the first layer’s central map of Rainbow is . After recovering the first layer of Rainbow, an additional complexity of is required to recover the second layer, which is negligible compared to the complexity of recovering the first layer10. Finally, the complexity of the MinRank attack on Rainbow10 is . A more detailed complexity analysis can be found in10. In this attack, it takes complexity to find a kernel of P (Ker(Q) in Algorithm 1). The complexity of finding a kernel in the parameter sets of the third round Rainbow is in parameter set I, in parameter set III, and in parameter set V.
Grover’s algorithm
An unstructured search problem is to find a solution in a set such that when a boolean function is given. It takes O(N) complexity to solve the unstructured search problem on classical computers. Grover’s algorithm (see Algorithm 2)22 enables unstructured search problems to be solved with complexity using quantum properties such as a superposition. Figure 11 shows the entire circuit of Grover’s algorithm. The circuit of Grover’s algorithm consists of a NOT gate (), gates (), oracle gates (), and diffusion operators (D).
Figure 11.

The entire circuit of the Grover’s algorithm.
Algorithm 2.
The Grover’s algorithm.
When the size of the data space is , an n-qubit register is prepared. After the gates, the state of is converted to the superposition state . The oracle gate converts the state of to , reversing only the amplitude of the solution . So, the oracle gate should be designed to find a solution to the problem that we want to solve. Then, the diffusion operator reverses the amplitude of for the mean of the amplitude of all states. As a result, the oracle gate and the diffusion operator only increase the probability that is measured. To greatly increase the probability that a solution will be measured, Grover’s algorithm proceeds iteratively using the oracle gate and Grover diffusion operator D. The number of iterations, , can be selected in two ways26. First, if the is , the probability of measuring a solution exceeds when operating the whole Grover’s algorithm more than 110 times. Secondly, the solution will be measured with a high probability when the is . In this paper, we iterate the Grover oracle and diffusion gate pair times to measure the solution at once.
Quantum rectangular MinRank attack
In this section, we propose a quantum rectangular MinRank attack, called a Q-rMinRank attack, the first quantum approach for a key recovery attack on Rainbow. The Q-rMinRank attack consists of three main steps: preprocessing, quantum kernel extraction, and key recovery, as shown in Fig. 12. The preprocessing step performs mathematical operations that convert the public keys of Rainbow into a single matrix in a classical computing environment. Then, the quantum kernel extraction step finds the kernel of the converted matrix using our Q-rMinRank-Grover algorithm in a quantum computing environment. Finally, the private keys are recovered by constructing a linear combination of the public keys using the kernel in the Key Recovery step.
Figure 12.
The conceptual diagram of our Q-rMinRank attack.
The Q-rMinRank-Grover is designed to speed up the kernel search, the most complicated and time-consuming iterative operation in MinRank attacks. Since Grover’s quantum search algorithm is capable of searching in superposition states, our Q-rMinRank attack finds kernels much faster. The overall process of the Q-rMinRank attack is shown in Algorithm 3.
Algorithm 3.
The Q-rMinRank attack.
The Preprocessing Step
Rainbow has m public key matrices with n rows and n columns. In the preprocessing step, the public keys are converted to polar form. The polar form12 of the multivariate quadratic polynomial p(x) is defined as
| 3 |
For a multivariate quadratic map , its polar form is also defined as
| 4 |
After the polar form conversion of public keys, new matrices are composed as follows:
| 5 |
where is a basis vector for , which means a vector whose i-th element is 1 and the rest of the elements are all zero.
By using this polar form conversion, the j-th columns of the public key matrices with n rows and n columns (, see Fig. 13) are grouped into a matrix with n rows and m columns () as shown in Fig. 14, where and . Eventually, the m public key matrices with n rows and n columns, , are converted into n matrices with n rows and m columns, . The non-zero coefficients of the first layer exist from to , as shown in Fig. 14. To recover the central map of the first layer, the linear combination M is computed in the preprocessing step by choosing a random vector as follows:
| 6 |
If the rank of M is zero or full, the random vector is chosen again until the rank is greater than 1 and less than m. The probability of this step (line 23 in Algorithm 3) is 1/q. We do not consider speeding up this process with a quantum circuit, as the complexity of this part is not significant. When the rank condition is satisfied, the -by- part of M where the coefficients of the first layer exist (i.e. the light gray-colored part of each in Fig. 14) is transferred to the quantum kernel extraction step.
| 7 |
Figure 13.
The form of public key matrices .
Figure 14.

The form of matrices converted in the preprocessing step.
The Quantum Kernel extraction Step
To find a kernel of the matrix with rows and columns, a Q-rMinRank-Grover algorithm (see Algorithm 4) is performed in the Quantum Kernel Extraction step. The Q-rMinRank-Grover algorithm requires quantum registers , , a qubit , and some ancilla qubits . The quantum registers and are -qubit registers, where is the number of qubits required to express a number on . The required quantum registers and their roles are shown in Table 3.
Table 3.
The quantum registers used in our Q-rMinRank-Grover algorithm.
| Quantum registers | Number of qubits | Role of quantum registers |
|---|---|---|
| At the end of the Q-rMinRank-Grover algorithm, the kernel is measured at quantum registers . | ||
| The sum of multiplications between each row of the input matrix and quantum registers is stored in quantum registers . | ||
| 1 | The qubit is reversed when the state of quantum registers are all 0. |
Algorithm 4.
The Q-rMinRank-Grover algorithm.
Firstly, the Hadamard gates in the Q-rMinRank-Grover algorithm bring all the qubits in quantum registers and a qubit into superposition states. Then, to increase the probability of measuring the kernel, the pair of Q-rMinRank_Oracle() and diffusion circuit Diffusion() operates iteratively times. The Q-rMinRank_Oracle() function checks which state of superpositioned quantum registers is the kernel for the matrix . The quantum registers contain the multiplication of matrix and the kernel vector. If all the registers from to are zero, Q-rMinRank_Oracle() reverses the qubit . The quantum circuit for the Q-rMinRank_Oracle() function can be designed differently for purposes such as depth optimization and width optimization. The details of quantum circuit design for the Q-rMinRank_Oracle() function are covered in the “Oracle circuit designs” section.
Algorithm 5.
The Q-rMinRank_Oracle() function.
According to the available quantum resources, the number of iterations can be adjusted26. The may be selected as when there are few available quantum resources. In that case, we measure a kernel with a probability of more than when we run the entire Q-rMinRank Grover circuit about 110 times. If quantum resources are sufficient, the may be selected as . In this case, we find the kernel with a probability of more than 90% by running the Q-rMinRank Grover circuit once.
The Key recovery Step
After the kernel vector, is obtained in the quantum kernel extraction step, the key recovery step recovers the Rainbow central map of the first layer by computing the linear combination C of public keys with again as follows:
| 8 |
Generally, the rank of the linear combination C is less than m with a high probability (over 90% on our quantum simulation). If the rank of C is greater than m, the preprocessing step and the quantum kernel extraction step are repeated until the rank of C is less than m. By finding () linear combinations C that have a rank lower than m in the quantum kernel extraction step, all central maps of the first layer are recovered. Considering that the public key P is composed of , T is uncovered from P using the central map recovered in the key recovery step. After that, the central maps of the second layer are recovered by uncovering T and F from the public key10.
Oracle circuit designs
In this section, we present the Q-rMinRank_Oracle circuit, the main quantum circuit, to recover the private key of Rainbow by quickly finding the kernel. We consider two important metrics, circuit depth and circuit width, to design quantum circuits in available quantum computing environments. For quantum security analysis of post-quantum cryptography, NIST has defined a method for measuring the quantum complexity (QC) by multiplying the quantum circuit depth by the number of circuit gates (G-cost)16. Since the number of qubits available is rapidly increasing with the development of quantum computers, NIST is considering only the depth and G-cost that affect the running time of quantum circuits rather than the width (number of qubits, #QB). However, the width of circuits is directly related to the feasibility of implementing quantum circuits and running them on quantum computers. So, width is still one of the essential metrics for estimating the performance of quantum circuits.
Therefore, we present two quantum oracle circuits, and , considering the depth-width trade-off. is a depth-optimized version of the Q-rMinRank_Oracle, and is a width-optimized version of the Q-rMinRank_Oracle. For the design of , we use a method to parallelize the quantum arithmetic gates ( and ). Parallelization allowed us to reduce the depth of . We implement gates with minimal ancilla qubits without parallelization for the design of . So we could reduce the width of .
The depth-optimized Q-rMinRank_Oracle
The Q-rMinRank_Oracle parallelizes the and gates, as shown in Algorithm 6. It is necessary to check whether the linear combination of the values in the i-th column and quantum registers is zero for each row of the matrix to find a kernel of the input matrix . Firstly, the gates copy the state of quantum register to ancilla quantum registers so that the states of are prepared. Assigning more ancilla qubits in this way enables the parallelization of gates. Then, gates operate in parallel to multiply the qubits by the elements of the matrix, , and store the multiplication results in . The states of are added to using the gates also in parallel. After that, and gates operate to initialize the and in parallel, respectively, as shown in Fig. 15. The total number of ancilla qubits required for parallelization is . The above process (, , and pairs) is then iterated times to store all states of the quantum registers .
Figure 15.
The depth-optimized Q-rMinRank_Oracle .
Algorithm 6.
The depth-optimized Q-rMinRank_Oracle .
In order to implement oracle , we use the quantum multiplier25(see Fig. 8), which has a smaller depth, as shown in Table 2. Moreover, we implement the - gate as - in Fig. 5a to shorten the depth of oracle . Since the implementation of - requires ancilla qubits, as shown in Table 1, the ancilla qubits for parallelization can be reused.
The width-optimized Q-rMinRank_Oracle
The Q-rMinRank_Oracle has no additional ancilla qubits needed for parallelization. Thus, can reduce the number of qubits. Algorithm 7 shows the process of oracle , in which and gates operate linearly. We utilize the quantum multiplier24 as the gate (see Fig. 7), which uses smaller ancilla qubits as shown in Table 2. After the gate multiplies by the quantum register and stores the multiplication results in the quantum register , the gate operates to add the state of to . The gate operates to initialize the . The iterates , , and pairs (called pairs) times to construct the as shown in Fig. 16. As has to construct quantum registers (), the totally iterates pairs () times without parallel operations. During this process, does not use ancilla qubits , which temporarily stores the multiplication result by gate.
Figure 16.
The width-optimized Q-rMinRank_Oracle .
Algorithm 7.
The width-optimized Q-rMinRank_Oracle .
since does not perform parallelization between quantum arithmetic gates, it has quite a long depth. The depth of is computed by multiplying the depth of the pair by (). We further reduce the number of qubits by implementing the - gate as - in Fig. 5b. As shown in Table 1, - requires only one ancilla qubit to implement the - gate. By recycling an ancilla qubit in the quantum register , we construct without using additional ancilla qubits.
Complexity analysis
In this section, we analyze the complexity of the Q-rMinRank attack for each parameter set of third-round Rainbow and evaluate the security level of Rainbow. Then, we analyze the quantum resources required for the Q-rMinRank attack.
Security analysis
The complexity of our Q-rMinRank attack depends on the size of the kernel vector space. We reduced the complexity of finding a kernel by converting the m public keys of Rainbow to the n matrices using polar form conversion in the preprocessing step. The Rainbow signature scheme has three security levels, with each parameter set as shown in Table 4.
Table 4.
Description of the NIST security categories and relation with the Rainbow security levels.
| Rainbow parameter sets | NIST secuirty level categories | |||||
|---|---|---|---|---|---|---|
| Parameter sets | q | Security levels | Descriptions | |||
| I | 36 | 32 | 32 | Hard to break AES128 | ||
| II | 68 | 32 | 48 | Hard to break AES192 | ||
| V | 96 | 36 | 64 | Hard to break AES256 | ||
q: the number of elements in the finite field
: the number of vinegar variables of the first layer
: the number of oil variables of the first layer
: the number of oil variables of the second layer.
Proposition 1
In our Q-rMinRank attack, the complexity of recovering the first layer of Rainbow is .
Proof
When the matrices are given as Fig. 13 and the matrices are converted to according to equations (3)(5), the size of the n converted matrices () is () as shown in Fig. 14. The information in the first layer exists from to . To recover the central map of the first layer, we only use the () part of , which has information about the first layer. In our Q-rMinRank attack, we only need to find a kernel vector for the linear combination such that , when the is a linear combination of parts of () from to . Since the size of the kernel is , the number of qubits needed to construct the Grover quantum circuit is . After computing the linear combination M that satisfies line 3 of Algorithm 3 (with a complexity of q), our Q-rMinRank Grover algorithm finds the kernel with a complexity of . We have to find kernels, so the total complexity of recovering the first layer of Rainbow is
| 9 |
Proposition 2
In our Q-rMinRank attack, the complexity of recovering the second layer of Rainbow is negligible.
Proof
A canonical form is defined by when r is odd or when r is even. Then, given a quadratic form of rank r, there exists a matrix G of rank r mapping to such that
| 10 |
We can find the matrix G using a deterministic algorithm with a complexity lower than . As a result, we uncover T with a complexity of . Since we know the central maps of the first layer recovered from the Q-rMinRank attack, public keys, and another private key T, we can recover the last private key S as follows:
| 11 |
Then, we recover the central map of the second layer simply by matrix operations (). As both the matrix operations and the matrix inversion require a complexity of , the additional cost of recovering the central map of the second layer is dominated by and is negligible10.
From Propositions 1 and 2, we see that the complexity of the Q-rMinRank attack depends on the cost of recovering the central map of the first layer. Since the central maps of the first layer are recovered by iterating the quantum kernel extraction step times, our attack complexity is . Table 5 compares the complexity of our Q-rMinRank attack with the Rainbow team’s quantum approach for the MinRank attack applying the Grover algorithm10.
Table 5.
A complexity comparison of the MinRank attack10, the Rectangular MinRank attack12, the improved Rectangular MinRank attacks13, and our Q-rMinRank attack.
| Rainbow parameter sets | Complexities of quantum attack | |||||
|---|---|---|---|---|---|---|
| Parameter sets | q | Grover on10 | our Q-rMinRank attack | |||
| I | 36 | 32 | 32 | |||
| II | 68 | 32 | 48 | |||
| V | 96 | 36 | 64 | |||
q: the number of elements in the finite field
: the number of vinegar variables of the first layer
: the number of oil variables of the first layer
: the number of oil variables of the second layer
Quantum resource analysis
For quantum resource analysis, we estimated the number of qubits (#QB), the number of quantum gates (G-cost), and the quantum depth (D) required to perform our Q-rMinRank-Grover algorithm. Our Q-rMinRank-Grover algorithm consists of iterations of Q-rMinRank_Oracle and the diffusion operator.
The diffusion operator’s circuit is fixed according to the number of input qubits. The G-cost used in the diffusion operator is proportional to the number of iterations , so it is not negligible. Therefore, we estimated the quantum resources of the oracle circuit and the diffusion operator for more accurate analysis. Table 6 shows the quantum resources for our Q-rMinRank_Oracle and Diffusion pair. The #QB required for the is one-fourth of for parameter set I, one-seventh of for parameter set III, and one-eighth of for parameter set V. On the other hand, has a depth of about to smaller than . and have a trade-off between the number of qubits and depth. For the cost comparison of and implementations, we also present the qubit-cycle costs of each oracle. The total cost in logical qubit-cycles for the serial overhead comparison is , while the cost in qubit-cycles for the parallel overhead comparison is 27. The implementation uses more qubits but has lower overhead due to the depth optimization.
Table 6.
The quantum resources for our Q-rMinRank_Oracle and Diffusion pair.
| Algorithm | Parameter sets | Oracle | #QB | G-cost | D | DW | |
|---|---|---|---|---|---|---|---|
| Rainbow | I | 1097 | |||||
| 289 | |||||||
| III | 5757 | ||||||
| 833 | |||||||
| V | 8057 | ||||||
| 1089 |
G-cost: the number of quantum gates used in an oracle and diffusion pair
D: the depth for an oracle and diffusion pair
DW: the depth times width for an oracle and diffusion pair (serial overhead)
: the square of depth times width for an oracle and diffusion pair (parallel overhead).
Then, we evaluated the efficiency of our circuits in terms of the quantum complexity proposed by NIST as a metric that should be considered in analyzing the security against quantum attacks on PQCs. Considering future quantum computers’ performance, NIST proposes measuring the complexity of quantum attacks in terms of a restricted circuit depth called the MAXDEPTH. Table 7 shows the plausible values for the MAXDEPTH range provided by NIST.
Table 7.
The plausible MAXDEPTH range16.
| MAXDEPTH | Description |
|---|---|
| The approximate number of gates that presently envisioned quantum computing architectures are expected to serially perform in a year | |
| The approximate number of gates that current classical computing architectures can perform serially in a decade | |
| The approximate number of gates that atomic scale qubits with speed of light propagation times could perform in a millennium |
Based on our quantum resource estimation and MAXDEPTH values, we analyzed the quantum complexity of our Q-rMinRank-Grover algorithm. Table 8 shows the G-cost by MAXDEPTH and the quantum complexity of our Q-rMinRank-Grover. The quantum complexity is approximated as follows:
Table 8.
The G-cost by MAXDEPTH and the quantum complexity of Q-rMinRank-Grover.
| Algorithm | Parameter sets | Oracle | MD | G-cost | D | |
|---|---|---|---|---|---|---|
| Rainbow | I | / MAXDEPTH | ||||
| / MAXDEPTH | ||||||
| III | / MAXDEPTH | |||||
| / MAXDEPTH | ||||||
| V | / MAXDEPTH | |||||
| / MAXDEPTH | ||||||
= G-cost D
Quantum simulation result
To show the feasibility of our Q-rMinRank attack, we implemented and simulated toy example circuits for our Q-rMinRank-Grover algorithms, where oracle consists of and , respectively. The input matrix for the toy example is given on as follows:
| 12 |
We constructed a circuit of the Q-rMinRank-Grover algorithm that finds the kernel of the matrix (Equation 12) and simulated our circuit using quantum simulators Qiskit20 and ProjectQ21.
ProjectQ, an open-source software effort for quantum computing, provides a function for drawing quantum circuits. Figures 18 and 19 show our Q-rMinRank oracle quantum circuits of the Q-rMinRank attack drawn using ProjectQ. Qiskit, another open-source framework for quantum computing, has the advantage of fast execution speed and supports multi-shot simulation that shows the frequency of measurement when executed several times. We measured the probability that our Q-rMinRank-Grover algorithms find the kernel utilizing the multi-shot function of Qiskit. Figures 17a and b show the outputs of implementing our Q-rMinRank-Grover algorithm circuits for the toy example in the Qiskit Aer simulator for 1000 shots.
Figure 18.
Q-rMinRank-Grover algorithm quantum circuit for toy example of “Quantum simulation result” section when the Q-rMinRank_Oracle and diffusion circuit pairs repeat 1.
Figure 19.
Q-rMinRank-Grover algorithm quantum circuit for toy example of “Quantum simulation result” section when the Q-rMinRank_Oracle and diffusion circuit pairs repeat 1.
Figure 17.
The histogram obtained by running our Q-rMinRank-Grover with oracles and in Qiskit Aer simulator.
Qubit values measured less than 10 times are not kernel values, and the sum of their probabilities is indicated in the bar named ’NotKernel’. Our simulation results show that the ’NotKernel’ is measured only once out of 1000 times. The other bars represent each of the probabilities when the kernels are accurately measured. Since we need to get a non-zero kernel, we must also exclude the results measured as ’000 000’. The Q-rMinRank-Grover algorithms, consisting of oracles and , respectively, find the kernel with accuracies of 86.7% and 89.1% probability, respectively.
Conclusion
In this paper, we first proposed a quantum rectangular MinRank (Q-rMinRank) attack that applied quantum algorithms to key recovery attacks against Rainbow, especially MinRank attacks. We designed oracle optimized for the quantum depth and oracle optimized for the quantum width (the number of qubits), respectively, considering quantum computing environments. According to our quantum resource estimation, the depth of oracle is about smaller than , and instead, uses only one-seventh of the number of qubits required for . Both circuits consisting of and found the kernel with an accuracy greater than 86% probability in toy example simulations. Also, we analyzed the complexities of our Q-rMinRank attacks. The complexity of the Q-rMinRank attack is less than the complexity of the MinRank attacks with Grover’s algorithm estimated by the Rainbow team by in parameter set I, in parameter set III, and in parameter set V. Then, we estimated the quantum resources required for the Q-rMinRank attack. Our Q-rMinRank-Grover circuits consisting of oracle require only 289, 833, and 1089 qubits for parameter sets I, III, and V of Rainbow, respectively. We also measured the quantum complexity by using the G-cost estimation, a metric for analyzing the security against quantum attacks on PQC. The quantum complexities of the Q-rMinRank-Grover algorithms are , , and for parameter sets I, III, and V, respectively, when applying oracle .
Supplementary Information
Acknowledgements
This work was supported by Institute for Information & Communications Technology Planning & Evaluation (IITP) grant funded by the Korea government(Ministry of Science and ICT(MSIT)) (QCrypton, No.2019-0-00033, Study on Quantum Security Evaluation of Cryptography based on Computational Quantum Complexity), by the National Research Foundation of Korea (NRF) grant funded by the Korea government(MSIT) (No.2021R1A2C1095591), and by Quantum Computing based on Quantum Advantage challenge research through the National Research Foundation of Korea (NRF) funded by the Korean government (MSIT) (RS-2023-00256221).
Author contributions
S.M.C. developed quantum rectangular MinRank attacks and wrote the preliminary version of the manuscript, and S.H.S. edited over it. All authors analyzed the security of Rainbow and HiMQ, and reviewed the manuscript.
Data availability
All data generated or analyzed during this study are included in this published article.
Competing interests
The authors declare no competing interests.
Footnotes
Publisher's note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary Information
The online version contains supplementary material available at 10.1038/s41598-024-66841-0.
References
- 1.Arute F, et al. Quantum supremacy using a programmable superconducting processor. Nature. 2019;574:505–510. doi: 10.1038/s41586-019-1666-5. [DOI] [PubMed] [Google Scholar]
- 2.Chow, J., Dial, O. & Gambetta, J. Ibm quantum breaks the 100-qubit processor barrier (2021).
- 3.Shor, P. Algorithms for quantum computation: discrete logarithms and factoring. In Proc. 35th Annual Symposium on Foundations of Computer Science, 124–134, 10.1109/SFCS.1994.365700 (1994).
- 4.Proos, J. & Zalka, C. Shor’s discrete logarithm quantum algorithm for elliptic curves. Preprint at https://arXiv.org/quant-ph/0301141 (2003).
- 5.Shim K-A. A survey on post-quantum public-key signature schemes for secure vehicular communications. IEEE Trans. Intell. Transport. Syst. 2021 doi: 10.1109/TITS.2021.3131668. [DOI] [Google Scholar]
- 6.Ding, J. & Schmidt, D. Rainbow, a new multivariable polynomial signature scheme. In International Conference on Applied Cryptography and Network Security, 164–175 (Springer, 2005).
- 7.Association, K. T. T. Post quantum cryptography based on multivariate quadratic equations - part 2: Himq, digital signature algorithm with appendix. TTAK.KO-12.0348-Part2 (2020).
- 8.Lazard D. Résolution des systèmes d’équations algébriques. Theor. Comp. Sci. 1981;15:77–110. doi: 10.1016/0304-3975(81)90064-5. [DOI] [Google Scholar]
- 9.Faugere J-C. A new efficient algorithm for computing gröbner bases (f4) J. Pure Appl. Algebra. 1999;139:61–88. doi: 10.1016/S0022-4049(99)00005-5. [DOI] [Google Scholar]
- 10.Billet, O. & Gilbert, H. Cryptanalysis of rainbow. In International Conference on Security and Cryptography for Networks, 336–347 (Springer, 2006).
- 11.Bardet, M. et al. Improvements of algebraic attacks for solving the rank decoding and minrank problems. In International Conference on the Theory and Application of Cryptology and Information Security, 507–536 (Springer, 2020).
- 12.Beullens, W. Improved cryptanalysis of uov and rainbow. In Annual International Conference on the Theory and Applications of Cryptographic Techniques, 348–373 (Springer, 2021).
- 13.Beullens, W. Breaking rainbow takes a weekend on a laptop. Cryptology ePrint Archive (2022).
- 14.Wiedemann D. Solving sparse linear equations over finite fields. IEEE Trans. Inf. Theory. 1986;32:54–62. doi: 10.1109/TIT.1986.1057137. [DOI] [Google Scholar]
- 15.Cross AW, Bishop LS, Sheldon S, Nation PD, Gambetta JM. Validating quantum computers using randomized model circuits. Phys. Rev. A. 2019;100:032328. doi: 10.1103/PhysRevA.100.032328. [DOI] [Google Scholar]
- 16.NIST. Submission requirements and evaluation criteria for the Post-Quantum Cryptography standardization process (2016).
- 17.Grassl, M., Langenberg, B., Roetteler, M. & Steinwandt, R. Applying grover’s algorithm to aes: quantum resource estimates. In International Workshop on Post-Quantum Cryptography, 29–43 (Springer, 2016).
- 18.NIST. Call for Additional Digital Signature Schemes for the Post-Quantum Cryptography Standardization Process (2022).
- 19.Jaques, S., Naehrig, M., Roetteler, M. & Virdia, F. Implementing grover oracles for quantum key search on aes and lowmc. In Advances in Cryptology–EUROCRYPT 2020: 39th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Zagreb, Croatia, May 10–14, 2020, Proceedings, Part II 30, 280–310 (Springer, 2020).
- 20.Aleksandrowicz, G. et al. Qiskit: An open-source framework for quantum computing. 16 (2019).
- 21.Steiger DS, Häner T, Troyer M. Projectq: An open source software framework for quantum computing. Quantum. 2018;2:49. doi: 10.22331/q-2018-01-31-49. [DOI] [Google Scholar]
- 22.Grover, L. K. A fast quantum mechanical algorithm for database search. In Proc. of the Twenty-eighth Annual ACM Symposium on Theory of Computing, 212–219 (1996).
- 23.Kim P, Han D, Jeong KC. Time-space complexity of quantum search algorithms in symmetric cryptanalysis: Applying to aes and sha-2. Quantum Inf. Process. 2018;17:1–39. doi: 10.1007/s11128-018-2107-3. [DOI] [Google Scholar]
- 24.Cho S-M, Kim A, Choi D, Choi B-S, Seo S-H. Quantum modular multiplication. IEEE Access. 2020;8:213244–213252. doi: 10.1109/ACCESS.2020.3039167. [DOI] [Google Scholar]
- 25.Jang, K. et al. Optimized implementation of quantum binary field multiplication with toffoli depth one. In Information Security Applications: 23rd International Conference, WISA 2022, Jeju Island, South Korea, August 24–26, 2022, 284–297 (2022).
- 26.O’Donnell, R. & Wright, J. Grover’s algorithm. 15-859BB: Quantum Computation and Information 2015 (2015).
- 27.Sarah, D. & Peter, C. On the practical cost of grover for aes key recovery. csrc.nist.gov (2024).
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
All data generated or analyzed during this study are included in this published article.


















