Skip to content
All articles
Methodology

How to test post-quantum firmware signing

By Leon Acosta7 min read

Also mentioned

ML-DSAML-DSAModule-Lattice-based Digital Signature AlgorithmModule-Lattice-Based Digital Signature Algorithm, the NIST-standardized post-quantum signature scheme derived from CRYSTALS-Dilithium and specified in FIPS 204.Read the full entry (new tab), FIPSFIPSFederal Information Processing StandardFederal Information Processing Standards, publicly announced standards developed by NIST for use in U.S. government computer systems, including cryptographic algorithms and modules.Read the full entry (new tab), NISTNISTNational Institute of Standards and TechnologyThe U.S. National Institute of Standards and Technology, the agency that develops and publishes cryptographic standards, including the FIPS series and post-quantum algorithms.Read the full entry (new tab), PQCPQCpost-quantum cryptographyCryptographic algorithms designed to run on today's classical computers while remaining secure against attacks by both classical and future quantum computers.Read the full entry (new tab), CNSACNSACommercial National Security Algorithm SuiteThe Commercial National Security Algorithm Suite 2.0, the NSA's mandated algorithm set for US National Security Systems.Read the full entry (new tab) are defined in the glossary.

TL;DR

Read this first

A post-quantum firmware-signing migration is not complete when an ML-DSA signature verifies. The device must also bind the signed manifest to the right vendor and hardware class, reject stale updates, survive key rotation and recover safely after a failed install. Test the signing service, repository, bootloader, recovery path and offline trust anchors as one update system. A valid signature proves who authorized a byte string. It does not prove that the byte string is current, compatible or safe to install.

Define the verification boundary before changing algorithms

Start with a cryptographic inventory that traces one release from the build output to the first instruction executed after reboot. Record which component hashes the image, which object is signed, which key identifier is embedded in the manifest, where trust anchors live and which verifier runs in the boot ROM, bootloader, operating system and recovery environment. If two layers verify different bytes, a green test in the release service says little about the device.

The IETF SUIT architecture separates the firmware image from the manifest that tells a device whether and how to install it. That distinction is useful beyond IoT. A signature can cover a manifest containing an image digest, vendor identifier, device class and sequence number, while the image may arrive through an untrusted transport. The acceptance plan must show that the verifier authenticates the manifest, rechecks the image digest and applies every install condition before execution.

LayerEvidence to captureFailure to reject
Build and packagingReproducible image digest, manifest bytes and signer inputA release job signs bytes that differ from the distributed image
Signing serviceAlgorithm, parameter set, key identifier, signature and policy decisionAn unauthorized pipeline or wrong environment obtains a valid signature
Update repositoryVersioned metadata, expiry or freshness data and delegated roleA compromised mirror serves stale but correctly signed firmware
Device verifierPinned parser, trust anchor, manifest policy and image digestThe signature passes but the update targets another model or hardware revision
Recovery pathRecovery image, independent trigger and accepted trust rootsA failed update permanently removes the only working verifier
The firmware-signing boundary and the failure each layer must stop.

Choose a signature profile, not just an algorithm name

FIPS 204 defines ML-DSA key generation, signing and verification, including pure and pre-hash variants and an optional context string. An implementation decision therefore needs more detail than "use ML-DSA". Pin the parameter set, signature interface, pre-hash choice, context construction, key encoding and failure behavior. Generate tests from the exact profile that production devices will verify.

For National Security Systems, the current CNSA 2.0 material allows ML-DSA-87, LMS or XMSS for software and firmware signing. That is a scoped NSA profile, not a universal rule for every product. LMS and XMSS are stateful hash-based schemes under NIST SP 800-208; a signer must never reuse a one-time key state. ML-DSA avoids that state-management problem but still requires protected private keys, controlled randomness where used and an independently tested verifier.

Pitfall

Algorithm validation is not product validation

Passing ML-DSA algorithm vectors shows that a cryptographic implementation matches the standard for those cases. It does not validate the bootloader parser, manifest policy, signing authorization, rollback store, recovery image or hardware protection around the private key.

Build an acceptance matrix that includes valid failures

A useful acceptance suite contains negative cases that fail for one reason at a time. Keep the firmware bytes constant when corrupting a signature. Keep the signature valid when changing the device class, sequence number or delegated role. This isolates the control that made the device reject the update instead of treating every red result as equivalent.

CaseExpected resultEvidence
Valid post-quantum releaseInstall and bootManifest bytes, signature, image digest, device log and measured version
One-bit signature corruptionReject before installationStable error class without parser crash or fallback
Valid signature for another device classReject as incompatibleVendor and class identifiers evaluated after signature verification
Older manifest sequenceReject as rollbackMonotonic state remains intact across reboot and power loss
New manifest authorizing an older imageFollow explicit recovery policyLater sequence number, approved recovery role and recorded reason
Unknown post-quantum key identifierReject or enter an approved recovery flowNo silent use of a classical default key
Classical and post-quantum signatures disagreeApply the documented transition ruleNo partial-success path that accepts the easier signature
Interrupted trust-anchor rotationBoot with at least one authorized pathOld and new roots tested before the old root is retired
Minimum acceptance cases for a post-quantum firmware-signing migration.

RFC 9124 requires monotonically increasing manifest sequence numbers and binding to vendor and device-type identifiers. It also makes an important distinction: a later manifest can intentionally authorize an older firmware image. The anti-rollback control is the manifest sequence, not a naive comparison of human-facing firmware version strings. Your tests need both the prohibited rollback and the authorized recovery case.

Test the transition without creating a downgrade path

A staged PQC migration roadmap may temporarily support a classical signature and a post-quantum signature. Write the acceptance rule before shipping that verifier. Requiring both signatures gives a different security and availability result from accepting either one. An OR rule can preserve compatibility, but it also leaves the classical path usable by an attacker until it is removed. An AND rule removes that downgrade but makes either verifier, key service or parser a release dependency.

  • Inventory every device generation and recovery image that must understand the new signature profile.
  • Ship verification support before issuing firmware that depends on it.
  • Exercise dual-signature success, each single-signature failure and malformed container cases.
  • Record telemetry that distinguishes unsupported algorithms from invalid signatures and policy rejection.
  • Rotate trust anchors with an overlap window and an explicit last classical release.
  • Remove the classical acceptance path only after field evidence covers normal update and recovery flows.

Treat parser behavior as security-critical. A new key or signature encoding changes lengths, object identifiers and memory pressure even if the surrounding manifest format remains the same. Test truncated inputs, duplicate fields, non-canonical encodings, oversized objects and allocation failures on the actual constrained target. The certificate and key format test guide uses the same principle: verify the exact bytes and reject ambiguous encodings.

Preserve rollback, freeze and key-compromise defenses

Replacing a signature primitive does not replace update-system security. The Update Framework specification separates roles and supports threshold authorization so one online key need not control every release decision. Its security model also addresses rollback and freeze attacks. A firmware repository can adopt similar controls even when it does not implement TUF directly: short-lived online metadata, offline root authority, delegated targets and independent recovery authorization.

NIST SP 800-193 frames platform firmware resilience around protection, detection and recovery. Use those three outcomes as migration gates. Protection covers signature and authorization checks. Detection covers measured state, boot failures and unexpected trust-anchor changes. Recovery covers a known-good image and a path that still works when the normal update mechanism is damaged.

Keep an evidence bundle for each release path

The final deliverable should be reproducible without access to the production private key. Preserve the unsigned image digest, canonical manifest bytes, public key, algorithm profile, signature, expected decision and verifier version. Add negative fixtures for every rejection case. Pin toolchain and library versions so a later parser or cryptographic update can be compared against the same corpus.

  • A machine-readable signature profile with parameter set, context and encoding rules.
  • Known-answer and negative vectors for signing and verification.
  • A device compatibility matrix covering bootloader, recovery and field-update versions.
  • Trust-anchor rotation records and the last accepted classical-key release.
  • Power-loss and interrupted-install results, including monotonic counter persistence.
  • A key-compromise drill showing how authorization is revoked and recovery metadata is issued.
  • Production logs that identify the decision without exposing private keys or sensitive firmware.

An implementation audit can review the verifier, parser and authorization boundary. A crypto-agility plan can define how the next signature profile is introduced without repeating the migration. Neither replaces testing on the smallest device and oldest recovery image that remain supported.

What this guide does not prove

This acceptance plan does not certify a cryptographic module, approve an NSA profile for a non-NSS product or prove that a vendor's boot ROM is free of implementation flaws. It also does not choose ML-DSA over a stateful hash-based scheme for every device. The right profile depends on verifier footprint, signing frequency, key-state guarantees, device lifetime and the policy that governs the product.

The operational claim is narrower: a post-quantum firmware-signing migration is reviewable when the exact signed bytes, signature profile, trust anchors, rollback state, device binding and recovery decisions can all be reproduced. A green signature check is one row in that evidence set.

References

Get started

Turn quantum risk into a credential.

Book a discovery call and get an indicative scope and pricing for your organisation.