Cryptology ePrint Archive: Report 2021/667

Optimized Implementation of SM4 on AVR Microcontrollers, RISC-V Processors, and ARM Processors

Hyeokdong Kwon and Hyunjun Kim and Siwoo Eum and Minjoo Sim and Hyunji Kim and Wai-Kong Lee and Zhi Hu and Hwajeong Seo

Abstract: The SM4 block cipher is a Chinese domestic crpytographic that was introduced in 2003. Since the algorithm was developed for the use in wireless sensor networks, it is mandated in the Chinese National Standard for Wireless LAN WAPI (Wired Authentication and Privacy Infrastructure). The SM4 block cipher uses a 128-bit block size and a 32-bit round key. This consists of 32 rounds and one reverse translation \texttt{R}. In this paper, we present the optimized implementation of the SM4 block cipher on 8-bit AVR microcontrollers, which are widely used in wireless sensor devices, the optimized implementation of the SM4 block cipher on 32-bit RISC-V processors, which are open-source based computer architectures, and the optimized implementation of SM4 on 64-bit ARM processors with the parallel computation, which are widely used in smartphone and tablet. In the AVR microcontroller, it is implemented in three versions, including speed-optimization, memory-optimization, and code-optimization. As a result, speed-optimization, memory-optimization, and code-optimization achieved 205.2 cycles per byte, 213.3 cycles per byte and 207.4 cycles per byte, respectively. This is faster than the reference implementation written in C (1670.7 cycles per byte). The implementation on 32-bit RISC-V processors 128.8 cycles per byte. This is faster than the reference C code implementation (345.7 cycles per byte). The implementation on 64-bit ARM processors is 8.62 cycles per byte. This is faster than the reference C code implementation (120.07 cycles per byte).

Category / Keywords: implementation / 8-bit AVR Microcontrollers, 32-bit RISC-V Processors, 64-bit ARM Processors, Software Implementation, SM4 Block Cipher

Date: received 21 May 2021, last revised 18 Jun 2021

Contact author: hwajeong84 at gmail com, shuraatum at gmail com, korlethean at gmail com, khj930704 at gmail com, minjoos9797 at gmail com, khj1594012 at gmail com

Available format(s): PDF | BibTeX Citation

Version: 20210618:140915 (All versions of this report)

Short URL: ia.cr/2021/667


[ Cryptology ePrint archive ]