Next Article in Journal
Study on Interface Mechanical Properties of Graphene/Copper Matrix Composites
Next Article in Special Issue
Multi-Resolution Analysis with Visualization to Determine Network Attack Patterns
Previous Article in Journal
Modeling and Analysis of Drill String–Casing Collision under the Influence of Inviscid Fluid Forces
Previous Article in Special Issue
AWEncoder: Adversarial Watermarking Pre-Trained Encoders in Contrastive Learning
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Improved Low-Depth SHA3 Quantum Circuit for Fault-Tolerant Quantum Computers

Division of IT Convergence Engineering, Hansung University, Seoul 02876, Republic of Korea
*
Author to whom correspondence should be addressed.
Submission received: 17 February 2023 / Revised: 7 March 2023 / Accepted: 8 March 2023 / Published: 10 March 2023
(This article belongs to the Special Issue Advanced Technologies in Data and Information Security II)

Abstract

:
To build a secure cryptography system in the post-quantum era, one must find the minimum security parameters against quantum attacks by estimating the quantum resources of a fault-tolerant quantum computer. In a fault-tolerant quantum computer, errors must reach an acceptable level for practical uses according to error detection and error correction processes. However, these processes utilize additional quantum resources. As the depth of the quantum circuit increases, the computation time per qubit increases together with the processing errors. Therefore, in terms of errors in quantum circuits, it is a fundamental requirement to reduce the depth by trading off the number of qubits. This paper proposes novel low-depth SHA3 quantum circuit implementations for fault-tolerant quantum computers to reduce errors. The proposed SHA3 quantum circuit was implemented with the aim of optimizing the quantum circuit depth through a trade-off between the number of qubits, the quantum gate, and the quantum depth in each function. Compared to other state-of-art techniques, the proposed method achieved T-depth and full-depth reductions of 30.3% and 80.05%, respectively. We believe that this work will contribute to the establishment of minimum security parameters for SHA3 in the quantum era.

1. Introduction

As the world evolves into the information age, data encryption is essential to protect digital content. Currently, digital content is protected through symmetric-key cryptography (e.g., the Advanced Encryption Standard (AES)) and public-key cryptography (e.g., Riverst–Shamir–Adleman (RSA), Elliptic Curve Cryptography (ECC)). With the unexpected rapid development in quantum computers, the security of modern cryptography against quantum algorithms has become unclear. Grover’s algorithm, proposed by Lov Grover in 1996 [1], is known to accelerate brute-force attacks and pre-image attacks on symmetric-key cryptography and hash functions. Shor’s algorithm, proposed by Peter Shor in 1994 [2], is known to be able to solve the basic problems of existing public-key cryptography systems, such as factorization and discrete logarithms, in polynomial time.
In the past, quantum computers were an abstract concept, but many companies have recently established fault-tolerant quantum computers, showing the possibility of their use in practical applications. To operate a quantum computer, it is necessary to provide certain quantum resources (i.e., a certain number of qubits, quantum gates) that are required for operation. When quantum resources meet the requirements of quantum algorithms for a target cryptographic attack, the cryptography is considered to be no longer effective in data protection. In order to resolve this issue, symmetric-key cryptography increases the key size, and the hash function increases the output length. In the case of public-key cryptography, the current system should be replaced with other post-quantum cryptography standards. It is also important to establish an efficient security system for symmetric-key cryptography and hash functions by finding the minimum security parameters that ensure a certain level of security for fault-tolerant quantum computers. This can be achieved by estimating the resources required for an attack through the implementation of quantum circuits for symmetric-key cryptography and hash functions. Since a quantum computer operates using the quantum mechanical phenomena of qubits, it is important to preserve the integrity of the qubit state in the operation. Qubit data can be corrupted when the value of an unstable qubit fluctuates during calculation due to the nature of high noise rates. To be operational, a fault-tolerant quantum computer should tolerate appropriate errors, error correction, and error detection for unstable qubits. Various studies have been conducted regarding these tasks [3,4,5,6].
The number of qubits and the quantum circuit depth are generally inversely proportional to each other in a quantum circuit implementation. When implementing a quantum circuit, two methods can be considered. One can reduce the depth of a quantum circuit by increasing the number of qubits, or one can reduce the number of qubits by increasing the depth of the quantum circuit. In the era of noisy intermediate-scale quantum (NISQ), quantum computers are not yet a stable technology [7]. For this reason, it is difficult to determine which is the more efficient and optimized method for implementing a quantum circuit. However, researchers need to conduct research in all aspects, and this factor is likely to be discussed again when quantum computers become more realistic. Approaches that increase the number of qubits and decrease the quantum circuit depth are more suitable in terms of optimizing the noise of the quantum circuit. As the depth of the quantum circuit increases, the operation time also increases, which affects the increase in the error rate of the quantum circuit.
With this research aim, this paper presents an improved low-depth SHA3 quantum circuit for fault-tolerant quantum computers to reduce errors. Error detection and correction are essential for fault-tolerant quantum computers, and errors increase proportionally with depth. We also present a corresponding technique to research how to reduce errors by reducing the depth of the overall operation through the proposed method. The method used in [8], which returned the qubit state to its previous state through an inverse operation and reused it in the next operation, could reduce the number of qubits. This approach increased the number of errors as the inverse of the function increased the depth. Many works have explored error detection and error correction. In [9], the Q# development tool was used to reduce the total number of qubits compared to the results presented in [8]. The number of qubits was reduced by 1280 compared to the first work, and 1920 qubits were used in total. The current study, taking a different direction to the previous research by aiming to reduce the number of qubits, implemented a quantum circuit by increasing the number of qubits and reducing the inverse operation process, and a separate attempt to reduce the number of qubits was also made. The overall quantum circuit depth was reduced by changing the internal operating structure rather than simply optimizing the depth through the increase in the use of qubits. Therefore, the proposed quantum circuit was efficient in terms of its depth. As a result, compared to previous works [8], the T depth and full depth were reduced by 30.3% and 80.05%, respectively. We could not compare the results of previously proposed methods with our own. The efficient implementation method pursued by each research group was different (i.e., the number of qubits), and we focused on reducing the depth of the quantum circuit. Therefore, the differences between the proposed quantum circuit and previous research results were as follows: (1) The reduced depth of the quantum circuit reduced the time and errors required for quantum operations. (2) Our work required more quantum qubits for computation than previous works. However, the setting with more qubits was suitable for real-world quantum computers.

1.1. Contributions

This paper proposes an improved low-depth SHA3 quantum circuit for fault-tolerant quantum computers. We worked to reduce the depth inside the quantum circuit. As a result, we reduced the T depth and full depth compared to previous works by 30.3% and 80.05%, respectively. The contributions made to the proposed SHA3 quantum circuit are summarized below.

1.1.1. Constructive Contributions

In this paper, the structure of SHA3 was identified, and the quantum circuit was designed in a way that reduced its depth. In the NISQ era, it is difficult to conclude which implementation produces a more efficient quantum circuit. However, researchers need to explore all directions, and to meet this requirement, we pioneered the direction of reducing errors by significantly reducing the quantum circuit depth.

1.1.2. Contributions in Terms of Quantum Cost (Resource Trade-Off)

In a fault-tolerant quantum computer, error detection and error correction are essential to control the errors that accumulate through noise, calculation errors, and incorrect operations. For this operation, additional quantum resources are required. In fault-tolerant circuits, the error increases as the length of the operation increases, so the error can be decreased by reducing the depth. Therefore, in terms of errors, it is more effective to reduce the depth of quantum circuits. The proposed SHA3 reversible quantum circuit showed the results of drastically reducing the depth through a quantum resource trade-off.

1.1.3. Preparing for the Post-Quantum Era

To prepare for the post-quantum era, it is necessary to find parameters that provide a satisfactory level of security by estimating the resources required for an attack through the implementation of a quantum circuit for the target cryptography. Finding the minimum security parameters is effective for constructing a secure cryptography system. The proposed new direction for SHA3 quantum circuit implementation could contribute to the study of minimum security parameters in terms of depth.

2. Preliminaries

2.1. Quantum Computing

Quantum computers can solve specific problems faster than classic computers by using the quantum mechanical properties of qubits for operation. In a quantum computer, data are expressed in qubits, and operations are performed by manipulating the state of qubits through a reversible circuit. The qubit exists in a superposition state that is probabilistically 0 and 1 at the same time throughout the operation until the final measurement. Thus, the qubit exists in multiple states at the same time. Due to this property, the operation for all cases of 0 and 1 can be probabilistically calculated at once, so the calculation speed is fast, and a probabilistic result is output at the last measurement. The measurement probability for a qubit in a particular state can be described by the probability amplitude associated with the state.
The superposition of qubits via the Hadamard gate is expressed as:
| ψ = α | 1 + β | 0 , | α | 2 + | β | 2 = 1
A qubit in superposition produces an eigenvalue of either 0 or 1 after measurement, and the value is unknown before measurement [10]. In the above expression, α and β refer to the probability amplitude, and if | α | 2 is 0, | β | 2 is 1, and vice versa.
Since all quantum gates used to control the state of qubits are reversible, inverse operations are possible. The placement of quantum gates is directly related to the depth of the quantum circuit, and many previous studies have been conducted to reduce the total number and depth of quantum gates by reducing the number or optimizing the placement of the quantum gates used in an operation [11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]. Representative quantum gates include the H  gate, X gate, CNOT gate, T o f f o l i gate, and T gate, which are presented below:
H = 1 2 1 1 1 1 X = 1 2 0 1 1 0 C N O T = 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0
T o f f o l i = 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 T = 1 0 0 e i π / 4
As a non-Clifford gate, the T o f f o l i gate can be decomposed into lower-level gates. In the proposed quantum circuit, the T o f f o l i gate decomposed as shown in Figure 1 was used for T-depth estimation. The Toffoli gate includes a non-Clifford T gate, and the steps of the T gate lead to the T depth. Minimizing the number of T gates is still important, as non-Clifford T gates have a long latency, and their implementation cost far exceeds that of Clifford gates in fault-tolerant implementation [27,28].

2.2. Secure Hash Algorithm (SHA) 3

In 2015, the National Institute of Standards and Technology (NIST) released Secure Hash Algorithm 3 (SHA3) [29] to replace SHA1 [30] and SHA2 [31]. The SHA3 hash function family consists of four hash functions (SHA3-224, SHA3-256, SHA3-384, and SHA3-512) and two extendable-output functions (XOFs) (SHAKE128 and SHAKE256). The input data output hash results through ’absorbing’ and ’squeezing’ steps using the sponge structure, as shown in Figure 2. SHA3 has a sponge structure, so it outputs a hash value of a constant length regardless of the input length. When absorbing, a message block is transformed through XOR and permutation functions, and the transformed message block is updated by repeating the function f (i.e., Keccak-f[1600, 24]) composed of five steps: θ , ρ , π , χ , and ι . The inner operation of function f is explained in detail in Section 3 for implementation in the SHA3 quantum circuit.

2.2.1. Pre-Image Attack

A hash function maps data of an arbitrary length onto a hash value of a fixed length. This feature increases the speed of the data search, as long and diverse data can be arranged in a certain length. A pre-image is a way to find the original message when a hash value is provided: find M given H for H = h a s h ( M ) . A pre-image attack is an attempt by an attacker to find the original message through a hash value. The pre-image resistance of the hash function, which increases as the hash length increases, has n-bit resistance for an n-bit hash length. A hash function that is difficult to find using a pre-image is defined as a better hash function. The collision resistance of Secure Hash Algorithm (SHA) 3 is 2 n / 2 , the pre-image resistance is 2 n , and the output length is n = 224 , 256 , 384 , 512 . Table 1 shows the parameters and pre-image resistance for the SHA3 hash function family.

2.2.2. Quantum Pre-Image Attack

In the worst case, it will take N searches to find specific data in N unsorted datasets. On quantum computers, Grover’s algorithm allows one to find specific data in N searches. Grover’s algorithm speeds up pre-image attacks on hash functions as it can quickly search N data fields to find an input that outputs a specific hash value in the hash function. Therefore, the computational complexity O ( N ) for a brute-force attack in a classic computer is reduced to the computational complexity O ( N ) in a quantum computer. Grover’s algorithm for a pre-image attack is divided into the Oracle and Diffusion operators, as shown in Figure 3. This attack is a known plaintext attack (KPA) that proceeds when the plaintext–ciphertext pairs of the block cipher are known. The Oracle function includes the hash function f g ( x ) = y and the inverse operation f g ( x ) = y . If the result of f g ( x ) is y, then x = 1 in Oracle, and the measurement probability for the state is increased through the diffusion operator U s = 2 | s s | I . It is known that the state of the correct qubit can be found in about π 4 N iterations of Grover’s algorithm.

3. SHA3 Quantum Circuit

The data input to the qubit output the hash function through the process of absorbing and squeezing by the sponge structure. In the absorbing process, the message block is converted through XOR and permutation functions, and the converted message block is updated by repeating the function f (i.e., Keccak-f[1600, 24]). The final hash value is output through the squeezing process. The proposed improved low-depth SHA3 quantum circuit for fault-tolerant quantum computers was implemented for all Keccak-f phases. This section describes the implementation of quantum circuits for each function. The SHA3 internal function f consists of five steps, presented below, and operates as many as 12 + 2 l rounds, depending on the b bits (SHA3: b = 1600). The power-of-two word size w is defined as w = 2 l bit, and SHA3 uses a 64-bit word (i.e., l = 6):
f = ι χ π ρ θ
In the SHA3 operation, each step of Keccak-f proceeds with a multi-dimensional bit array structure of data. In the same way, the quantum circuit was constructed assuming that the qubits were arranged in a multi-dimension bit array along the structure of each step. Figure 4 shows each part of the three-dimensional bit array matrix state in Keccak-f[1600].

3.1. Theta ( θ )

Theta ( θ ) is one of the five phases of the SHA3 (i.e., Keccak-k) hash function. In the θ phase, the data are processed in the three-dimensional state array structure shown in Figure 4. The result of Σ ( ( x 1 ) , z ) Σ ( ( x + 1 ) , ( z 1 ) ) saves to ( x , y , z ) bits. The final result value is stored in ( x , y , z ) .
C [ x , z ] = A [ x , 0 , z ] A [ x , 1 , z ] A [ x , 2 , z ] A [ x , 3 , z ] A [ x , 4 , z ] , x , y D [ x , z ] = C [ ( x 1 ) % 4 , z ] C [ ( x + 1 ) % 4 , ( z 1 ) % w ] , x a n d 0 z w R [ x , y , z ] = A [ x , y , z ] D [ x , z ]
Equation (1) is the theta ( θ ) operation in a classic computer. In classic computer operation, temporary registers (hereafter referred to as t e m p ) of C, D, and R are allocated to store intermediate calculation values. Therefore, four 1600-bit t e m p are used. Quantum circuits reduce the use of 4800 qubits by allocating one 1600-bit t e m p of one state size. The proposed quantum circuit avoids an increase in depth by not initializing t e m p qubits through reverse operation in each round. This scheme allocates one temp qubit to replace the inverse operation per round.
Figure 5 shows (a) the exclusion of the inverse operation and (b) the inclusion of the inverse operation in theta ( θ ). T represents the t e m p qubit. The scheme excluding the inverse operation includes only one θ function in the quantum circuit per round. The scheme including the inverse operation involves the θ function and the θ function to return the temporary qubit T to its original state in the quantum circuit each round. Including the inverse operation can reduce T qubits but increases the number of quantum gates and the depth. In an attempt to reduce the depth, the scheme excluding inverse operations was selected in this paper. Compared to [8], the operation process proposed in this paper increased the CNOT gate by about 36.36% and reduced the depth by about 71.27% in θ (trade-off between quantum gates and depth). In the implementation of [8], θ used the most CNOT gates and increased the depth. Considering this, the proposed quantum circuit replaced θ with the use of T qubits. As a result, a trade-off occurred between 1,360,000 CNOT gates + 25 depth and 1600 qubits at θ per round (increase: qubit, decrease: CNOT gate + depth).
Algorithm 1 shows the operation of our quantum circuit for theta ( θ ). In the input, X and T denote the input qubit and the t e m p qubit. All operations performed by the CNOT gate updated T, and T was returned at the end. Compared to previous research results [8], the proposed algorithm increased the CNOT gate but reduced the full depth in theta ( θ ).
Algorithm 1 Quantum algorithm for theta ( θ )
Input: X, T
  1:
for (i = 0 to 5): for (j = 0 to 5) : for (k = 0 to 64) :
  2:
for s = 0 to 5 do
  3:
    T [ i ] [ j ] [ k ] CNOT ( X [ ( i 1 ) % 5 ] [ s ] [ k ] , T [ i ] [ j ] [ k ] )
  4:
    T [ i ] [ j ] [ k ] CNOT ( X [ ( i + 1 ) % 5 ] [ s ] [ ( k 1 ) % 64 ] , T [ i ] [ j ] [ k ] )
  5:
    T [ i ] [ j ] [ k ] CNOT ( X [ i ] [ j ] [ k ] , T [ i ] [ j ] [ k ] )
  6:
end for
Return T

3.2. Rho ( ρ )

In the rho ( ρ ) phase, the operation proceeds with the lane structure of the state shown in Figure 4. The rotation of the index operates according to the set offset inside each lane. The index rotation operation in rho ( ρ ) is as follows:
R h o ( ρ ) : X [ x ] [ y ] [ z ] X [ x ] [ y ] [ z ( t + 1 ) ( t + 2 ) / 2 ]
where
0 t 23 , x y = 3 2 1 0 t 0 1
If this is simply connected to a quantum circuit, a separate reversible gate is not required, and it is implemented in a way that only changes the physical position of the qubit without using a SWAP gate for rotation. As a result, no reversible quantum gate is used in rho ( ρ ) .

3.3. Pi ( π )

The pi ( π ) phase is used to permute the values of lanes within the state x [ 3 x + 2 y ] [ x ] x [ x ] [ y ] . Similar to rho ( ρ ) , no reversible quantum gate is used in the pi ( π ) phase, because it only changes the physical position of the qubit.

3.4. Chi ( χ )

Chi ( χ ) is the only non-linear part of Keccak-f. Considering the results of the quantum circuit implementation, the Toffoli gate was only used in this step. Since it was the only internal step to use the T gate, it presented the T depth. Chi ( χ ) is the process of XOR operation with the result of multiplying the correct two bits in the row, and the operation is as follows:
X [ x , y , z ] = X [ x , y , z ] ( ( X [ x + 1 ] m o d 5 , y , z ] 1 ) · X [ ( x + 2 ) m o d 5 , y , z ] )
This shows the classic chi ( χ ) operation. In the proposed quantum circuit, the operation results are reflected directly on the target qubit without intermediate t e m p qubits to reduce the depth and additional t e m p qubits. Using the Toffoli gate, the result of ( X [ x + 1 ] m o d 5 ] [ y ] [ z ] 1 ) · X [ ( x + 2 ) m o d 5 ] [ y ] [ z ] is directly reflected in the target qubit. The values required to update X [ x ] [ y ] [ z ] in 0 x 4 are shown in Table 2.
In the order x = 0 , 1 , 2 , there is no problem in updating X, but for x = 3 , 4 , a problem arises because the state of the qubits of X and X required for the operation has changed from the preceding operation (marked with ⊛ in the Table 2). A method involving inverse operation can be considered, but this greatly increases the depth of the quantum circuit. The proposed quantum circuit allocated qubits to store the values of X [ 0 ] [ y ] [ z ] and X [ 1 ] [ y ] [ z ] before operation and maintain the values. For each round in chi ( χ ), this method reduced the CNOT gate by about 98.08%, the T depth by about 30.3%, and  the full depth by about 90.08% through the use of an additional 640 t e m p qubits. Algorithm 2 shows the quantum circuit operation for chi ( χ ).
Algorithm 2 Quantum algorithm for chi ( χ )
Input: x, T 0 , T 1
  1:
x [ 0 ] CNOT ( X [ 0 ] , T 0 )
  2:
x [ 1 ] CNOT ( X [ 1 ] , T 1 )
  3:
for (i = 0 to 5) : for (j = 0 to 5) : for (k = 0 to 64) :
  • if i == 0, 1, 2:
  4:
    x [ ( i + 1 ) % 5 ] [ j ] [ k ] X | ( x [ ( i + 1 ) % 5 ] [ j ] [ k ] )
  5:
    x [ ( i + 1 ) % 5 ] [ j ] [ k ] Toffoli ( x [ ( i + 1 ) % 5 ] [ j ] [ k ] , ( x [ ( i + 2 ) % 5 ] [ j ] [ k ] , x [ i ] [ j ] [ k ] )
  6:
    x [ ( i + 1 ) % 5 ] [ j ] [ k ] X | ( x [ ( i + 1 ) % 5 ] [ j ] [ k ] )
  • if i == 3:
  7:
    x [ ( i + 1 ) % 5 ] [ j ] [ k ] X | ( x [ ( i + 1 ) % 5 ] [ j ] [ k ] )
  8:
    x [ ( i + 1 ) % 5 ] [ j ] [ k ] Toffoli ( x [ ( i + 1 ) % 5 5 ] [ j ] [ k ] , T 0 [ j ] [ k ] , x [ i ] [ j ] [ k ] )
  9:
    x [ ( i + 1 ) % 5 ] [ j ] [ k ] X | ( x [ ( i + 1 ) % 5 ] [ j ] [ k ] )
  • if i == 4:
  10:
    T 0 [ j ] [ k ] X | ( T 0 [ j ] [ k ] )
  11:
    x [ i ] [ j ] [ k ] Toffoli ( T 0 [ j ] [ k ] , T 1 [ j ] [ k ] , x [ i ] [ j ] [ k ] )
  12:
    T 0 [ j ] [ k ] X | ( T 0 [ j ] [ k ] )
  • Return x

3.5. Iota ( ι )

Iota ( ι ) is the process of XOR operation between lane(0,0) and the round constant T [ x ] [ 0 ] [ 0 ] = T [ x ] [ 0 ] [ 0 ] R C [ x ] . Since R C is a constant, it proceeds as a classic calculation rather than a quantum circuit. In the CNOT operation on R C and T, since RC represents classic data and the input is quantum data, the X gate is applied to T according to the R C value. In this way, the quantum resources required for R C calculation can be reduced, and the CNOT gate can be replaced with the X gate (the CNOT gate is regarded as a higher-cost quantum resource than the X gate). The quantum resource (X gate) used in iota ( ι ) depends on the constant RC.

3.6. Quantum Cost Analysis for SHA3

Table 3 shows the proposed quantum resources for the Keccak-f function in SHA3, and Table 4 shows the quantum resources for our method, with the results of Amy et al. [8] included for comparison. As shown in Table 3, in the proposed quantum circuit, θ and χ used the most quantum resources, and 1600 qubits in θ and 640 qubits in χ were used for each round.
As shown in Table 4, the proposed quantum circuit increased the number of qubits to reduce the depth of the quantum circuit, resulting in a reduction in the depth of each function compared to previous implementations. In the theta ( θ ) operation, we increased the CNOT gate by about 36.36% and reduced the depth by about 71.27% per round. To omit the θ 1 process, 1600 additional qubits were used. The result of this quantum trade-off was a reduction of 1,360,000 CNOT gates + 25 depth for θ 1 and an increase of 1600 qubits. In total, the full depth was reduced by about 73.67% in theta( θ ) and theta inverse θ 1 .
In chi ( χ ), 640 qubits were used additionally to reduce the CNOT gate by about 98.08%, the T depth by about 30.3%, and the full depth by about 90.08% per round (trade-off between qubits and gate + depth). In [8], the number of Toffoli gates used was not shown, but through the T depth, it can be inferred that Toffoli gates were used more than in our method. Our method used more 1qClifford gates but reduced the number of CNOT and Toffoli gates, which are more expensive quantum gates than 1qClifford gates, so we saw this as an appropriate quantum resource trade-off.
For the operation of iota ( ι ), the classic-to-quantum method reduced the quantum resources required for RC calculation and replaced the use of CNOT gates with X gates.
As a result of these efforts, the proposed improved low-depth SHA3 quantum circuit for fault-tolerant quantum computers decreased the depth of all functions, reducing the overall quantum circuit depth by about 80.01%.
We optimized the depth of each function in the SHA3 quantum circuit for low quantum computing error rates. Our approaches reduced the depth of the quantum circuits. In [32], the additional parts for Korean block ciphers LEA, HIGHT, and CHAM were implemented in parallel to reduce the overall depth compared to the first proposed quantum circuit [33]. The quantum resource estimation results of the preceding quantum circuit [32] presented in Table 5 were efficiently reduced in terms of depth through quantum resource trade-off, and the results are shown in Table 6. The method presented in [33] showed performance enhancements in terms of quantum circuit depth for LEA, HIGHT, and CHAM of 78%, 85%, and 70%, respectively.
In [14], to reduce the depth of the Korean standard hash function LSH, a part that made parallel operation possible was identified in previous research [34] and designed to perform parallel operation inside the quantum circuit. As a result, compared to the initial research results presented in Table 7, the full depth of the quantum circuit was reduced by about 96%, and the results are shown in Table 8. The previous study reduced the internal calculation time and error by reducing the depth of the quantum circuit. The depth of the quantum circuit was reduced by about 70% to 96% compared to the initial work.
Table 9 shows the quantum resources needed for the SHA-256 [8] and SM3 [15] hash functions. The results of comparing our SHA3 quantum circuit with the quantum circuits for other hash functions (LSH-256 [14], SHA-256 [8], and SM3 [15]) were as follows:
The SHA3 quantum circuit proposed in this paper used more X gates and CNOT gates than the parallel quantum circuit of LSH-256 [14] and had fewer Toffoli gates and a smaller T depth and full depth. Compared to the SHA-256 [8] quantum circuit, our SHA3 quantum circuit used more X gates and CNOT gates but fewer Toffoli gates, and the T depth and full depth were smaller. Compared to the Chinese National Standard hash function SM3 [15], the SHA3 hash function used X gates and CNOT gates more and Toffoli gates less, and the T depth and full depth were smaller. Compared to the LSH, SHA256, and SM3 hash function quantum circuits, the proposed SHA3 required the more X and CNOT gates, but the required number of Toffoli gates, T depth, and full depth were lower. In future quantum computing, it is expected that SHA3 will be the most vulnerable hash function according to its depth. On the other hand, in terms of qubits, it is expected that the time to reach the number of qubits required for SHA3 quantum circuit operation will be the longest.

4. Future Work

In this paper, we proposed an implementation of a SHA3 quantum circuit focusing on reducing the depth by using more qubits. Error detection and correction are essential for operation in a fault-tolerant quantum computer. Since the error is proportional to the depth, more qubits are needed for error correction as the depth increases. Therefore, we proposed a new method to reduce errors by reducing the depth of the overall operation. This is expected to show excellent results in terms of errors if large-scale fault-tolerant quantum computers appear in the future. However, in the NISQ era, neither the method of reducing qubits nor that of reducing the depth can be labeled as more efficient. Therefore, as quantum computers develop in the future, it is expected that research on a hybrid of the two methods will be necessary.

5. Conclusions

This paper proposed highly optimized low-depth SHA3 quantum circuits for fault-tolerant quantum computers. To operate a quantum circuit in a fault-tolerant quantum computer, it must be corrected to an acceptable level of error through proper error detection and correction. Certain quantum resources (e.g., qubits) are additionally used for this task. In a classic quantum circuit implementation, the number of qubits and the quantum circuit depth are inversely proportional. Quantum circuits can be implemented considering two methods. Since quantum computers are currently an uncertain technology, it is difficult to emphasize which is most efficient. As the quantum circuit depth increases, the computation time for each qubit increases, which increases the error. From a quantum noise perspective, it makes more sense to increase the number of qubits, reducing the quantum circuit depth to decrease errors. In this paper, we worked to reduce the quantum circuit depth to reduce the errors occurring in cryptography operations. Quantum circuits were implemented with the aim of reducing the depth through a trade-off between the number of qubits and the quantum gates + depth for each SHA3 function. As a result, the T depth was reduced by about 30.3% and the full depth by about 80.05% compared to the results of previous research. We expect that our work will contribute to the establishment of minimum security parameters for SHA3 in the post-quantum era.

Author Contributions

Software, G.S.; Writing—original draft, G.S.; Writing—review & editing, K.J.; Supervision, H.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research was financially supported by Hansung University.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Grover, L.K. A fast quantum mechanical algorithm for database search. In Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, New York, NY, USA, 22–24 May 1996; pp. 212–219. [Google Scholar]
  2. Shor, P.W. Algorithms for quantum computation: Discrete logarithms and factoring. In Proceedings of the 35th Annual Symposium on Foundations of Computer Science, Santa Fe, NM, USA, 20–22 November 1994; pp. 124–134. [Google Scholar]
  3. Aharonov, D.; Ben-Or, M. Fault-tolerant quantum computation with constant error. In Proceedings of the Twenty-Ninth Annual ACM Symposium on Theory of Computing, El Paso, TX, USA, 4–6 May 1997; pp. 176–188. [Google Scholar]
  4. Shor, P.W. Fault-tolerant quantum computation. In Proceedings of the 37th Conference on Foundations of Computer Science, Burlington, VT, USA, 14–16 October 1996; pp. 56–65. [Google Scholar]
  5. Steane, A.M. Efficient fault-tolerant quantum computing. Nature 1999, 399, 124–126. [Google Scholar] [CrossRef]
  6. Ofek, N.; Petrenko, A.; Heeres, R.; Reinhold, P.; Leghtas, Z.; Vlastakis, B.; Liu, Y.; Frunzio, L.; Girvin, S.; Jiang, L.; et al. Extending the lifetime of a quantum bit with error correction in superconducting circuits. Nature 2016, 536, 441–445. [Google Scholar] [CrossRef] [PubMed]
  7. Preskill, J. Quantum computing in the NISQ era and beyond. Quantum 2018, 2, 79. [Google Scholar] [CrossRef]
  8. Amy, M.; Di Matteo, O.; Gheorghiu, V.; Mosca, M.; Parent, A.; Schanck, J. Estimating the cost of generic quantum pre-image attacks on SHA-2 and SHA-3. In Proceedings of the Selected Areas in Cryptography–SAC 2016: 23rd International Conference, St. John’s, NL, Canada, 10–12 August 2016; Revised Selected Papers. Springer: Cham, Switzerland, 2017; pp. 317–337. [Google Scholar]
  9. Preston, R.H. Applying Grover’s Algorithm to Hash Functions: A Software Perspective. IEEE Trans. Quantum Eng. 2022, 3, 1–10. [Google Scholar] [CrossRef]
  10. Hey, T. Quantum computing: An introduction. Comput. Control Eng. J. 1999, 10, 105–112. [Google Scholar] [CrossRef]
  11. Grassl, M.; Langenberg, B.; Roetteler, M.; Steinwandt, R. Applying Grover’s algorithm to AES: Quantum resource estimates. In Proceedings of the Post-Quantum Cryptography: 7th International Workshop, PQCrypto 2016, Fukuoka, Japan, 24–26 February 2016; Springer: Cham, Switzerland, 2016; pp. 29–43. [Google Scholar]
  12. Huang, Z.; Sun, S. Synthesizing Quantum Circuits of AES with Lower T-depth and Less Qubits. In Proceedings of the Advances in Cryptology—ASIACRYPT 2022: 28th International Conference on the Theory and Application of Cryptology and Information Security, Taipei, Taiwan, 5–9 December 2022; Proceedings, Part III. Springer: Cham, Switzerland, 2023. [Google Scholar]
  13. Jang, K.; Baksi, A.; Kim, H.; Song, G.; Seo, H.; Chattopadhyay, A. Quantum analysis of AES. Cryptol. Eprint Arch. 2022, 2022/683. [Google Scholar]
  14. Song, G.; Jang, K.; Kim, H.; Seo, H. A Parallel Quantum Circuit Implementations of LSH Hash Function for Use with Grover’s Algorithm. Appl. Sci. 2022, 12, 10891. [Google Scholar] [CrossRef]
  15. Song, G.; Jang, K.; Kim, H.; Lee, W.K.; Hu, Z.; Seo, H. Grover on SM3. In Proceedings of the Information Security and Cryptology—ICISC 2021: 24th International Conference, Seoul, Republic of Korea, 1–3 December 2021; Revised Selected Papers. Springer: Cham, Switzerland, 2022; pp. 421–433. [Google Scholar]
  16. Zou, J.; Li, L.; Wei, Z.; Luo, Y.; Liu, Q.; Wu, W. New quantum circuit implementations of SM4 and SM3. Quantum Inf. Process. 2022, 21, 181. [Google Scholar] [CrossRef]
  17. Song, G.; Jang, K.; Kim, H.; Eum, S.; Sim, M.; Kim, H.; Lee, W.K.; Seo, H. SPEEDY Quantum Circuit for Grover’s Algorithm. Appl. Sci. 2022, 12, 6870. [Google Scholar] [CrossRef]
  18. Jang, K.; Choi, S.; Kwon, H.; Seo, H. Grover on SPECK: Quantum resource estimates. Cryptol. Eprint Arch. 2020, 2020/640. [Google Scholar]
  19. Almazrooie, M.; Samsudin, A.; Abdullah, R.; Mutter, K.N. Quantum reversible circuit of AES-128. Quantum Inf. Process. 2018, 17, 1–30. [Google Scholar] [CrossRef]
  20. Jang, K.; Song, G.; Kim, H.; Kwon, H.; Kim, H.; Seo, H. Efficient implementation of PRESENT and GIFT on quantum computers. Appl. Sci. 2021, 11, 4776. [Google Scholar] [CrossRef]
  21. Baksi, A.; Jang, K.; Song, G.; Seo, H.; Xiang, Z. Quantum implementation and resource estimates for rectangle and knot. Quantum Inf. Process. 2021, 20, 1–24. [Google Scholar] [CrossRef]
  22. Anand, R.; Maitra, A.; Mukhopadhyay, S. Grover on SIMON. Quantum Inf. Process. 2020, 19, 340. [Google Scholar] [CrossRef]
  23. Jang, K.; Baksi, A.; Breier, J.; Seo, H.; Chattopadhyay, A. Quantum implementation and analysis of Default. Cryptol. Eprint Arch. 2022, 2022/647. [Google Scholar]
  24. Chauhan, A.K.; Sanadhya, S.K. Quantum resource estimates of grover’s key search on aria. In Proceedings of the Security, Privacy, and Applied Cryptography Engineering: 10th International Conference, SPACE 2020, Kolkata, India, 17–21 December 2020; Springer: Cham, Switzerland, 2020; pp. 238–258. [Google Scholar]
  25. Jang, K.; Song, G.; Kwon, H.; Uhm, S.; Kim, H.; Lee, W.K.; Seo, H. Grover on PIPO. Electronics 2021, 10, 1194. [Google Scholar] [CrossRef]
  26. Rahman, M.; Paul, G. Grover on KATAN: Quantum resource estimation. IEEE Trans. Quantum Eng. 2022, 3, 1–9. [Google Scholar] [CrossRef]
  27. Amy, M.; Maslov, D.; Mosca, M. Polynomial-time T-depth optimization of Clifford+T circuits via matroid partitioning. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2014, 33, 1476–1489. [Google Scholar] [CrossRef]
  28. Devitt, S.J.; Stephens, A.M.; Munro, W.J.; Nemoto, K. Requirements for fault-tolerant factoring on an atom-optics quantum computer. Nat. Commun. 2013, 4, 2524. [Google Scholar] [CrossRef]
  29. Dworkin, M.J. SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions; National Institute of Standards and Technology: Gaithersburg, MD, USA, 2015. [Google Scholar]
  30. Dang, Q.H. Secure Hash Standard; National Institute of Standards and Technology: Gaithersburg, MD, USA, 2015. [Google Scholar]
  31. Penard, W.; van Werkhoven, T. On the secure hash algorithm family. Cryptogr. Context 2008, 1–18. [Google Scholar]
  32. Jang, K.; Choi, S.; Kwon, H.; Kim, H.; Park, J.; Seo, H. Grover on Korean block ciphers. Appl. Sci. 2020, 10, 6407. [Google Scholar] [CrossRef]
  33. Jang, K.; Song, G.; Kim, H.; Kwon, H.; Kim, H.; Seo, H. Parallel quantum addition for Korean block ciphers. Quantum Inf. Process. 2022, 21, 373. [Google Scholar] [CrossRef]
  34. Song, G.j.; Jang, K.b.; Seo, H.j. Resource Eestimation of Grover Algorithm through Hash Function LSH Quantum Circuit Optimization. J. Korea Inst. Inf. Secur. Cryptol. 2021, 31, 323–330. [Google Scholar]
Figure 1. Decomposed Toffoli gate. † indicates reversible gates.
Figure 1. Decomposed Toffoli gate. † indicates reversible gates.
Applsci 13 03558 g001
Figure 2. Operation process for SHA3 hash function. (r: block size, c: capacity, f: Keccak-f[1600]).
Figure 2. Operation process for SHA3 hash function. (r: block size, c: capacity, f: Keccak-f[1600]).
Applsci 13 03558 g002
Figure 3. Grover’s algorithm with f g : { 0 , 1 } n { 0 , 1 } n in oracle. † indicates reversible gates.
Figure 3. Grover’s algorithm with f g : { 0 , 1 } n { 0 , 1 } n in oracle. † indicates reversible gates.
Applsci 13 03558 g003
Figure 4. Each part of the three-dimensional bit array matrix state in Keccak-f[1600].
Figure 4. Each part of the three-dimensional bit array matrix state in Keccak-f[1600].
Applsci 13 03558 g004
Figure 5. Quantum circuit for θ . (T: temporary qubits).
Figure 5. Quantum circuit for θ . (T: temporary qubits).
Applsci 13 03558 g005
Table 1. Parameters and pre-image resistance for SHA3 hash function family.
Table 1. Parameters and pre-image resistance for SHA3 hash function family.
AlgorithmHash LengthBlock SizeCapacityPre-Image
SHA3-2242241152448224
SHA3-2562561088512256
SHA3-384384832768384
SHA3-5125125761024512
SHAKE128d1344256≥min(d,128)
SHAKE256d1088512≥min(d,256)
Table 2. The qubit values required for the step-by-step update of the input of chi ( χ ) ; ⊛ indicates a change from the preceding calculation.
Table 2. The qubit values required for the step-by-step update of the input of chi ( χ ) ; ⊛ indicates a change from the preceding calculation.
OrderRequired QubitUpdate Target
x = 0 X [ 1 ] [ y ] [ z ] X [ 2 ] [ y ] [ z ] X [ 0 ] [ y ] [ z ]
x = 1 X [ 2 ] [ y ] [ z ] X [ 3 ] [ y ] [ z ] X [ 1 ] [ y ] [ z ]
x = 2 X [ 3 ] [ y ] [ z ] X [ 4 ] [ y ] [ z ] X [ 2 ] [ y ] [ z ]
x = 3 X [ 4 ] [ y ] [ z ] X [ 0 ] [ y ] [ z ] X [ 3 ] [ y ] [ z ]
x = 4 X [ 0 ] [ y ] [ z ] X [ 1 ] [ y ] [ z ] X [ 4 ] [ y ] [ z ]
Table 3. Quantum resource estimation results for each phase of Keccak-f in SHA3 (Round: quantum resources per round, Total: quantum resources for full round). # incicates the number of gates.
Table 3. Quantum resource estimation results for each phase of Keccak-f in SHA3 (Round: quantum resources per round, Total: quantum resources for full round). # incicates the number of gates.
Function#1qClifford#CNOT#Toffoli#T Depth#Full Depth
θ 024,0000079
ρ 00000
π 00000
χ 320064016002312
ι 20001
Round320224,64016002388
Total76,886591,36038,4005522020
Table 4. Comparison of quantum resources for the-state-of-art SHA3 quantum circuit implementation and proposed SHA3 quantum circuit implementation.
Table 4. Comparison of quantum resources for the-state-of-art SHA3 quantum circuit implementation and proposed SHA3 quantum circuit implementation.
Function#1qClifford#CNOT#Toffoli#T Depth#Full Depth
θ Our method024,0000079
[8]017,60000275
θ 1 Our method00000
[8]01,360,0000025
ρ Our method(Not used)
[8]
π Our method(Not used)
[8]
χ Our method320064016002312
[8]014,400(Not shown)1555
χ 1 Our method00000
[8]018,880(Not shown)1866
ι Our method20001
[8]8500024
Total76,886591,36038,4005522020
Total [8]8533,269,760-79210,128
Table 5. Quantum resources required for the Korean block cipher proposed in [32].
Table 5. Quantum resources required for the Korean block cipher proposed in [32].
Cipher#Toffoli#CNOT#X#Full Depth
LEA [32]128/12810,41628,0806826,328
128/19215,62439,81610039,452
128/25617,85645,50413045,057
HIGHT [32]64/128627220,523416,447
CHAM [32]64/128240012,2852407807
128/128496026,88524019,880
128/256595232,27730423,856
Table 6. Quantum resources required for the Korean block cipher proposed in [33]. (Results for depth reduction compared to Table 5 through quantum resource trade-off).
Table 6. Quantum resources required for the Korean block cipher proposed in [33]. (Results for depth reduction compared to Table 5 through quantum resource trade-off).
Cipher#Toffoli#CNOT#X#Full Depth
LEA [33]128/12810,24832,61611,1526505
128/19215,37246,62017,0047589
128/25617,56853,28019,4948580
HIGHT [33]64/128582422,61444962479
CHAM [33]64/128232013,20023202615
128/128488028,76048805307
128/256585634,94458726594
Table 7. Quantum resources required for LSH hash function proposed in [34].
Table 7. Quantum resources required for LSH hash function proposed in [34].
Cipher#Toffoli#CNOT#X#Full Depth
LSH [34]256/22463,488145,1521536210,051
256/25663,488145,1523492210,049
512/224139,104312,8327663421,851
512/256139,104312,8327696421,851
512/384139,104312,8327668421,850
512/512139,104312,8327680421,852
Table 8. Quantum resources required for LSH hash function proposed in [14]. (Results for depth reduction compared to Table 7 through quantum resource trade-off).
Table 8. Quantum resources required for LSH hash function proposed in [14]. (Results for depth reduction compared to Table 7 through quantum resource trade-off).
Cipher#Toffoli#CNOT#X#Full Depth
LSH [14]256/22462,464170,75259,3926879
256/25662,464170,75259,3926879
512/224138,000375,760134,68814,517
512/256138,000375,760134,68814,517
512/384138,000375,760134,68814,517
512/512138,000375,760134,68814,517
Table 9. Quantum resources required for SHA-256 [8] and SM3 [15] hash functions.
Table 9. Quantum resources required for SHA-256 [8] and SM3 [15] hash functions.
Cipher#X#CNOT#Toffoli#T Depth#Full Depth
SHA-256 [8]0534,272(Not shown)171,552528,768
SM3 [15]2638134,14443,328(Not shown)121,242
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Song, G.; Jang, K.; Seo, H. Improved Low-Depth SHA3 Quantum Circuit for Fault-Tolerant Quantum Computers. Appl. Sci. 2023, 13, 3558. https://0-doi-org.brum.beds.ac.uk/10.3390/app13063558

AMA Style

Song G, Jang K, Seo H. Improved Low-Depth SHA3 Quantum Circuit for Fault-Tolerant Quantum Computers. Applied Sciences. 2023; 13(6):3558. https://0-doi-org.brum.beds.ac.uk/10.3390/app13063558

Chicago/Turabian Style

Song, Gyeongju, Kyungbae Jang, and Hwajeong Seo. 2023. "Improved Low-Depth SHA3 Quantum Circuit for Fault-Tolerant Quantum Computers" Applied Sciences 13, no. 6: 3558. https://0-doi-org.brum.beds.ac.uk/10.3390/app13063558

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop