← Back to section · Post-Quantum Cryptography

Binary Goppa Codes: The Decoding Machine Behind the McEliece Private Key

Why Goppa codes can be decoded efficiently yet are hard to recognize: from the rational-function definition and the doubling of minimum distance, to the key equation of Patterson's algorithm, and their close kinship with — and essential difference from — Reed–Solomon codes.

Published 22 November 2026 · 6 min read · PQ Frontier

Binary Goppa Codes: The Decoding Machine Behind the McEliece Private Key
AI-generated site artwork
Video explainer · Code-based cryptography

One definition, two fates

Among thousands of error-correcting codes, why did McEliece choose Goppa codes? Because cryptography needs a peculiar duality: for the holder of the private key, decoding must be fast to the millisecond; for someone who sees only the public key, the code must be indistinguishable from a random code. Goppa codes are among the few families satisfying both sides — their very definition carries an efficient decoding key, and once that key is hidden, no one in over forty years has been able to recognize the structure from outside.

The definition: a divisibility condition on a rational function

Take a finite field F2m\mathbb{F}_{2^m}, a polynomial g(x)g(x) of degree tt (the Goppa polynomial), and nn distinct field elements L=(α1,…,αn)L = (\alpha_1, \dots, \alpha_n), none of them a root of gg (the support set). A binary vector c\mathbf{c} is a codeword if and only if

∑i=1ncix−αi≡0(modg(x))\sum_{i=1}^{n} \frac{c_i}{x - \alpha_i} \equiv 0 \pmod{g(x)}

That is, treating the codeword as a set of “weights,” the rational function it constructs is exactly divisible in the modulo-g(x)g(x) sense. This condition is equivalent to a system of tt linear equations over the field, yielding a linear code of dimension at least n−mtn - mt. Goppa codes are close relatives of Reed–Solomon codes: both speak the language of evaluation and interpolation, and a Goppa code can be viewed as the subfield subcode of a generalized Reed–Solomon code — restricting the coefficients to the binary subset. The kinship explains why their decoding algorithms resemble each other, and it also plants the key difference discussed below: the subfield-subcode step buries the structure one layer deeper.

The binary dividend: distance doubles automatically

Goppa codes have a property that delights designers. If g(x)g(x) has no repeated roots (is square-free), then in the binary case the minimum distance is not the t+1t+1 given by the general bound, but at least 2t+12t+1. The reason is that the differential structure of binary vectors automatically strengthens the parity condition: the same polynomial constrains both the function itself and its formal derivative. Doubling the distance means the correction radius jumps from the order of t/2t/2 to tt: for the same polynomial size, you buy twice the error-correction capability. The values of tt in McEliece parameters — 64, 96, 119, 128 — rest on precisely this dividend; without it, public keys would have to be larger still.

Patterson’s algorithm: decoding as equation solving

How does the private-key holder correct errors? Patterson’s 1975 algorithm turns the problem into solving a polynomial equation. First compute the syndrome polynomial s(x)s(x) from the received vector — it summarizes the “signature” of the errors at each coordinate. If s(x)s(x) is invertible modulo g(x)g(x), form T(x)=s(x)−1+xT(x) = \sqrt{s(x)^{-1} + x}; this square root is a linear operation in a characteristic-2 field and therefore nearly free. Then use the extended Euclidean algorithm to solve the key equation σ(x)≡T(x) τ(x)(modg(x))\sigma(x) \equiv T(x)\,\tau(x) \pmod{g(x)}, stopping when the degree of τ\tau reaches the order of t/2t/2. The resulting σ\sigma is the error-locator polynomial: its roots point exactly at the erroneous coordinates. Find the roots, flip the corresponding bits, verify that the syndrome vanishes — decoding is complete.

The whole pipeline consists of polynomial operations whose complexity grows polynomially in the parameters, with no search at all. This is why McEliece decryption is fast: error correction is not brute-force trial but a single equation solve. Modern implementations additionally impose constant-time discipline on this pipeline, so that the timing of the root-finding step does not vary with the error positions.

Separable Goppa codes: the branch the specification actually uses

The square-root step of Patterson’s algorithm has a precondition: g(x)g(x) must have no repeated roots. Goppa codes satisfying this condition are called separable Goppa codes, and they are exactly the branch Classic McEliece uses — key generation explicitly tests for and rejects polynomials with repeated roots. Separability wins twice: it is the precondition for the distance-doubling dividend, and it lets Patterson’s algorithm be applied directly and unmodified, avoiding the general (and slower) decoding path that handles repeated roots. In other words, the specification restricts the code family to the subset with “the best properties and the smoothest algorithm,” and relies on the size of the key space to ensure this restriction costs no security: a randomly drawn irreducible polynomial of degree tt is square-free with non-negligible probability, so the candidate pool remains astronomically large. Engineering and mathematics reach a typical compromise here — do not pursue the most general code; use only the best-behaved class.

Why it cannot be recognized

The natural question: with the public matrix in plain sight, why can’t an attacker recover g(x)g(x) and the support set? Because, starting from a parity-check matrix in systematic form, recovering the Goppa structure is equivalent to distinguishing “an algebraic code scrambled by random permutations and basis changes” from “a genuinely random code” — the so-called Goppa code distinguishing problem. For binary Goppa codes at the parameters McEliece uses, no effective distinguisher is known to this day — certain generalized Reed–Solomon codes at high rates were indeed broken by structural attacks (another article tells that story), but the subfield-subcode step erases precisely the algebraic fingerprints those attacks rely on. The definition hands over the key, the permutation hides the keyhole, and the distance dividend compresses the parameters to a usable size — that is the whole secret of how Goppa codes have survived in cryptography for over forty years.

Where the parity-check matrix comes from

One more link in the chain that is often skipped: how does the divisibility condition in the definition become a matrix in the implementer’s hands? Expand the condition ∑ici/(x−αi)≡0(modg(x))\sum_i c_i/(x-\alpha_i) \equiv 0 \pmod{g(x)} and it is equivalent to requiring the numerator polynomial of the rational sum to vanish modulo g(x)g(x) — that is, its tt coefficients must vanish one by one, each giving a linear equation over F2m\mathbb{F}_{2^m}. Expanding every field element into mm binary coordinates along a basis yields mtmt binary parity equations in total, which arranged into a matrix give the parity-check matrix H\mathbf{H}. This derivation explains the product mtmt that recurs throughout the parameter tables: it is not an arbitrary number but the necessary consequence of ”tt field equations × mm bits per equation.” When the private-key holder decodes, they travel this chain in reverse: first reassemble the binary syndrome into a syndrome polynomial over the field, then hand it to Patterson’s algorithm. Definition, matrix, and algorithm mesh together without a seam.

Closing

Goppa codes are to McEliece what lattices are to ML-KEM: both the source of the hard problem and the channel for legitimate decoding. Understanding their definition, the distance dividend, and Patterson’s algorithm means understanding the central machine of code-based cryptography — every other code-based scheme, from the quasi-cyclic BIKE to the polynomial-code HQC, is a different answer to the same proposition: how to make decoding easy only for its owner.

Tags: Goppa CodesPatterson AlgorithmError-Correcting CodesMcEliece