Who is this for?

This is an advanced topic for software developers and cryptography enthusiasts interested in implementing and testing post-quantum cryptographic algorithms on Arm Cortex-M4 microcontrollers.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Describe the design goals and supported algorithms of the pqm4 library.
  • Set up the development environment for Arm Cortex-M4.
  • Implement and test post-quantum cryptographic algorithms.
  • Benchmark and profile cryptographic implementations.
  • Integrate new cryptographic schemes into the pqm4 framework.

Prerequisites

Before starting, you will need the following:

  • Computer with Python 3.8 or higher
  • Arm GNU Toolchain installed
  • An Arm Cortex-M4 development board such as NUCLEO-L4R5ZI, NUCLEO-L476RG, or STM32F4 Discovery, with stlink or OpenOCD for flashing. Alternatively, install QEMU to simulate the hardware without a physical board.

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll use pqm4 to test and benchmark post-quantum cryptography on Arm Cortex-M4. First, you’ll set up hardware or QEMU, build scheme binaries, and validate implementations against test vectors. Then, you’ll measure cycles, stack usage, and code size. You’ll add a key encapsulation mechanism under crypto_kem/ so the build system discovers and compiles it.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
Which target should I use: a physical Cortex-M4 board or QEMU?
Use a physical board if you have supported hardware and a flashing tool (stlink or OpenOCD). Choose QEMU to simulate a Cortex-M4 using the mps2-an386 platform when hardware isn’t available.
How do I know the pqm4 build completed successfully?
You’ll see binaries under bin/ for each scheme you built. The filenames follow a pattern such as bin/crypto_kem_ml-kem-768_<impl>_<type>.bin, indicating the scheme and implementation variant.
What do implementation variants such as `m4fspeed` and `m4fstack` indicate?
The <impl> field identifies each scheme’s variant. For example, m4fspeed is optimized for speed and is used by ML-KEM, while m4fstack is another Cortex-M4F variant. The exact suffix depends on the scheme.
What results should I expect when running tests and benchmarks?
The test harness validates correctness against known test vectors. Benchmarks report standardized metrics, including cycle counts, stack usage, and code size.
How do I add a new KEM and verify it's picked up by pqm4?
Place the new scheme in its own directory under crypto_kem/. pqm4’s build system automatically discovers and compiles it. Verify by checking for generated binaries for the new scheme and running the tests and benchmarks.
Next