← Back to section · Post-Quantum Cryptography

Deterministic or Hedged: The Two Ways to Use ML-DSA's Signing Randomness

FIPS 204 makes a 32-byte rnd an input to signing: all zeros gives the deterministic variant, fresh randomness gives the hedged variant. Their trade-offs across fault attacks, side channels, and testability could not be more different.

Published 22 November 2026 · 5 min read · PQ Frontier

Deterministic or Hedged: The Two Ways to Use ML-DSA's Signing Randomness
AI-generated site artwork
Video explainer · ML-DSA: signing and verification

Fans of Ed25519 praise its deterministic signatures: “no need to fear a broken random number generator.” With ML-DSA the picture flips: FIPS 204 explicitly defines two modes, and the standards community’s mainstream advice is to prefer the one with fresh randomness. This article explains how the two variants differ in construction, what attack surface each carries, and why lattice signatures take a different attitude toward randomization than elliptic-curve signatures do.

Where rnd sits in signing

Recall the signing flow: the mask seed ρ″ is derived as H(K ‖ rnd ‖ μ), where K is the signing key inside the private key, μ is the digest binding the public key and message, and rnd is a 32-byte input. All of a signature’s “randomness” ultimately comes from three things: the long-term secret K, the message being signed, and this rnd.

  • Deterministic variant: rnd is fixed to 32 zero bytes. The same key signing the same message produces the identical mask, commitment, challenge, and response — byte-for-byte identical signatures.
  • Hedged variant: rnd is freshly generated by a random number generator for every signature. Signing the same message twice yields different, both valid, signatures. “Hedged” borrows the finance term: extra randomness hedges against failures elsewhere in the chain.

One commonly misunderstood point: even in the hedged variant, the mask is not taken directly from the random number generator; it is derived by mixing K and μ. A poor-quality random source still leaves the mask unpredictable to anyone who does not know K; conversely, even if K is partially probed, rnd’s freshness still perturbs. It is a belt-and-suspenders design.

The deterministic variant’s weak spot: fault attacks

The deterministic variant’s biggest problem lives not in cryptanalysis but in the physical world. If a signing device is subjected to fault injection during computation (voltage glitches, clock jitter, laser illumination), two disasters become possible.

First, a response that should have been discarded gets released. Rejection sampling is supposed to throw away distribution-unsafe values of z; if a fault happens to skip a norm check, that z, once out, lets an attacker solve for information about s1 against the public challenge. Second, repeatability gets exploited. Determinism means an attacker can have the device sign the same message over and over, injecting faults and collecting outputs; comparing normal and faulty signatures pairwise is where differential analysis draws its power — same message, same mask is the laboratory condition fault analysis loves most.

The hedged variant breaks exactly this repeatability: every signature’s mask differs, faulty samples cannot be aligned and compared pairwise; and with random rnd in the derivation, a single fault lands on “this run’s” random chain, hard to systematize into a secret-extraction procedure. This is why the Dilithium team and NIST, in the standardization discussion, clearly leaned toward the hedged variant as the default implementation — FIPS 204’s signing algorithm takes rnd as an input supplied by a random number generator, and that stance is embedded in the structure of the text itself.

A look back: the trouble randomness has caused signatures

To understand the standard-setters’ caution, revisit two episodes from elliptic-curve signature history. If ECDSA’s per-signature nonce k is ever reused, two signatures jointly determine the private key outright — a game console’s firmware signing key leaked exactly this way, when the implementation used a fixed k and effectively wrote the private key into its signatures. RFC 6979 later patched ECDSA’s soft spot with deterministic derivation, an approach in the same lineage as ML-DSA’s K ‖ μ derivation: let “randomness” come from the secret and the message themselves rather than betting on an external random source. But Dilithium’s designers thought one step further: deterministic derivation stops random-source failures, yet it does nothing against physical fault injection — with identical inputs, the whole computation chain can be replayed and probed point by point. So ML-DSA brings rnd back as a signing input, forming a two-layer structure of “K and μ guarantee the floor, rnd provides freshness.” The evolution makes the lesson clear: there is no once-and-for-all answer for signing randomness; each generation re-balances random-source trustworthiness against physical attack surface, and ML-DSA’s answer leans visibly toward the physical world.

Why keep the deterministic variant at all

Three practical reasons. First, testability: deterministic signatures can be compared byte-for-byte against standard test vectors, and compliance validation (such as cryptographic module certification) needs that reproducibility. Second, environments without a random source: in some extremely constrained embedded settings, a trustworthy entropy source is itself a luxury; a deterministic mask derived from K and μ at least does not depend on a component that may fail — though such settings must simultaneously assess whether fault attacks are in the threat model. Third, protocol compatibility: a few upper-layer protocols assume same-input-same-signature (certain deduplication or caching designs), and migration needs the option.

Looking at the implementation ecosystem, mainstream cryptographic libraries strike the same posture as the standard: hedged by default, deterministic as an explicit option, mainly for test-vector comparison and controlled environments. If a selection review finds an implementation that defaults to deterministic without explaining why, treat it directly as a risk item and ask — this is not a matter of style; it means an entire line of fault-attack defense was removed by default. Note also that signatures from the two variants are format-identical and mutually verifiable; a verifier cannot tell which variant produced a given signature. The variant choice is the signer’s unilateral security decision, and the responsibility sits entirely on the signer’s side — protocol designers cannot lean on verification rules to cover for it.

The hedged variant is not free either: it obliges implementers to take the random generator’s health seriously (power-on self-tests, entropy-source monitoring), and non-reproducible signatures complicate log auditing and debugging. The selection conclusion compresses to one sentence: default to hedged; choosing deterministic requires a written justification, together with compensating anti-fault measures (redundant checks, sensors, post-signing self-verification, and the like). Many of the defenses discussed in this column’s side-channel article ultimately come back to this choice.

Tags: ML-DSAfault attacksdeterministic signaturesFIPS 204