SM4密码算法S盒的量子电路优化OA北大核心CSTPCD
Quantum Circuit Optimization for SM4 Cryptographic Algorithm S-Box
S盒是SM4密码算法中的重要非线性组件.首先基于复合域理论,将S盒代数表达式中有限域GF(28)中的运算同构到复合域GF((24)2)中的运算,然后使用NCT门库逐步构建并优化各个运算的量子电路,最后综合出完整的S盒量子电路.为降低Toffoli门的使用量,根据GF(24)中乘法计算的代数表达式,选取使用Toffoli门最少的量子电路.为了降低CNOT门的使用量,主要从三方面优化:一是使用最优的CNOT电路综合出4阶矩阵的量子电路;二是采用置换矩阵法以及优化子电路的方式综合出8阶矩阵的量子电路;三是通过先合并计算再综合的思路优化整个S盒中CNOT门的数量.该S盒量子电路使用Qiskit Aer量子模拟器实现,并验证了其正确性.经量子资源分析,该优化的S盒量子电路一共使用了 21个量子比特、10个NOT门、152个CNOT门和34个Toffoli 门,电路深度为97.Toffoli门数量、总量子逻辑门数量、电路深度等相比已有结果都有较大减少.
The S-box is an important nonlinear component in the SM4 cryptographic algorithm.The quantum circuit for SM4 can be designed by the following steps:Firstly,based on the composite field theory,the operations of the S-box over the finite field GF(28)are mapped to that over the composite field GF((24)2)with an isomorphic mapping,and then the quantum circuits of the individual operations are gradually constructed and optimized using the NCT gate library,finally,a complete S-box quantum circuit is designed.To reduce the usage of Toffoli gates,the quantum circuit that uses the least number of Toffoli gates is selected according to the algebraic expression of multiplicative operation over GF(24).In order to reduce the amount of CNOT gates,this paper focuses on three aspects of optimization:first,to synthesize the quantum circuit of the 4th order matrix using the optimal CNOT circuit.Second,to synthesize the quantum circuit of the 8th order matrix by using the substitution matrix and the optimized subcircuit.Third,to optimize the number of CNOT gates of the whole S-box by the idea of combining the calculations and then synthesizing.This S-box quantum circuit is implemented using the Qiskit Aer quantum simulator and its correctness is verified.After quantum resource analysis,the optimized S-box quantum circuit uses a total of 21 qubits,10 NOT gates,152 CNOT gates and 34 Toffoli gates,and the circuit depth is 97.Compared with the existing results,both the number of Toffoli gates,the total number of sub-logic gates and the circuit depth are greatly reduced.
李强;罗庆斌;吕轶;郑圆梦;沈济南
湖北民族大学智能科学与工程学院,恩施 445000湖北民族大学智能科学与工程学院,恩施 445000||电子科技大学信息与软件工程学院,成都 611731
计算机与自动化
量子电路SM4S盒复合域优化
quantum circuitSM4S boxcomposite fieldoptimization
《密码学报》 2024 (002)
455-465 / 11
国家自然科学基金(62262020,12164037);湖北省自然科学基金(2020CFB326);湖北民族大学研究生科研创新资助项目(MYK2023074)National Natural Science Foundation of China(62262020,12164037);National Natural Science Foun-dation of Hubei Province(2020CFB326);Graduate Research Innovation Funding Project of Hubei Minzu University(MYK2023074)
评论