Skip to main content
Log in

New quantum circuit implementations of SM4 and SM3

  • Published:
Quantum Information Processing Aims and scope Submit manuscript

Abstract

In this paper, we propose some new quantum circuit implementations of SM4 block cipher and SM3 hash function, which are based on the following ideas. Firstly, we propose an improved classical circuit of SM4’s S-box, which requires less AND gates than the previous works. Our improved classical circuit of SM4’s S-box can be used for constructing a new quantum circuit of SM4’s S-box. Secondly, we propose a new implementation of the Feistel-like structure of SM4 so as to reduce the number of qubits and T-depth simultaneously. Thirdly, we reduce the number of qubits in our quantum circuit of SM3 by making use of linear message expansion algorithm of SM3. Fourthly, we propose some in-place implementations of the linear permutations of SM4 and SM3. Based on our new techniques, our stand-alone memory-efficient quantum circuit implementation of SM4 only requires 384 qubits, seven ancilla qubits and 33,024 T-depth, while our depth-efficient quantum circuit of SM4 requires 384 qubits, 1080 ancilla qubits and 455 T-depth. Furthermore, we propose a stand-alone memory-efficient quantum circuit implementation of SM3 with 768 qubits, 33 ancilla qubits and 144,768 T-depth, while our depth-efficient quantum circuit of SM3 requires 768 qubits, 202 ancilla qubits, and 25,344 T-depth. Compared to the previous work, our new quantum circuits of SM3 requires less qubits and T-depth.

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

Similar content being viewed by others

Data Availability

The datasets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request.

References

  1. Abbasi, I., Afzal, M.: A compact s-box design for SMS4 block cipher. IACR Cryptol. ePrint Arch. 2011, 522 (2011)

    Google Scholar 

  2. Aaronson, S., Gottesman, D.: Improved simulation of stabilizer circuits. CoRR, arXiv:quant-ph/0406196 (2004)

  3. Amy, M., Di Matteo, O., Gheorghiu, V., Mosca, M., Parent, A., Schanck, J.M.: Estimating the cost of generic quantum pre-image attacks on SHA-2 and SHA-3. In: Avanzi, R., Heys, H.M. (Eds.) Selected Areas in Cryptography—SAC 2016—23rd International Conference, St. John’s, NL, Canada, August 10–12, 2016, Revised Selected Papers, volume 10532 of Lecture Notes in Computer Science, pp. 317–337. Springer (2016)

  4. Amy, M., Maslov, D., Mosca, M., Roetteler, M.: A meet-in-the-middle algorithm for fast synthesis of depth-optimal quantum circuits. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 32(6), 818–830 (2013)

    Article  Google Scholar 

  5. Almazrooie, M., Samsudin, A., Abdullah, R., Mutter, K.N.: Quantum reversible circuit of AES-128. Quantum Inf. Process. 17(5), 112 (2018)

    Article  MathSciNet  Google Scholar 

  6. Banegas, G., Bernstein, D.J., van Hoof, I., Lange, T.: Concrete quantum cryptanalysis of binary elliptic curves. IACR Trans. Cryptogr. Hardw. Embed. Syst. 2021(1), 451–472 (2021)

    Google Scholar 

  7. Boyar, J., Peralta, R.: A new combinational logic minimization technique with applications to cryptology. In: Festa, P. (Ed.) Proceedings of the Experimental Algorithms, 9th International Symposium, SEA 2010, Ischia Island, Naples, Italy, May 20–22, 2010, volume 6049 of Lecture Notes in Computer Science, pp. 178–189. Springer (2010)

  8. Boyar, J., Peralta, R.: A small depth-16 circuit for the AES s-box. In: Gritzalis, D., Furnell, S., Theoharidou, M. (Ed.) Proceedings of the Information Security and Privacy Research—27th IFIP TC 11 Information Security and Privacy Conference (SEC 2012), Heraklion, Crete, Greece, June 4–6, 2012, volume 376 of IFIP Advances in Information and Communication Technology, pp. 287–298. Springer (2012)

  9. Bai, X., Xu, Y., Li, G.: Securing sms4 cipher against differential power analysis and its vlsi implementation. In: IEEE Singapore International Conference on Communication Systems (2009)

  10. Canright, D.: A very compact s-box for AES. In: Rao, J.R., Sunar, B. (Ed.) , Proceedings of the Cryptographic Hardware and Embedded Systems—(CHES 2005), 7th International Workshop, Edinburgh, UK, August 29–September 1, 2005, volume 3659 of Lecture Notes in Computer Science, pp. 441–455. Springer (2005)

  11. Cuccaro, S.A., Draper, T.G., Kutin, S.A., Moulton, D.P.: A new quantum Ripple–Carry addition circuit. (2004). arXiv:quant-ph/0410184

  12. Cao, X.-Y., Jie, G., Yu-Shuo, L., Yin, H.-L., Chen, Z.-B.: Coherent one-way quantum conference key agreement based on twin field. New J. Phys. 23(4), 043002 (2021)

    Article  ADS  Google Scholar 

  13. Draper, T.G., Kutin, S.A., Rains, E.M., Svore, K.M.: A logarithmic-depth quantum carry-lookahead adder. Quantum Inf. Comput. 6(4), 351–369 (2006)

    MathSciNet  MATH  Google Scholar 

  14. Fu, Y., Yin, H.-L., Chen, T.-Y., Chen, Z.-B.: Long-distance measurement-device-independent multiparty quantum communication. Phys. Rev. Lett. 114(9), 090501 (2015)

    Article  ADS  Google Scholar 

  15. Gu, J., Cao, X.-Y., Yin, H.-L., Chen, Z.-B.: Differential phase shift quantum secret sharing using a twin field. Opt. Express 29(6), 9165–9173 (2021)

  16. Grassl, M., Langenberg, B., Roetteler, M., Steinwandt, R: Applying grover’s algorithm to AES: quantum resource estimates. In: Takagi, T. (Ed.) Proceedings of the post-Quantum Cryptography—7th International Workshop (PQCrypto 2016), Fukuoka, Japan, February 24–26, 2016, volume 9606 of Lecture Notes in Computer Science, pp. 29–43. Springer (2016)

  17. Grice, W.P., Qi, B.: Quantum secret sharing using weak coherent states. Phys. Rev. A 100(2), 022339 (2019)

    Article  ADS  Google Scholar 

  18. Gu, J., Xie, Y.-M., Liu, W.-B., Fu, Y., Yin, H.-L., Chen, Z.-B.: Secure quantum secret sharing without signal disturbance monitoring. Opt. Express 29(20), 32244–32255 (2021)

    Article  ADS  Google Scholar 

  19. Google AI Quantum and collaborators: Quantum supremacy using a programmable superconducting processor. Nature 574, 505–510 (2019)

  20. Hosoyamada, A., Sasaki, Y.: Cryptanalysis against symmetric-key schemes with online classical queries and offline quantum computations. In: Smart, N.P. (Ed.) Topics in Cryptology - CT-RSA 2018—The Cryptographers’ Track at the RSA Conference 2018, San Francisco, CA, USA, April 16–20, 2018, Proceedings, volume 10808 of Lecture Notes in Computer Science, pp. 198–218. Springer (2018)

  21. Jaques, S., Naehrig, M., Roetteler, M., Virdia, F.: Implementing grover oracles for quantum key search on AES and lowmc. In: Canteaut, A., Ishai, Y. (Ed.) Proceedings of the Advances in Cryptology—EUROCRYPT 2020—39th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Zagreb, Croatia, May 10–14, 2020, Part II, volume 12106 of Lecture Notes in Computer Science, pp. 280–310. Springer (2020)

  22. Kim, P., Han, D., Jeong, K.C.: Time-space complexity of quantum search algorithms in symmetric cryptanalysis: applying to AES and SHA-2. Quantum Inf. Process. 17(12), 339 (2018)

    Article  ADS  MathSciNet  Google Scholar 

  23. Li, Z., Cao, X.-Y., Li, C.-L., Weng, C.-X., Jie, G., Yin, H.-L., Chen, Z.-B.: Finite-key analysis for quantum conference key agreement with asymmetric channels. Quantum Scie. Technol. 6(4), 045019 (2021)

    Article  ADS  Google Scholar 

  24. Lu, Y.-S., Cao, X.-Y., Weng, C.-X., Gu, J., Xie, Y.-M., Zhou, M.-G., Yin, H.-L., Chen, Z.-B.: Efficient quantum digital signatures without symmetrization step. Opt. Express 29(7), 10162–10171 (2021)

    Article  ADS  Google Scholar 

  25. Langenberg, B., Pham, H., Steinwandt, R.: Reducing the cost of implementing AES as a quantum circuit. IACR Cryptol. ePrint Arch. 2019, 854 (2019)

    Google Scholar 

  26. Lucamarini, M., Yuan, Z.L., Dynes, J.F., Shields, A.J.: Overcoming the rate-distance limit of quantum key distribution without quantum repeaters. Nature 557(7705), 400–403 (2018)

    Article  ADS  Google Scholar 

  27. Martínez-Herrera, A.F., Mex-Perera, J.C., Nolazco-Flores, J.A.: Some representations of the s-box of camellia in GF(((2\({}^{\text{2}}\))\({}^{\text{2 }}\))\({}^{\text{2 }}\)). In: Pieprzyk, J., Sadeghi, A-R., Manulis, M. (Eds.) Proceedings of the Cryptology and Network Security, 11th International Conference, CANS 2012, Darmstadt, Germany, December 12–14, 2012, volume 7712, pp. 296–309. Springer (2012)

  28. Martínez-Herrera, A.F., Mex-Perera, J.C., Nolazco-Flores, J.A.: Merging the camellia, SMS4 and AES s-boxes in a single s-box with composite bases. In: Desmedt, Y. (Ed.) Proceedings of the Information Security, 16th International Conference, ISC 2013, Dallas, Texas, USA, November 13–15, 2013, volume 7807 of Lecture Notes in Computer Science, pp. 209–217. Springer (2013)

  29. Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information (10th Anniversary Edition). Cambridge University Press (2016)

  30. NIST: Advanced Encryption Standard (AES), FIPS PUB 197 (2001)

  31. NIST: Secure Hash Standard (SHS), FIPS PUB 180-4 (2015)

  32. Office of state commercial cryptography administration: Announcement of 6 cryptographic standards (in Chinese). http://www.oscca.gov.cn/News/201204/News 1228.htm

  33. Peng, Q., Guo, Y., Liao, Q., Ruan, X.: Satellite-to-submarine quantum communication based on measurement-device-independent continuous-variable quantum key distribution. Quantum Inf. Process. 21(2), 1–19 (2022)

    Article  Google Scholar 

  34. Proietti, M., Ho, J., Grasselli, F., Barrow, P., Malik, M., Fedrizzi, A: Experimental quantum conference key agreement. Sci. Adv. 7(23):eabe0395 (2021)

  35. Roberts, G.L., Lucamarini, M., Yuan, Z.L., Dynes, J.F., Comandar, L.C., Sharpe, A.W., Shields, A.J., Curty, M., Puthoor, I.V., Andersson, E.: Experimental measurement-device-independent quantum digital signatures. Nat. Commun. 8(1), 1–7 (2017)

  36. Roetteler, M., Naehrig, M., Svore, K.M., Lauter, K.E.: Quantum resource estimates for computing elliptic curve discrete logarithms. In: Takagi, T., Peyrin, T. (Ed.), Proceedings of the Advances in Cryptology—ASIACRYPT 2017—23rd International Conference on the Theory and Applications of Cryptology and Information Security, Hong Kong, China, December 3–7, 2017, Part II, volume 10625 of Lecture Notes in Computer Science, pp. 241–270. Springer (2017)

  37. Song, G., Jang, K., Kim, H., Lee, W.-K., Zhi, H., Seo, H.: Grover on SM3. IACR Cryptol. ePrint Arch. 2021, 668 (2021)

    Google Scholar 

  38. Specification of sm3 cryptographic hash function (in Chinese). http://www.oscca.gov.cn/UpFile/20101222141857786.pdf/

  39. Toffoli, T: Reversible computing. In: de Bakker, J.W., van Leeuwen, J. (Ed.), Proceedings of the Automata, Languages and Programming, 7th Colloquium, Noordweijkerhout, The Netherlands, July 14–18, 1980, volume 85 of Lecture Notes in Computer Science, pp. 632–644. Springer (1980)

  40. Wei, Z., Sun, S., Lei, H., Wei, M., Boyar, J., Peralta, R.: Scrutinizing the tower field implementation of the f\(_{2^8}\) inverter—with applications to aes, camellia, and SM4. IACR Cryptol. ePrint Arch. 2019, 738 (2019)

    Google Scholar 

  41. Xiang, Z., Zeng, X., Lin, D., Bao, Z., Zhang, S.: Optimizing implementations of linear layers. IACR Trans. Symm. Cryptol. 2020(2), 120–145 (2020)

    Article  Google Scholar 

  42. Yin, H.-L., Yao, F., Chen, Z.-B.: Practical quantum digital signature. Phys. Rev. A 93, 032316 (2016)

    Article  ADS  Google Scholar 

  43. Zou, J., Dong, L., Wenling, W.: New algorithms for the unbalanced generalised birthday problem. IET Inf. Secur. 12(6), 527–533 (2018)

    Article  Google Scholar 

  44. Zou, J., Liu, Y., Dong, L.: An efficient quantum multi-collision search algorithm. IEEE Access 8, 181619–181628 (2020)

    Article  Google Scholar 

  45. Zou, J., Wei, Z., Sun, S., Liu, X., Wu, W.: Quantum circuit implementations of aes with fewer qubits. In: Advances in Cryptology—ASIACRYPT 2020—the 26th Annual International Conference on the Theory and Application of Cryptology and Information Security, Lecture Notes in Computer Science. Springer (2020)

Download references

Acknowledgements

We would like to thank anonymous referees for their helpful comments and suggestions. Jian Zou is supported by the National Natural Science Foundation of China (No.61902073), Natural Science Foundation of Fujian Province (2021J01623). Yiyuan Luo is supported by the National Natural Science Foundation of China (No.62072207). Wenling Wu is supported by the National Natural Science Foundation of China (No.62072445).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jian Zou.

Additional information

Publisher's Note

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

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zou, J., Li, L., Wei, Z. et al. New quantum circuit implementations of SM4 and SM3. Quantum Inf Process 21, 181 (2022). https://doi.org/10.1007/s11128-022-03518-5

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11128-022-03518-5

Keywords

Navigation