← Back to section · Hardware & Chips

PQC Support in HSMs: Keys Never Leave the Box — but the Algorithms Must Change

Hardware security modules guard an organization's most critical keys. Moving them to ML-KEM, ML-DSA and SLH-DSA stresses interfaces, firmware and procurement alike.

Published 22 November 2026 · 6 min read · PQ Frontier

PQC Support in HSMs: Keys Never Leave the Box — but the Algorithms Must Change
AI-generated illustration by PQ Frontier
Video explainer · HSM: keys never leave the device

In a post-quantum migration, the software layer is usually the easiest part: upgrade a library and the new algorithms are there. The hard part is the hardware security module (HSM). Root keys, CA signing keys and code-signing keys live inside these devices, and changing algorithms means changing firmware, interface definitions — sometimes the hardware itself. This article explains what an HSM does, what PQC concretely breaks, and what to check when evaluating one.

What an HSM Does: Keys Never Leave the Device

An HSM is a dedicated, tamper-resistant cryptographic appliance (or its cloud equivalent) built around a single promise: private keys are generated, stored and used inside the device’s cryptographic boundary, and never leave it in plaintext. Applications send data in and get signatures back; decapsulation happens inside the device and only the recovered session key comes out. Around that promise, an HSM provides three things:

  • Key custody — keys are generated with a hardware random source inside a tamper-resistant enclosure, with encrypted backup, cloning and cluster synchronization.
  • Signing and cryptographic services — signing, verification, encryption and key derivation execute on-device, with caller authentication, authorization and audit logging.
  • A compliance anchor — root CAs, code signing, payment and identity systems are often required by regulation or industry rules to keep private keys in a certified HSM.

The corollary matters for migration planning: whatever algorithms the HSM supports are the only algorithms an organization’s critical systems can use. The last mile of PQC migration frequently runs through the HSM.

PKCS#11 Meets PQC: Three Adaptation Problems

Most HSMs are accessed through PKCS#11 (Cryptoki), supplemented in places by vendor APIs or platform interfaces such as JCE and KSP/CNG. PKCS#11 is the cross-vendor main road, and PQC algorithms create three concrete problems on it.

Size. Keys and signatures for ML-KEM, ML-DSA and SLH-DSA are roughly an order of magnitude larger than their RSA/ECC counterparts: an ML-DSA-65 public key is about 2 KB and its signature about 3.3 KB; SLH-DSA signatures range from several KB to tens of KB. Many existing stacks hard-code buffer sizes, per-call data limits and session memory based on RSA-era assumptions. Swap in PQC objects and you get truncation, errors or sharp performance drops unless each assumption is audited.

Object model. PKCS#11 manages keys as objects with attribute templates. ML-KEM is a key-encapsulation mechanism, not conventional public-key encryption: its encapsulate/decapsulate operations do not map cleanly onto the legacy encrypt/decrypt flow. Signature schemes such as ML-DSA add new attributes for pre-hashing and context strings. These require genuinely new mechanisms and attributes — old firmware cannot fake its way through.

Mechanism definitions. The good news is that standardization has caught up: the OASIS PKCS#11 specification, in v3.2, defines mechanisms for the PQC algorithms, covering NIST’s ML-KEM, ML-DSA and SLH-DSA. That gives vendors and application developers a common target. But “defined in the spec” is not “implemented in your device”: which mechanisms a given firmware implements, and at which parameter sets, still has to be verified device by device.

Vendor Support: Check the Official Documentation

As of this writing, mainstream HSM vendors have progressively announced or shipped PQC support, along three broad paths: firmware updates adding PQC mechanisms to installed devices, new hardware platforms with native support, and cloud HSM services enabling PQC capabilities. Coverage differs substantially — whether ML-DSA and SLH-DSA are included alongside ML-KEM, which parameter sets are offered, which PKCS#11 version the implementation follows, and what its certification status is — and it changes quickly.

This article therefore deliberately avoids a model-by-model feature matrix: such tables go stale fast, and a wrong one is worse than none. Before procurement or migration planning, verify each item against the vendor’s official documentation and release notes — firmware version, mechanism list, certificate numbers — and treat the vendor’s written confirmation as authoritative.

A Buyer’s Checklist

Dimension Questions to answer
Algorithm coverage Which parameter sets of ML-KEM, ML-DSA and SLH-DSA are supported? Is hybrid (classical + PQC) operation available?
Firmware upgradeability Can installed devices gain PQC via firmware, or is a hardware swap required? Does upgrading affect existing keys or certification status?
PKCS#11 mechanism completeness Does the device implement the standard PKCS#11 v3.2 PQC mechanisms or proprietary extensions? What does that mean for application porting?
Certification Does the device hold FIPS 140-3 or equivalent certification, and are the PQC mechanisms inside the certified boundary rather than uncertified extras?
Performance and throughput What are the measured operations per second for ML-DSA signing and ML-KEM decapsulation? Do large signatures force segmented calls and extra latency?

One practical rule: run an interoperability test on evaluation hardware with real workload parameters — have your actual middleware (PKCS#11 client, CA software) complete a full sign-and-verify cycle through the PQC mechanisms — before signing a purchase order. Between “supported on paper” and “runs your workload” there are usually several buffers and attribute templates waiting to bite.

Engineering Details of the Rollover: State, Backup and the Dual-Stack Period

Beyond the checklist, three engineering details tend to surface only during implementation. First, the dual-stack period. Migration is not a cut-over: the same HSM often has to serve classical and PQC key systems side by side for years, so firmware, partition planning and licensing must support both mechanism sets concurrently. Verifying “PQC runs” is not enough; verify that the two stacks do not interfere when running in parallel. Second, state management for stateful hash-based signatures. If an organization adopts a stateful scheme such as LMS or XMSS (NIST SP 800-208), its one-time signature state must never be reused — yet HSM clustering and backup/restore are, by design, state-copying operations, and a rolled-back or duplicated state can be fatal. Engineering mitigations include state reservation, monotonic counters and primary/standby coordination; this is one reason many organizations prefer stateless SLH-DSA in HSM settings despite its larger signatures. Third, backup and restore need re-verification. PQC key objects are significantly larger, so backup media capacity, wrapping formats and cross-version restore (backed up under old firmware, restored under new) should be rehearsed in advance. Add the changed performance shape — ML-DSA verification is fast, while SLH-DSA signing is slow and its signatures large — and call timeouts and queue parameters need retuning to the new shape. None of these details appear on a vendor’s algorithm-support list, yet they decide whether migration go-live week goes smoothly.

For the migration as a whole, the HSM conclusion matches this site’s standing position: it cannot be an afterthought. Root-key algorithm rollover sets the timetable for CAs and trust chains, and it should start alongside the cryptographic asset inventory, not after it.

References

Tags: HSMPKCS#11Post-Quantum Cryptography