arXiv:2610.07820cs.CROct 2026

Manuscript Offprint

arXiv:2610.07820

Efficient and Implementation-Hardened RBLWE on Commodity Cortex-M Microcontrollers

Muhammad Asim Javaid, Muhammad Adeel Pasha, Muhammad Ali Siddiqi

Muhammad Asim Javaid, Muhammad Adeel Pasha, and Muhammad Ali Siddiqi

Abstract—Efficient post-quantum cryptography on resource-constrained Internet-of-Things (IoT) devices requires implementations that exploit the target processor architecture while resisting practical implementation attacks. This paper presents an ISA-accelerated and implementation-hardened realization of Ring Binary Learning with Errors (RBLWE) encryption on a commodity ARM Cortex-M33 microcontroller. Packing four 8-bit polynomial coefficients into the byte lanes of a 32-bit register and processing them with SIMD-style instructions, together with a packed message codec, accelerates encryption and decryption, while a buffered hardware-TRNG entropy source drawn from the on-die Secure Element drives the key-generation gain. Together these give same-core cold-start speedups of 4.06×4.06\times, 3.35×3.35\times, and 3.01×3.01\times for key generation, encryption, and decryption over a scalar baseline, and 3.52×/3.18×3.52\times/3.18\times lower encryption/decryption cycle counts than a reference Cortex-M0 implementation. On top of this accelerated core, we add four staged countermeasures, constant-time execution, fault hardening against zeroing, random-corruption, and instruction-skip faults, a Fujisaki–Okamoto (FO)-style CCA2 transform, and first-order shared (masked) CPA decryption, reporting each layer's cost individually. Binary-level inspection confirms these countermeasures survive compilation, and identifies a compiler-induced masking flaw resolved with a hand-written assembly replacement. Dudect-style timing tests, debugger-assisted fault-injection campaigns, and component-level TVLA then provide implementation-level evidence for the staged protections. The results demonstrate a practical acceleration-security tradeoff for RBLWE on off-the-shelf microcontrollers and reusable architecture-aware techniques for lightweight post-quantum implementations.

Index Terms—Post-quantum cryptography, RBLWE, Cortex-M33, SIMD, side-channel security, fault resistance

I. INTRODUCTION

The emergence of quantum computing threatens the long-term security of conventional public-key cryptography, motivating the shift to Post-Quantum Cryptography (PQC) [1], with lattice-based schemes such as ML-KEM occupying a central position [2], [3]. However, for embedded and IoT deployments, algorithmic security is not sufficient: implementations must meet strict latency, memory, and energy budgets while resisting physical attacks on devices that are inexpensive, battery-powered, and accessible to an adversary [4]. Ring Binary Learning with Errors (RBLWE) [5] is attractive for exactly this setting: by drawing binary rather than Gaussian secrets and errors, it reduces sampling and arithmetic complexity relative to general Ring-LWE [6], [7], making it a natural candidate for IoT nodes with the smallest footprint.

RBLWE acceleration remains an active research goal, evidenced by a steady stream of recent FPGA and dedicated-hardware designs [8]–[14] that report substantial throughput and area-time product gains. These designs, however, accelerate the arithmetic in isolation: they report cycle counts or area-time products without evaluating the design against side-channel or fault adversaries, despite operating in physically exposed deployment settings that motivate RBLWE's use. On the software side, Buchmann et al. established the first lightweight RBLWE implementation on 8-bit AVR and Cortex-M0 targets [5], while Ebrahimi and Bayat-Sarmadi extended this line with fault-resilient binary Ring-LWE for constrained devices [15]. Both target unaccelerated, general-purpose cores: neither exploits 32-bit SIMD-style instructions nor on-die security peripherals now standard on commodity Cortex-M MCUs. Power-based leakage assessment and binary-level verification of countermeasure survival were also absent from those works. The result is a gap between two otherwise mature lines of work: (i) architecture-aware acceleration is evaluated without implementation-security scrutiny, and (ii) implementation-hardened software is evaluated without architectural acceleration.

This paper closes that gap on a single commodity Cortex-M33 MCU. We map RBLWE's binary polynomial arithmetic onto the core's byte-lane SIMD instructions, packing four coefficients per 32-bit word and using UADD8/USUB8 to process them concurrently, which drives most of the encryption and decryption speedup, and pair this with word-oriented encoding and decoding to reduce scalar loads and stores. We also draw randomness from the MCU's Secure Element True Random Number Generator (TRNG) in larger batches rather than one small call at a time, which similarly dominates the key-generation gain by reducing its invocation frequency. Starting from this accelerated Chosen-Plaintext-Attack (CPA) secure core, we add protections in stages: (i) constant-time execution, (ii) hardening against zeroing, random-corruption, and instruction-skip faults, (iii) a Fujisaki–Okamoto (FO)-style adaptive Chosen-Ciphertext-Attack (CCA2) transform built on Secure-Element SHA-256, and (iv) first-order shared CPA decryption, so that each protection layer's cost is individually visible. We further verify, at the linked-binary level, that the compiler preserves these properties, and in doing so identify a compiler-induced masking flaw that motivates a Thumb-assembly replacement. In summary, this paper makes the following contributions (also summarized in Fig. 1):

C1. ISA- and Hardware-Assisted RBLWE Acceleration: Byte-lane SIMD arithmetic, packed encoding/decoding, and a buffered Secure-Engine TRNG together give same-core speedups of 4.06×4.06\times, 3.35×3.35\times, and 3.01×3.01\times for key

The authors are with the Department of Electrical Engineering, Lahore University of Management Sciences, Lahore, Pakistan.

Figure

Fig. 1. End-to-end overview of the proposed RBLWE pipeline (top), the three acceleration techniques and four staged countermeasures applied to it, and the evaluation techniques used to validate them.

generation, encryption, and decryption over a scalar baseline, and 3.52×/3.18×3.52 \times /3.18 \times lower encryption/decryption cycle counts than the reference Cortex-M0 implementation; SIMD arithmetic accounts for most of the encryption and decryption gain, while buffered TRNG batching accounts for most of the key-generation gain.

C2. Staged Implementation Hardening: The accelerated core is progressively extended with constant-time execution, fault-hardened comparison and selection, a CCA2-oriented wrapper, and first-order shared CPA decryption, with the cycle and memory cost of each layer reported separately.

C3. Binary-Level Verification: Final Executable and Linkable Format (ELF) inspection confirms that countermeasures survive compilation, and identifies a case where GCC recombined masked shares inside a noinline gadget, resolved with a hand-written assembly replacement.

C4. Implementation-Security Evaluation: Dudect-style timing tests, component-level Test Vector Leakage Assessment (TVLA), and 2,678 debugger-assisted fault trials provide implementation-level evidence for the staged protections, including cases where an injected fault propagated through despite the tested countermeasures.

The rest of the paper is organized as follows. Section II presents the RBLWE background while Section III details the proposed architecture-aware acceleration. Section IV defines the adversary model and then presents the staged countermeasures. Section V describes the evaluation methodology, and the results are discussed in Section VI. Section VII concludes this article.

References (19)