STDA045 November   2026 MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G1518 , MSPM0G1519 , MSPM0G3505 , MSPM0G3506 , MSPM0G3507 , MSPM0G3518 , MSPM0G3519

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2ED25519PH Algorithm Introduction
  6. 3MSPM0G Math Accelerator (MATHACL)
    1. 3.1 MATHACL Module
    2. 3.2 Multiply-Accumulate (MAC) Operation
  7. 4Accelerate the ED25519PH Algorithm by Using MATHACL
    1. 4.1 Loop Unrolled Implementation
      1. 4.1.1 Non-MATHACL Optimization
      2. 4.1.2 MATHACL Optimization
    2. 4.2 Loop Rolled Implementation
      1. 4.2.1 Non-MATHACL Optimization
      2. 4.2.2 MATHACL Optimization
    3. 4.3 Benchmark
  8. 5Summary
  9. 6References

Introduction

Asymmetric (public-key) cryptography is essential for securing embedded devices, enabling critical functions like secure boot, encrypted cloud communication (TLS), and digital identity verification. Among these methods, elliptic curve cryptography (ECC) is preferred for microcontrollers because ECC provides high security with much smaller keys than traditional RSA. A leading standard in this field is the ED25519PH algorithm (standardized in RFC 8032), which is widely used in modern protocols like TLS 1.3 due to the speed and resistance to side-channel attacks.

Despite the benefits of the ED25519PH algorithm, the performance of ED25519PH is heavily dependent on efficient 256-bit multi-precision multiplication. On Arm Cortex-M0+ (ARMv6-M) microcontrollers, this is a significant challenge, since the ARMv6-M instruction set lacks a native 32x32 to 64-bit multiplication instruction, 32-bit arithmetic must be handled using software emulation (such as the __aeabi_lmul software of Clang). This approach is highly inefficient since the function requires 30+ instructions for function call preparation and digital calculation.

To solve this problem, this document proposes an improved implementation for the MSPM0G series that utilizes the hardware-accelerated MATHACL peripheral. By offloading 32x32 to 64-bit multiplication and multiply-accumulate (MAC) tasks to hardware, the execution time is reduced from dozens of instructions to just seven clock cycles. This approach significantly enhances the performance of the ED25519PH algorithm on resource-constrained embedded systems, which can achieve increased speeds of three to five times the current speed of a pure software implementation on the Arm Cortex-M0+ core.