Optimizing Polynomial Multiplication and Fixed-Weight Sampling for HQC on ARM Cortex-M4
Jihoon Jang, Hanbeom Shin, Suhri Kim, Seokhie Hong, Donggeun Kwon
Abstract
In this paper, we present an optimized implementation of Hamming Quasi-Cyclic (HQC) on the ARM Cortex-M4. We optimize (i) the polynomial multiplication and (ii) the support expansion in fixed-weight sampling, and (iii) propose an optional caching strategy that reuses the public transforms and hash recomputed under a fixed key. For the polynomial multiplication, the fixed-constant multiplications in the Frobenius additive FFT (FAFFT) butterfly spend nearly half of their instructions on VMOV data movements between general-purpose and floating-point registers rather than arithmetic. Because minimizing the XOR count alone can increase the total instruction count, we propose a dirty-aware register-allocation policy and an XOR-operation reordering that reduce the VMOV count by up to 48.1% while leaving the XOR count unchanged. We apply these to a multiplication that combines prior FAFFT-CRT methods, and for HQC-1 we further find a 34% sparser FAFFT modulus that lowers the CRT reconstruction cost. For fixed-weight sampling, we rewrite the support expansion with predicated execution and 4-way unrolling, lowering the per-word cost of its inner loop from 22 to 6 cycles while remaining constant-time. On the NUCLEO-L4R5ZI board, our implementation reduces key generation, encapsulation, and decapsulation by up to 33.1%, 34.6%, and 29.8% over the faster of the two prior state-of-the-art implementations, and the optional caching yields a further reduction of up to 32.7% and 18.9% for encapsulation and decapsulation.
Create a lesson
Related papers
Locus: A Framework for Exploring and Optimizing Point Addition Hardware for Zero-Knowledge Proofs
Gaurav Kuwar, Alhad Daftardar, Jianqiao Mo et al.
Quantifying the Effect of HCLs on a Fixed-Microarchitecture MXFP4 Accelerator
Daniele Passaretti, Sajjad Tamimi, Nicola Dall'Ora
HBFlex: A Flexible Memory System for Bridging Fine-Grained LLM States and Coarse-Grained HBF Parallel Execution
Shuzhang Zhong, Weikai Xu, Yifan Zhou et al.
Automated Instruction Encoding Synthesis for Modern GPU ISA Compression
Mingyuan Ma, Hu He
VeriBugBench: An Empirically Grounded Framework for Constructing Verilog RTL Debugging Benchmarks
Xiankai Meng, Kejian Feng, Xinlin Zhao et al.
Budgeted Express-Mesh: Traffic-Aware Link Placement and Deadlock-Free Adaptive Routing
Li Cao, Jingyuan Ma