ML-DSA

Also known as: Module-Lattice-Based Digital Signature Algorithm · CRYSTALS-Dilithium · Dilithium · FIPS 204

On this page 8

ML-DSA, the Module-Lattice-Based Digital Signature Algorithm, is the general-purpose post-quantum digital signature scheme standardized by NIST in FIPS 204 in August 2024. It is derived from CRYSTALS-Dilithium and is designed so that signatures remain unforgeable even against a quantum computer, which makes it a central building block of quantum security within the wider field of quantum computing.

ML-DSA replaces RSA and elliptic-curve signatures such as ECDSA and Ed25519, whose security collapses under Shor’s algorithm. It is the primary recommendation for code signing, certificates, firmware updates and authenticated protocols, while ML-KEM handles key establishment and SLH-DSA serves as a conservative hash-based alternative.

How ML-DSA produces and verifies a signature

ML-DSA follows the Fiat-Shamir with aborts paradigm: the signer proves knowledge of a short secret without revealing it, then turns that interactive proof into a non-interactive signature by hashing. Its security rests on two lattice problems, Module Learning With Errors (MLWE) and Module Short Integer Solution (MSIS), for which no efficient classical or quantum algorithm is known.

All arithmetic happens over polynomials of degree 256 with coefficients modulo the prime q = 8380417. The public key contains a seed that expands into a matrix A and a vector t = A·s1 + s2, where s1 and s2 are short secret vectors. Recovering the secrets from t is an MLWE instance, so the public key is computationally indistinguishable from random noise.

  1. Commitment: the signer samples a masking vector y and computes w = A·y, keeping only its high-order bits.
  2. Challenge: a hash of the message representative and those high bits yields a sparse challenge polynomial c with coefficients of -1, 0 or +1.
  3. Response: the signer computes z = y + c·s1.
  4. Rejection check: if z or related values are too large and could leak information about s1, the attempt is discarded and the loop restarts.
  5. Verification: the verifier recomputes the high bits of A·z – c·t with the help of hint bits and checks that the hash reproduces c.

The rejection sampling step is what keeps signatures from leaking the secret key statistically. On average the loop runs roughly four to five times per signature, so signing time varies, while verification always takes a single pass. Multiplication is accelerated with the Number Theoretic Transform (NTT), and SHAKE128 and SHAKE256 provide all hashing and sampling.

ML-DSA parameter sets and sizes

FIPS 204 defines three parameter sets that trade size for security margin. Each maps to a NIST security category, where category 2 matches the collision resistance of SHA-256, category 3 matches AES-192 key search and category 5 matches AES-256 key search. The table lists the standardized sizes in bytes.

Parameter setNIST categoryMatrix dimensions (k × l)Public keySignaturePrivate key
ML-DSA-4424 × 41,312 B2,420 B2,560 B
ML-DSA-6536 × 51,952 B3,309 B4,032 B
ML-DSA-8758 × 72,592 B4,627 B4,896 B
Standardized ML-DSA parameter sets

The private key can also be stored as a 32-byte seed from which the full key is regenerated, which many hardware security modules prefer. ML-DSA-65 is the common default for general use, while ML-DSA-87 is mandated for national security systems under CNSA 2.0.

Signing modes and API options in FIPS 204

The standard specifies several signing variants whose differences matter for interoperability. Two implementations that pick different modes will produce signatures the other side rejects, so protocols must pin the variant explicitly.

VariantHow it worksTypical use
Hedged signingMixes fresh randomness with a secret seedDefault; resists fault and side-channel attacks
Deterministic signingUses no fresh randomnessSystems without a reliable random source
Pure ML-DSASigns the full message with internal hashingMost protocols and certificates
HashML-DSASigns a pre-computed hash with an algorithm identifierVery large data or remote signing services
Context stringBinds up to 255 bytes of domain label to the signatureSeparating signatures across applications
ML-DSA signing variants and their purpose

Pure ML-DSA is preferred in most standards work, including X.509 certificate profiles, because pre-hashing adds a second algorithm identifier and a larger attack surface. A pure signer can still handle large inputs by computing an internal message representative, often called external mu, outside the cryptographic module.

How ML-DSA compares with other signature schemes

ML-DSA offers the best balance of speed, size and implementation simplicity among the NIST post-quantum signatures, but it is much larger than classical schemes. The comparison below uses the category 1 to 3 range for each algorithm.

SchemeHardness assumptionPublic keySignatureQuantum resistant
Ed25519Elliptic-curve discrete logarithm32 B64 BNo
RSA-3072Integer factorization384 B384 BNo
ML-DSA-44Module lattices (MLWE, MSIS)1,312 B2,420 BYes
FN-DSA-512NTRU lattices897 BAbout 666 BYes
SLH-DSA-128sHash function security only32 B7,856 BYes
Signature schemes at comparable security levels

FN-DSA, derived from Falcon, has smaller signatures but needs floating-point Gaussian sampling that is difficult to implement in constant time. SLH-DSA relies only on hash functions, which makes it the conservative fallback if lattice assumptions weaken, at the cost of large and slow signatures. Stateful hash-based schemes such as XMSS and LMS remain niche choices for firmware signing.

Deploying ML-DSA in practice

Adopting ML-DSA is mostly a size and infrastructure problem rather than a speed problem, because signing and verification are typically as fast as or faster than ECDSA on modern processors. The decision table summarizes common deployment choices.

SituationRecommended choiceReason
Long-lived root certificatesML-DSA-87 or a composite with ECDSAMaximum margin for decades of validity
Web server certificatesML-DSA-44 or ML-DSA-65Limits handshake growth across the chain
Firmware and software updatesML-DSA-65 or ML-DSA-87Verification is fast and size rarely matters
Transition period with legacy clientsComposite or dual signaturesSecurity holds if either algorithm survives
Constrained microcontrollersML-DSA-44 with streaming verificationReduces memory needed for keys and signatures
Choosing an ML-DSA deployment approach

Signatures are less urgent than encryption under the harvest now, decrypt later threat, because a forged signature only matters once a cryptographically relevant quantum computer exists. However, long-lived trust anchors and devices with fixed firmware keys must be migrated early, since they cannot be replaced quickly after Q-Day. A cryptographic inventory and crypto-agility make that replacement manageable.

Limitations and implementation pitfalls

The mathematics of ML-DSA is well studied, yet most real-world failures come from implementation. The following points recur in audits and research.

  • Side-channel leakage: timing or power variations in the rejection loop and NTT can reveal secret coefficients, so constant-time code and masking are essential on exposed hardware.
  • Fault attacks: a glitch during deterministic signing can expose the key, which is why the hedged mode is the default.
  • Size overhead: certificate chains with several ML-DSA signatures add ten kilobytes or more to TLS handshakes, which can trigger extra round trips.
  • Pre-standard confusion: early Dilithium round 3 code is not compatible with FIPS 204, because domain separation and encodings changed.
  • Younger assumptions: module lattices have been analyzed for far fewer years than factoring, so parameter margins may be revised if new attacks appear.

Explained without jargon

A digital signature is a mathematical seal that proves who created a file and that nobody changed it. Today most seals rely on math puzzles that a large enough quantum computer could solve quickly, which would let attackers forge them.

ML-DSA is a new kind of seal built on a different puzzle: finding short paths through an enormous multidimensional grid of points. Neither ordinary nor quantum computers know a shortcut for it. The trade-off is that the seal is bigger, a few kilobytes instead of a few dozen bytes, but checking it remains very fast. In short, ML-DSA keeps signatures trustworthy after quantum computers arrive.

A typical use case

A manufacturer of industrial controllers ships devices expected to run for fifteen to twenty years. Each controller holds a public key in read-only memory and accepts only firmware updates signed with the matching private key. Because those keys cannot be changed after shipment, the security team concludes that classical ECDSA keys could become forgeable during the product lifetime.

The team adopts ML-DSA-87 for the firmware signing key, stored as a 32-byte seed inside a hardware security module, and keeps ECDSA as a second signature for older update tooling. Each firmware image grows by about 4.6 kilobytes of signature data, which is negligible next to a multi-megabyte image, and verification on the controller’s ARM processor adds only a few milliseconds at boot. The result is a quantum-resistant update chain that remains trustworthy for the full service life of the devices.