Skip to main content
Log in

Quantum circuit implementations of SM4 block cipher optimizing the number of qubits

  • Published:
Quantum Information Processing Aims and scope Submit manuscript

Abstract

SM4 cryptographic algorithm is a block cipher algorithm issued by China’s state cryptographic administration and has become an international standard. We implement the quantum circuits of SM4 block cipher by optimizing the number of qubits and the value of depth-times-width. The quantum circuits of the S-box are first studied. According to the algebraic structure of the S-box, four kinds of improved quantum circuits of S-box are presented for different phases in SM4 based on composite field arithmetic. In order to optimize the number of qubits, we implement the quantum circuit of SM4 by connecting the quantum subcircuits in series. The implemented quantum circuit of SM4 only uses 260 qubits, which is the least number of qubits used not only in implementing the SM4 quantum circuit, but also in implementing the block cipher algorithms with 8-bit S-box, 128-bit plaintext and 128-bit secret key. When optimizing the value of depth-times-width, we achieve it through parallel implementation. The trade-off quantum circuit uses a total of 288 quantum bits, and the Toffoli depth is 1716. The depth-times-width is 49,4208, which is less than the existing best value 82,5792.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20

Similar content being viewed by others

Availability of supporting data

All data generated or analyzed during this study are included in this published article.

References

  1. Shor, P.W.: polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM J. Comput. 26(5), 1484–1509 (1997)

    Article  MathSciNet  Google Scholar 

  2. Yamamura, A., Ishizuka, H.: Quantum cryptanalysis of block ciphers (algebraic systems, formal languages and computations). RIMS Kokyuroku 1166, 235–243 (2000)

    Google Scholar 

  3. Grover, L. K.: A fast quantum mechanical algorithm for database search. In: Proceedings of the 28th annual ACM symposium on theory of computing (STOC). ACM, 212-219 (1996)

  4. Kaplan, M., Leurent, G., Leverrier, A., et al.: Breakingsymmetric cryptosystems using quantum period finding. In: Annual international cryptology conference, pp. 207–237. Springer, Berlin, Heidelberg (2016)

  5. Simon, D.: On the power of quantum computation. In: Proceedings of the 35th IEEE symposium on the foundations of computer science (FOCS). IEEE, 116-123 (1994)

  6. Leander, G., May, A.: Grover meets Simon-quantumly attacking the FX-construction. In: International conference on the theory and application of cryptology and information security. Cham: Springer, 161-178 (2017)

  7. Dong, X., Wang, X.: Quantum key-recovery attack on Feistel structures. Sci. China Inf. Sci. 61(10), 1–7 (2018)

    Article  Google Scholar 

  8. Hodzic, S., Knudsen, L.R.: A quantum distinguisher for 7/8-round SMS4 block cipher. Quantum Inf. Process. 19(11), 1–22 (2020)

    Article  MathSciNet  Google Scholar 

  9. Bennett, C.: Logical reversibility of computation. IBM J. Res. Dev. 17(6), 525?32 (1973)

    Article  MathSciNet  Google Scholar 

  10. Saravanan, P., Kalpana, P.: Novel reversible design of advanced encryption standard cryptographic algorithm for wireless sensor networks. Wirel. Pers. Commun. 100(4), 1427?58 (2018)

    Article  Google Scholar 

  11. Daemen, J., Rijmen, V.: Specification for the advanced encryption standard (AES). FIPS 197, (2001)

  12. Jaques, S., Naehrig, M., Roetteler, M. et al.: Implementing grover oracles for quantum key search on aes and lowmc. Advances in Cryptology?EUROCRYPT 2020, Zagreb, Croatia, May 10?14, Proceedings, Part II 30 pp. 280?310 (2020)

  13. Li, Z., Cai, B., Sun, H., et al.: Novel quantum circuit implementation of advanced encryption standard with low costs. Sci. Chin. Phys. Mech. Astron. 65(9), 290311 (2022)

    Article  Google Scholar 

  14. Huang, Z., Sun, S.: Synthesizing quantum circuits of AES with lower t-depth and less qubits. Cryptology ePrint Archive, Paper 2022/620, (2022)

  15. Fowler, A. G.: Time-optimal quantum computation. arXiv preprint, 2012, arXiv:1210.4626

  16. Grassl, M., Langenberg, B., Roetteler, M. et al.: Applying grover?s algorithm to AES: Quantum resource estimates. In: Tsuyoshi T (ed), Post-Quantum Cryptography, Cham, Springer, pp. 2943 (2016)

  17. Almazrooie, M., Samsudin, A., Abdullah, R., et al.: Quantum reversible circuit of AES-128. Quantum Inf. Process. 17(5), 1?30 (2018)

    Article  MathSciNet  Google Scholar 

  18. Langenberg, B., Pham, H., Steinwandt, R.: Reducing the cost of implementing the advanced encryption standard as a quantum circuit. IEEE Trans. Quantum Eng. 1, 112 (2020)

    Article  Google Scholar 

  19. Zou, J., Wei, Z., Sun, S. et al.: Quantum circuit implementations of aes with fewer qubits. In: Shiho M, Huaxiong W, (eds.), Advances in cryptology ASIACRYPT pp. 697–726, (2020)

  20. Wang, Z.G., Wei, S.J., Long, G.L.: A quantum circuit design of AES requiring fewer quantum qubits and gate operations. Front. Phys. 17(4), 1–7 (2022)

    Article  Google Scholar 

  21. Luo, Q.B., Yang, G.W., Li, X.Y., et al.: Quantum reversible circuits for multiplicative inverse. EPJ Quantum Technol. 9(1), 24 (2022)

    Article  Google Scholar 

  22. Li, Z., Gao, F., Qin, S., et al.: New record in the number of qubits for a quantum implementation of AES. Front. Phys. 11, 1171753 (2023)

  23. Chauhan, V., Negi, S., Jain, D., et al.: . Quantum computers: a review on how quantum computing can boom AI. In: 2022 2nd International conference on advance computing and innovative technologies in engineering (ICACITE), IEEE, 2022, pp. 559-563 (2022)

  24. Technical Committee of ISO/IEC JTC 1/SC 27 Information security, cybersecurity and privacy protection. International standard ISO/IEC 18033-3:2010/AMD 1:2021 information technology-security techniques-Encryption algorithms ? Part 3: Block ciphers ? Amendment 1: SM4 [S]. ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission), 2021

  25. Zou, J., Li, L., Wei, Z., et al.: New quantum circuit implementations of SM4 and SM3. Quantum Inf. Process. 21(5), 181 (2022)

    Article  MathSciNet  Google Scholar 

  26. Lin, D., Xiang, Z.J., Zhuang, R.L., et al.: Quantum implementation of SM4. J. Cryptol. Res. 8(6), 999–1018 (2021)

    Google Scholar 

  27. Luo, Q.B., Li, X.Y., Yang, G.W.: Quantum circuit implementation of S-box for SM4 cryptographic algorithm. J. Univ. Electron. Sci. Technol. China 50(6), 820–826 (2021)

    Google Scholar 

  28. Luo, Q.B., Li, X.Y., Yang, G.W., et al.: Quantum circuit implementation of S-box for SM4 cryptographic algorithm based on composite field arithmetic. J. Univ. Electron. Sci. Technol. China 51(6), 812–818 (2022)

    Google Scholar 

  29. Nielsen, M.A., Chuang, I.: Quantum Computation and Quantum Information. Cambridge University Press, Cambridge (2002)

    Google Scholar 

  30. Shende, V.V., Prasad, A.K., Markov, I.L., et al.: Synthesis of reversible logic circuits. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 22(6), 710–722 (2003)

    Article  Google Scholar 

  31. Saeedi, M., Markov, I.L.: Synthesis and optimization of reversible circuits? A survey. ACM Comput. Surv. 45(2), 1–34 (2013)

    Article  Google Scholar 

  32. Lv, S.W., Su, B.Z., Wang, P., et al.: Overview on SM4 algorithm. J. Inform. Sec. Res 2(11), 995–1007 (2016)

    Google Scholar 

  33. Liu, F., Ji, W., Hu, L.: Analysis of the SMS4 Block Cipher//Information Security and Privacy, pp. 158–170. Springer, Berlin, Heidelberg (2007)

    Book  Google Scholar 

  34. Yang, G.W., Song, X.Y., Hung, W.N., et al.: Bi-directional synthesis of 4-bit reversible circuits. Comput. J. 51(2), 207–215 (2008)

    Article  Google Scholar 

  35. Dasu, V.A., Baksi, A., Sarkar, S., LIGHTER-R: optimized reversible circuit implementation for sboxes. In: 32nd IEEE International system-on-chip conference (SOCC). IEEE 2019, 260–265 (2019)

  36. Reyhani-Masoleh, A., Hasan, M.A.: Low complexity bit parallel architectures for polynomial basis multiplication over \(GF(2^m)\)[J]. IEEE Trans. Comput. 53(8), 945–959 (2004)

    Article  Google Scholar 

  37. Luo, Q.B., Li, X.Y., Yang, G.W., et al.: Quantum reversible circuits for \(GF(2^8)\) multiplication based on composite field arithmetic operations. Quantum Inf. Process. 22(1), 58 (2023)

    Article  Google Scholar 

  38. Zeng, X., Yang, G., Song, X., et al.: Detecting affine equivalence of Boolean functions and circuit transformation. Comput. J. (2022). https://doi.org/10.1093/comjnl/bxac072

    Article  Google Scholar 

  39. Xiang, Z., Zeng, X., Lin, D., et al.: Optimizing implementations of linear layers. IACR Trans. Symmetric Cryptol. pp. 120-145 (2020)

  40. Davenport, J. H., Pring, B.: Improvements to quantum search techniques for block-ciphers, with applications to AES. In: International conference on selected areas in cryptography. Cham: Springer International Publishing , pp. 360-384 (2020)

Download references

Acknowledgements

The authors would like to thank the editor and the referees for carefully reading the paper, and for their useful comments which helped improve the paper.

Funding

This work is supported by the Natural Sciences Foundation of Hubei Province (Grant No. 2020CFB326), the National Natural Science Foundation of China (Grant Nos.62262020,12164037), the National Key R &D Program of China (Grant No. 2018YFA0306703), and the Open Fund of Advanced Cryptography and System Security Key Laboratory of Sichuan Province (Grant No. SKLACSS-202105).

Author information

Authors and Affiliations

Authors

Contributions

The original idea to this paper came from Qingbin Luo. All authors contributed to the preparation of the manuscript. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Qing-bin Luo.

Ethics declarations

Conflict of interest

All authors declare that they have no conflict of interest.

Ethical Approval and consent to participate

Not applicable.

Consent for publication

We give our consent for the publication of identifiable details within the text to be published in Quantum Information Processing.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

A Specific optimized quantum circuit of S-box for \({\mathcal {C}}_1\)

A Specific optimized quantum circuit of S-box for \({\mathcal {C}}_1\)

In appendix section, we present the specific optimized quantum circuit of S-box for \({\mathcal {C}}_1\), which is implemented by using Qiskit quantum computing software, and the circuit wire switchings are realized by using quantum SWAP gates. The correctness of the quantum circuit is verified by using the Aer simulator of IBM quantum platform (Fig. 20).

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Luo, Qb., Li, Q., Li, Xy. et al. Quantum circuit implementations of SM4 block cipher optimizing the number of qubits. Quantum Inf Process 23, 177 (2024). https://doi.org/10.1007/s11128-024-04394-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11128-024-04394-x

Keywords

Navigation