As post-quantum cryptography (PQC) becomes increasingly critical for securing future communication systems, the performance overhead introduced by quantum-resistant algorithms presents a major computing challenge. HQC (Hamming Quasi-Cyclic) is a newly standardized code-based PQC scheme designed to replace classical key exchange methods. In this paper, we propose OptHQC, an optimized implementation of the HQC scheme to deliver high-performance cryptographic operations. Our approach provides a comprehensive analysis of each computational blocks in HQC and introduces optimizations across all three stages: key generation, encryption, and decryption. We first exploit data-level sparsity in vector multiplication to accelerate polynomial operations during vector generation. We then leverage instruction-level acceleration (e.g., AVX2) in hash computation to further improve performance. Last, we transform multiplication into lookup table indexing and optimize memory access patterns in syndrome computation and error vector recovery, which are the most computationally intensive operations in HQC. Overall, OptHQC achieves an average 55% speedup over the reference HQC implementation on CPU.
翻译:随着后量子密码学(PQC)对未来通信系统安全的重要性日益凸显,量子抗性算法引入的性能开销成为主要的计算挑战。HQC(汉明准循环)是一种新近标准化的基于编码的PQC方案,旨在替代传统的密钥交换方法。本文提出OptHQC,即HQC方案的一种优化实现,以提供高性能的密码学运算。我们的方法对HQC中每个计算模块进行了全面分析,并在密钥生成、加密和解密三个阶段均引入了优化。首先,我们利用向量乘法中的数据级稀疏性来加速向量生成过程中的多项式运算。其次,我们在哈希计算中利用指令级加速(如AVX2)以进一步提升性能。最后,我们将乘法转换为查找表索引,并优化了伴随式计算和误差向量恢复中的内存访问模式,这些是HQC中计算最密集的操作。总体而言,OptHQC在CPU上相比参考HQC实现平均实现了55%的加速。