← Back to section · Post-Quantum Cryptography

Decoding Failure Rate: The Number HQC Must Crush to Negligible

Decoding-based KEMs have a problem lattice schemes do not: decapsulation fails with nonzero probability. This article explains where failures come from, why CCA security demands they be negligible, and the lesson of reaction attacks.

Published 22 November 2026 · 6 min read · PQ Frontier

Decoding Failure Rate: The Number HQC Must Crush to Negligible
AI-generated site artwork
Video explainer · HQC and backup candidates

Where failures come from

A necessary clarification first: ML-KEM also has a tiny decapsulation failure probability (denoted δ, arising from the rounding noise of its lossy compression), except that it has a closed-form estimate, an extremely small magnitude, and completely predictable behaviour, so engineering practice treats it as nonexistent. HQC’s failure is a different matter. Its decapsulation is fundamentally error correction: the encapsulator deliberately superimposes a random error vector on a codeword, and the receiver must use the inner code to correct the error and recover the message. The catch is that the error the receiver actually faces is not just the injected one — the mask term arising from the public syndrome contributes additional “noise”. The sum of the two errors is a random variable: almost always it sits comfortably within the inner code’s correction radius, but in the far tail of the distribution there is a tiny probability of crossing it. When that happens, decoding returns the wrong message and the derived shared key disagrees with the peer’s — a decoding failure.

HQC’s correctness is therefore not an absolute but a probabilistic statement: what is the failure rate (decoding failure rate, DFR)? Driving that number low enough is one of the central tasks of HQC’s parameter design.

The difference between the two kinds of failure deserves spelling out. ML-KEM’s noise comes from deterministic compression and decompression; whether a failure occurs is decided by the concrete values of key and ciphertext, the probability can be computed term by term, and there is no structural worry of “some class of keys failing far more often”. HQC’s failure comes from a dynamic correction process: the error weight is a distribution, the correction radius is a line, and failure is the event of the distribution’s tail crossing the line — estimating it requires modelling the tail of the whole distribution, and answering the deadly question of whether the failure probability correlates with the secret key’s structure. The difficulty is not in the same league, which is why decoding-based KEMs cost far more to review than lattice schemes, and why this topic merits an article of its own.

Why CCA security cares

The standard security goal for a modern KEM is IND-CCA: an attacker who can request decapsulation of chosen ciphertexts still learns nothing about session keys. The standard tool for lifting a base public-key encryption scheme to IND-CCA is the Fujisaki–Okamoto family of transforms, and its security proof has a precondition: the decapsulation failure rate must be negligible. The intuition is that success-or-failure is itself one bit of information — if an attacker can induce failures with non-negligible probability, the decapsulator becomes an oracle that can be probed bit by bit for the secret key’s structure.

There is also a purely practical layer: in a TLS handshake, one mismatched key is a failed connection. Even a one-in-a-million failure rate becomes a daily operational incident at internet handshake volumes. So on both proof and engineering grounds, the DFR must be pushed to the “would not occur once in the age of the universe” regime, and HQC’s parameter justification proceeds on exactly that standard: theoretical upper bounds on the failure rate, backed by large-scale simulation to validate the extrapolation.

Reaction attacks: a lesson now in the textbooks

Why failure rates are dangerous was taught most clearly in 2016. Guo, Johansson, and Stankovski mounted a reaction attack against the quasi-cyclic MDPC variant of McEliece: the attacker crafts large numbers of ciphertexts, observes which decode successfully and which fail, and correlates the failure probability with the secret key’s sparse structure, eventually recovering the key’s distance spectrum. The attack does not need a high failure rate — it needs only a measurable dependence of failure probability on the secret structure, with enough statistical samples to invert it.

After that lesson, the whole code-based community changed its attitude toward DFR: the rate must not only be low, its behaviour must be analysable and provably near-independent of the secret key. These are exactly the questions NIST pressed on in the fourth round: How was your failure-rate number obtained? Is it a rigorous bound or a simulation extrapolation? Across how many orders of magnitude does the extrapolation stretch? Are there weak key classes whose failure rate is markedly above average? Candidates whose answers were vague lost ground in the review — an important part of the background to HQC ultimately prevailing over BIKE: the reviewers judged HQC’s failure-rate analysis more solid and better able to withstand scrutiny.

How a failure rate is estimated

There is an unavoidable methodological problem: the target failure rate is as low as the 2^-128 order, and no simulation can directly “count” events that rare — all the world’s computing power, run until heat death, would not accumulate a single observation. A failure rate therefore has to stand on two legs. The first is theoretical analysis: express the distribution of the total error weight as a computable combinatorial formula and evaluate the tail probability of “exceeding the correction radius” term by term, yielding a mathematically grounded upper bound. The second is simulation: measure failure rates on scaled-down parameters where failures are frequent, compare the measurements against the theoretical formula point by point, confirm the formula is accurate over the observable range, and only then extrapolate along it to the real parameters.

This explains why reviewers’ questions always focus on “across how many orders of magnitude does the extrapolation stretch, and over what interval was the formula validated by measurement” — extrapolation itself is unavoidable, and its credibility depends on how well the formula fits in the measurable range and whether every approximation in the derivation errs on the conservative side (overestimating the failure rate rather than underestimating it). The completeness of this evidence chain varies considerably between candidates, and it is one of the places where the fourth round’s code-based candidates separated.

How HQC responds

HQC controls its failure rate on two levels. First, the inner code’s correction margin: the concatenated code’s correction radius is designed around the typical error weight with ample headroom, so crossing it is an event deep in the distribution’s tail. Second, analysis and validation: the specification documents the failure-probability derivation and simulation results, with each parameter set (HQC-128/192/256) meeting the “negligible” requirement for its security level.

The practical conclusion for deployers: use the standardised parameters and do not modify any value connected to error weights or code parameters — the DFR is a property solved jointly across the whole parameter set, and any single-point change can quietly worsen it by orders of magnitude while everything appears to work.

References

  1. Q. Guo, T. Johansson, P. Stankovski, A Key Recovery Attack on MDPC with CCA Security Guarantees, PQCrypto 2016.
  2. HQC official website (specification and failure-rate analysis). https://pqc-hqc.org
  3. NIST, NIST IR 8545: Status Report on the Fourth Round of the NIST Post-Quantum Cryptography Standardization Process, 2025. https://csrc.nist.gov/pubs/ir/8545/final

Tags: HQCDecoding Failure RateCCA SecurityReaction Attacks