Journal of East China Normal University(Natural Science) ›› 2022, Vol. 2022 ›› Issue (4): 67-78.doi: 10.3969/j.issn.1000-5641.2022.04.007

• Computer Science • Previous Articles     Next Articles

Assembly optimization of an AES-128-CTR algorithm based on a Cortex-M4 core

Dongxuan YANG1(), Ganggang ZHANG2,*(), Xinliang LIU1   

  1. 1. School of E-commerce and Logistics, Beijing Technology and Business University, Beijing 100048, China
    2. Digital Campus, Capital Normal University, Beijing 100048, China
  • Received:2021-03-23 Online:2022-07-25 Published:2022-07-19
  • Contact: Ganggang ZHANG E-mail:yangdongxuan@btbu.edu.cn;zgg@cnu.edu.cn

Abstract:

With the rapid development of the Internet of Things, embedded hardware products face great challenges in data security. The AES (Advanced Encryption Standard) algorithm has the advantages of strong attack resistance, fast operation speed and flexible block length in the field of data encryption and decryption. The speed of this algorithm on microcontroller platforms is far inferior to general-purpose CPUs (Central Processing Units) which have an extended instruction set for AES encryption. To solve this problem, a speed optimized AES algorithm in CTR (Counter) mode based on the Cortex-M4 core instruction set is implemented using assembly language. The kernel’s unique barrel shifter and three-stage pipeline are used to optimize the round transformation of the algorithm, and the number of instruction cycles is reduced. Testing on an FRDM-K82F development board shows that the assembly optimization of the algorithm is substantially more efficient than the code implemented using the C language, and it offers more advantages in both cost and power consumption compared to hardware encryption based on the coprocessor.

Key words: assembly optimization, AES, Cortex-M4

CLC Number: