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.