基于复合域SM4密码算法S盒的量子电路实现

Quantum Circuit Implementation of S-box for SM4 Cryptographic Algorithm Based on Composite Field Arithmetic

  • 摘要: S盒是SM4分组密码算法中重要的非线性组件。使用Toffoli门、CNOT门和NOT门构建S盒的量子电路。首先,基于S盒的代数表达式,通过同构映射矩阵,将有限域\rmGF(2^8)中的求逆运算转化到有限域\rm GF((2^4)^2)中的运算;其次,在\rm GF(2^4)中分别给出了平方计算、乘法计算和求逆运算的量子电路;再次,通过最小化同构矩阵中“1”元素的个数,求出最优的同构映射矩阵,并给出相应的量子电路;然后,通过高斯消元法给出S盒表达式中仿射变换的量子电路;最后,综合出SM4密码算法S盒的量子电路。该量子电路的正确性通过IBM量子平台的Aer模拟器进行了验证。复杂度分析表明:所给出S盒的量子电路一共使用了21个量子比特,55个Toffoli门、176个CNOT门和10个NOT门,电路深度为151。相比于已有结果,所使用的量子资源进一步减少,效率进一步提高。

     

    Abstract: The S-box is an important nonlinear component in SM4 block cipher algorithm. In this paper, Toffoli gates, CNOT gates and NOT gates are used to construct the quantum circuit of the S-box. Based on the algebraic expression of the S-box, the inverse operation in finite field \rmGF(2^8) is transformed into operations in finite field \rmGF((2^4)^2) through isomorphic mapping matrices. The quantum circuits of square calculation, multiplication calculation and inversion operation in \rm GF(2^4) are given respectively. By minimizing the number of "1" elements in the isomorphic matrices, the optimal isomorphic mapping matrices are obtained, and the corresponding quantum circuits are given. Then, the quantum circuit of affine transformation in S-box expression is given by Gaussian elimination method; Finally, the quantum circuit of S-box in SM4 cryptographic algorithm is synthesized. The correctness of the quantum circuit is verified by the Aer simulator of IBM quantum platform. The complexity analysis shows that the given quantum circuit of the S-box uses 21 qubits, 55 Toffoli gates, 176 CNOT gates and 10 NOT gates, and the circuit depth is 151. Compared with the existing results, the quantum resources used are further reduced and the efficiency is further improved.

     

/

返回文章
返回