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

Abstract

This document presents an efficient implementation of the ED25519PH elliptic curve cryptography algorithm (from the Libsodium library) improved for the MSPM0G microcontrollers with the MATHACL module. While the Arm® Cortex®-M0+ core provides a 32-bit ALU, the core lacks a native 32x32 to 64-bit multiplication instruction, necessitating software-based multi-precision arithmetic for 256-bit operations. This document proposes a hybrid implementation that offloads critical arithmetic tasks to the MATHACL peripheral, which supports 32x32 to 64-bit multiplication and multiply-accumulate (MAC) operations. The approach improves both runtime and code density, achieving increased speeds of three to five times the current speed of a pure software implementation on the Arm Cortex-M0+ core, depending on the target code size constraints. The CCS example project of the optimized ED25519PH algorithm based on the MSPM0G3519 device is accessed in ED25519PH_crypto_mspm0g3519.