Paper 2021/667

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

Hyeokdong Kwon
Hyunjun Kim
Siwoo Eum
Minjoo Sim
Hyunji Kim
Wai-Kong Lee
Zhi Hu
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).

PDF
BibTeX
ePrint ↗
@misc{cryptoeprint:2021/667,
      author = {Hyeokdong Kwon and Hyunjun Kim and Siwoo Eum and Minjoo Sim and Hyunji Kim and Wai-Kong Lee and Zhi Hu and Hwajeong Seo},
      title = {Optimized Implementation of SM4 on AVR Microcontrollers, RISC-V Processors, and ARM Processors},
      howpublished = {Cryptology {ePrint} Archive, Paper 2021/667},
      year = {2021},
      url = {https://eprint.iacr.org/2021/667}
}
Category
Implementation
License
CC BY
Submitted
Updated
Versions

Report a problem

Comments

Log in or create an account

Privacy