arXiv:2610.01960cs.CROct 2026

Manuscript Offprint

arXiv:2610.01960

System-Level Optimization Beyond Cryptographic Kernels: An ML-KEM Case Study on Arm Cortex-M7

Mahmoud Abdelhafeez Sayed, Mostafa Taha, Gurp Nijjer

Mahmoud Abdelhafeez Sayed 1^{1}, Mostafa Taha 1^{1}, and Gurp Nijjer 2^{2}

1^{1} Department of Systems and Computer Engineering, Carleton University, Ottawa, ON, Canada

{Mahmoud.Sayed3, Mostafa.Taha}@Carleton.ca

2^{2} Quantegra Technologies Inc., White Rock, BC, Canada

gurp@quantegra.ca

Abstract. Recent work on embedded post-quantum cryptography has focused primarily on instruction-level optimization, including arithmetic-kernel improvements, assembly tuning, register allocation, and instruction scheduling. Using the Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM) on an Arm Cortex-M7 as a case study, we examine the additional gains available from memory-hierarchy utilization, tightly coupled memory placement, peripheral integration, clock configuration, and deterministic public-data reuse. The evaluation starts from a state-of-the-art SLOTHY-optimized implementation and covers all three ML-KEM parameter sets. Without modifying the cryptographic algorithm or standardized wire formats, the evaluated profiles without auxiliary public state reduce cycles by up to 2.5%. A selected public-data-reuse profile reduces encapsulation and decapsulation cycles by up to 74.6% and 58.8%, respectively. These results demonstrate that substantial deployment gains remain after arithmetic-kernel optimization and motivate a two-stage methodology that also examines the surrounding execution system.

Keywords: ML-KEM · Post-Quantum Cryptography · Embedded Cryptography · Cortex-M7 · Cryptographic Engineering · System-Level Optimization

Extended-version note. This manuscript is an extended version of the corresponding accepted conference paper.

1 Introduction

Large-scale quantum computers would compromise the security assumptions of widely deployed public-key cryptosystems based on integer factorization and discrete logarithms [14]. This threat has motivated the transition to post-quantum cryptography (PQC), culminating in the publication of the first National Institute of Standards and Technology (NIST) PQC standards in 2024 [12]. Among

M. A. Sayed et al.

these standards, Federal Information Processing Standard (FIPS) 203 specifies the Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM), derived from CRYSTALS-Kyber, for post-quantum key establishment [11]. ML-KEM is expected to become a central primitive in future secure communication protocols, including those deployed on embedded and Internet-of-Things (IoT) devices.

Deploying PQC on microcontrollers remains challenging. Although lattice-based schemes provide attractive performance compared with many other PQC candidates, they require substantially more computation and memory than classical public-key primitives in many embedded use cases. ML-KEM relies heavily on polynomial arithmetic, number-theoretic transforms (NTTs), SHAKE-based expansion, hashing, rejection sampling, and structured matrix-vector operations [11]. Consequently, implementation performance depends not only on arithmetic kernels, but also on memory placement, memory hierarchy utilization, random-number generation, clock configuration, and the cost of repeatedly deriving public data.

Recent work has made substantial progress on high-speed PQC implementations for Arm microcontrollers, from the pqm4 benchmarking framework and Cortex-M4 arithmetic kernels to optimized Keccak and SLOTHY-assisted migration of assembly implementations for ML-KEM and the Module-Lattice-Based Digital Signature Algorithm (ML-DSA) to Cortex-M7 [2–4,9]. These works focus primarily on instruction-level optimization through arithmetic improvements, assembly tuning, instruction scheduling, register allocation, and software pipelining. Such optimizations minimize the computational work required by the cryptographic algorithm.

Once these kernels have been optimized, performance can remain limited by their execution environment and by work repeated across application programming interface (API) calls.

In this paper, we propose a two-stage methodology for embedded optimization. It complements instruction-level tuning with systematic evaluation of the execution system, including memory placement, hardware integration, operating points, and deterministic public state across operation and key lifecycles. We instantiate the methodology using ML-KEM on the Arm Cortex-M7, starting from the optimized implementation of Abdulrahman et al. [3]. The study evaluates all three ML-KEM parameter sets and reports cycle counts, wall-clock latency, memory consumption, and caller-managed auxiliary public state while preserving the standardized public-key, secret-key, ciphertext, and shared-secret formats.

A particular motivation for the clock-scaling study is that the state-of-the-art Cortex-M7 implementation of ML-KEM [3] focuses on instruction-level optimization and reports its measurements at 24 MHz to eliminate Flash instruction-fetch wait states. While appropriate for evaluating computational efficiency, such measurements do not directly answer a deployment question: what is the lowest achievable execution latency on the target platform? Because cycle counts vary with memory-system behavior and are not strictly frequency invariant, we evaluate ML-KEM across the full operating range of the platform.

The contributions of this paper are as follows:

– We formulate a two-stage view that applies platform integration and optimization across operation lifecycles around an optimized cryptographic-kernel baseline.

– We experimentally study Cortex-M7 system-level optimization knobs, including instruction tightly coupled memory (ITCM) placement, Flash acceleration, data tightly coupled memory (DTCM) placement of public constants, hardware true-random-number-generator (TRNG) integration, and clock configuration, under a controlled clock sweep from 24 MHz to 216 MHz.

– We identify repeated public-data derivation as a major remaining cost in optimized ML-KEM and design wire-format-preserving public-data reuse techniques for ML-KEM-512, ML-KEM-768, and ML-KEM-1024.

– We derive practical system-level optimization classes, selection criteria, and deployment-oriented profile-selection guidelines. The methodology transfers as a set of engineering questions, while the measured rankings and gains remain platform and workload dependent.

The results show that substantial additional gains remain possible after low-level arithmetic optimization. The evaluated profiles without auxiliary public state reduce cycles by up to 2.5% without changing cryptographic code, while the selected public-data-reuse profile reduces encapsulation and decapsulation cycles by up to 74.6% and 58.8%, respectively.

The remainder of this paper is organized as follows. Section 2 reviews related work on embedded post-quantum cryptographic implementations. Section 3 introduces the proposed two-stage optimization framework and derives general system-level optimization classes and selection criteria. Section 4 instantiates the framework using ML-KEM on Cortex-M7 and describes the evaluated optimization directions. Section 5 presents the implementation and experimental evaluation results. Section 6 discusses deployment-oriented profile selection and broader lessons for system-level optimization. Finally, Section 7 concludes the paper.