PQMagic: Towards Secure and Efficient Post Quantum Cryptography Implementations

Yituo He*, Xinpeng Hao, Juanru Li, Yu Yu

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Quantum computing threatens current public-key cryptosystems, driving the need for post-quantum cryptography (PQC). However, PQC implementations face additional risks. We find implementation issues in existing PQC libraries (e.g., pq-crystals and liboqs), while they also fail to fully leverage modern processors. To address these issues, we propose four optimization strategies: Branch Optimization, Register Allocation, Vectorized Execution, and Secure and Efficient Pipelining. These strategies minimize execution branches, instruction counts, and memory accesses while enhancing security, mitigating the implementation from side-channel attack risk. We implement these in PQMagic, a high-performance PQC library for ML-KEM and ML-DSA, and it significantly outperforms state-of-the-art libraries. For ML-KEM-1024, it achieves efficiency gains of up to 1.77x, 1.79x, and 1.52x for Keygen, Encaps, and Decaps, while reducing instruction counts and memory access overhead by up to 47.1% and 60.1%. For ML-DSA-87, it improves Keygen, Sign, and Verify by up to 2.24x, 1.89x, and 2.04x, with instruction counts and memory access reduced by up to 44.4% and 64.5%. Additionally, PQMagic eliminates up to 90.9% of branch operations in matrix expansion for ML-DSA. Besides, PQMagic also outperforms traditional cryptographic algorithm combinations (RSA-2048/ECDSA-256 + ECDH) selected from OpenSSL. It only has a slight gap at the highest level L5 compared to ECDSA-256 + ECDH combination. Our work shows that combining modern hardware capabilities with careful instruction scheduling enables secure and efficient PQC implementations, paving the way for post-quantum cryptographic migration.

Original languageEnglish
Title of host publicationApplied Cryptography and Network Security Workshops - ACNS 2025 Satellite Workshops
Subtitle of host publicationAIHWS, AIoTS, QSHC, SCI, PrivCrypt, SPIQE, SiMLA, and CIMSS 2025, Revised Selected Papers
EditorsMark Manulis
PublisherSpringer Science and Business Media Deutschland GmbH
Pages152-172
Number of pages21
ISBN (Print)9783032018052
DOIs
StatePublished - 2026
Externally publishedYes
EventSatellite Workshops held in parallel with the 23rd International Conference on Applied Cryptography and Network Security, ACNS 2025 - Munich, Germany
Duration: 23 Jun 202526 Jun 2025

Publication series

NameLecture Notes in Computer Science
Volume15654 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Conference

ConferenceSatellite Workshops held in parallel with the 23rd International Conference on Applied Cryptography and Network Security, ACNS 2025
Country/TerritoryGermany
CityMunich
Period23/06/2526/06/25

Keywords

  • Crypto Engineering
  • Post-Quantum Crypto
  • PQMagic

Fingerprint

Dive into the research topics of 'PQMagic: Towards Secure and Efficient Post Quantum Cryptography Implementations'. Together they form a unique fingerprint.

Cite this