Fast Implementation for SM4 Cipher Algorithm Based on Bit-Slice Technology
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.
KeywordsSM4 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.Lin, I.C., Liao, T.C.: A survey of blockchain security issues and challenges. Int. J. Netw. Secur. 19, 653–659 (2017)Google Scholar
- 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
- 6.Anderson, R.: Serpent: a proposal for the advanced encryption standard (1998)Google Scholar
- 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
- 11.Canright, D.: A very compact rijndael S-box. Technical Reports Collection 4–5 (2005)Google Scholar