← 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.
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 , a polynomial of degree (the Goppa polynomial), and distinct field elements , none of them a root of (the support set). A binary vector is a codeword if and only if
That is, treating the codeword as a set of “weights,” the rational function it constructs is exactly divisible in the modulo- sense. This condition is equivalent to a system of linear equations over the field, yielding a linear code of dimension at least . 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 has no repeated roots (is square-free), then in the binary case the minimum distance is not the given by the general bound, but at least . 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 to : for the same polynomial size, you buy twice the error-correction capability. The values of 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 from the received vector — it summarizes the “signature” of the errors at each coordinate. If is invertible modulo , form ; 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 , stopping when the degree of reaches the order of . The resulting 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: 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 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 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 and it is equivalent to requiring the numerator polynomial of the rational sum to vanish modulo — that is, its coefficients must vanish one by one, each giving a linear equation over . Expanding every field element into binary coordinates along a basis yields binary parity equations in total, which arranged into a matrix give the parity-check matrix . This derivation explains the product that recurs throughout the parameter tables: it is not an arbitrary number but the necessary consequence of ” field equations × 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