Fast Implementation for SM4 Cipher Algorithm Based on Bit-Slice Technology

  • Jingbin Zhang
  • Meng MaEmail author
  • Ping WangEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11344)


The SM4 block cipher algorithm used in IEEE 802.11i standard is released by the China National Cryptographic Authority and is one of the most important symmetric cryptographic algorithms in China. However, whether in the round encryption or key expansion phase of the SM4 algorithm, a large number of bit operations on the registers (e.g., circular shifting) are required. These operations are not effective to encryption in scenarios with large-scale data. In traditional implementations of SM4, different operands are assigned to different words and are processed serially, which can bring redundant operations in the process of encryption and decryption. Bit-slice technology places the same bit of multiple operands into one word, which facilitates bit-level operations in parallel. Bit-slice is actually a single instruction parallel processing technology for data, hence it can be accelerated by the CPU’s multimedia instructions. In this paper, we propose a fast implementation of the SM4 algorithm using bit-slice techniques. The experiment proves that the Bit-slice based SM4 is more efficient than the original version. It increases the encryption and decryption speed of the message by an average of 80%–120%, compared with the original approach.


SM4 Bit-slice technology Block cipher algorithm Substitution-Box (S-box) Efficiency 



This work is supported in part by National Key R&D Program of China No. 2016YFB0800603, No. 2017YFB1200700, and National Natural Science Foundation of China No. 61701007.


  1. 1.
    Lin, I.C., Liao, T.C.: A survey of blockchain security issues and challenges. Int. J. Netw. Secur. 19, 653–659 (2017)Google Scholar
  2. 2.
    Atzei, N., Bartoletti, M., Cimoli, T.: A survey of attacks on ethereum smart contracts (SoK). In: Maffei, M., Ryan, M. (eds.) POST 2017. LNCS, vol. 10204, pp. 164–186. Springer, Heidelberg (2017). Scholar
  3. 3.
    Pu, S., et al.: Boolean matrix masking for SM4 block cipher algorithm. In: International Conference on Computational Intelligence and Security, pp. 238–242(2018)Google Scholar
  4. 4.
    Biham, E.: A fast new DES implementation in software. In: Biham, E. (ed.) FSE 1997. LNCS, vol. 1267, pp. 260–272. Springer, Heidelberg (1997). Scholar
  5. 5.
    Rebeiro, C., Selvakumar, D., Devi, A.S.L.: Bitslice implementation of AES. In: Pointcheval, D., Mu, Y., Chen, K. (eds.) CANS 2006. LNCS, vol. 4301, pp. 203–212. Springer, Heidelberg (2006). Scholar
  6. 6.
    Anderson, R.: Serpent: a proposal for the advanced encryption standard (1998)Google Scholar
  7. 7.
    Scheibelhofer, K.: A bit-slice implementation of the whirlpool hash function. In: Abe, M. (ed.) CT-RSA 2007. LNCS, vol. 4377, pp. 385–401. Springer, Heidelberg (2006). Scholar
  8. 8.
    Zhang, W.T., Bao, Z.Z., Lin, D.D., Rijmen, V., Han, Y.B., Verbauwhede, I.: RECTANGLE: a bit-slice lightweight block cipher suitable for multiple platforms. Sci. China Inf. Sci. 58, 1–15 (2015)Google Scholar
  9. 9.
    Matsui, M., Nakajima, J.: On the power of bitslice implementation on intel Core2 processor. In: Paillier, P., Verbauwhede, I. (eds.) CHES 2007. LNCS, vol. 4727, pp. 121–134. Springer, Heidelberg (2007). Scholar
  10. 10.
    Canright, D.: A very compact S-Box for AES. In: Rao, J.R., Sunar, B. (eds.) CHES 2005. LNCS, vol. 3659, pp. 441–455. Springer, Heidelberg (2005). Scholar
  11. 11.
    Canright, D.: A very compact rijndael S-box. Technical Reports Collection 4–5 (2005)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  1. 1.School of Electronics Engineering and Computer SciencePeking UniversityBeijingChina
  2. 2.National Engineering Research Center for Software EngineeringPeking UniversityBeijingChina
  3. 3.School of Software and MicroelectronicsPeking UniversityBeijingChina
  4. 4.Key Laboratory of High Confidence Software TechnologiesPeking University, Ministry of EducationBeijingChina

Personalised recommendations