← Back to section · Post-Quantum Cryptography
Size Engineering for Code-Based Schemes: Fitting a Megabyte Public Key into the Real World
A large public key is not a sin; failing to manage it is. From systematic form and seed-based generation to quasi-cyclic compression and ciphertext optimization, and on to the real ledger of transport, caching, and hardware implementation: how code-based schemes make peace with size at the engineering layer.
First, total the ledger
Code-based schemes are forever being pointed at for their key sizes, but size is never an isolated number. The real cost of a public key depends on how it flows through a system: is it provisioned once into a device and fixed forever, or transmitted over the wire at every handshake? Does it circulate inside a data-center network, or must it traverse satellite links and legacy hardware security modules? McEliece’s public key costs almost nothing in “provisioned, static, long-term” scenarios and is a non-starter in TLS-style dynamic ones. The first lesson of size engineering is therefore not compression technique but scenario taxonomy: ask about the public key’s life cycle before discussing byte counts.
The first compression: systematic form
The original McEliece public key is a complete generator matrix, much of which is linearly derivable from the rest. Switching to the Niederreiter form and reducing the parity-check matrix to systematic form leaves only the dense block to actually store: the identity part is universally known and needs no transmission. This step removes a substantial, code-rate-dependent fraction of the public key, and Classic McEliece’s entry-level figure of 261 KB is already the post-systematic-form number. The specification even fixes the bit layout of (packed in column-major order) so that different implementations interoperate byte for byte — only at this granularity of size engineering is interoperability guaranteed.
The second lever: seeds and structure
Compression on the private side has reached its limit case: a Classic McEliece private key essentially needs only a short seed, with all remaining material (the polynomial, the support set, the secret used for rejection) recomputed by a deterministic procedure. Expand on demand when the key is needed; otherwise it occupies a few dozen bytes — the same trick lattice schemes use when generating matrices from seeds.
Going further on the public side requires introducing structure: quasi-cyclic codes collapse the public key to a single row (the BIKE route), at a cost and risk already accounted for in the structural-attacks article — a trade of security margin for size. A compromise that leaves the structure untouched changes the distribution method instead: the public key is not transmitted with each connection but delivered in advance over a trusted channel, with only a hash reference sent at run time; or the large key is placed in a long-lived certificate while daily handshakes use short-term keys. This “deployment-shape engineering” is entirely feasible in firmware-signing and offline-distribution scenarios — precisely the home ground the McEliece team claims for the scheme.
Ciphertexts and computation: the ignored half
Staring only at the public key misses one of the code-based route’s great strengths: tiny ciphertexts. McEliece ciphertexts run to just one or two hundred bytes, smaller than those of many lattice schemes; the core operations of encapsulation and decapsulation are matrix multiplication and algebraic decoding, measured in microseconds to milliseconds on ordinary processors. The genuinely expensive step is key generation: Gaussian elimination to systematic form on a million-entry matrix, whose cost climbs steeply with parameters — but it happens once in a key’s lifetime and can be done slowly, offline. At the implementation level one must also handle constant-time decoding, secret-independent retries after elimination failure, and the memory layout of large matrices (cache-friendly blocking can yield order-of-magnitude speedups). These details determine the gap between the same parameter set on paper and on a device.
The trust anchor for a large key: fingerprints and digests
A large public key comes with a companion piece of engineering that is often overlooked: how do you confirm that the megabyte you received is really the other party’s public key and not a substituted forgery? The answer is the same old method used to verify large files — check a short digest out of band. In a deployment flow, the public key itself may travel over an untrusted channel (it is not secret to begin with), but its hash fingerprint — a few dozen bytes — must arrive first over a trusted channel or be written into the firmware’s root of trust; the receiver recomputes the digest, and only on a match accepts the key. The large volume then affects only distribution bandwidth, not the cost of establishing trust — the size of the trust anchor is completely decoupled from the size of the public key. In certificate systems this corresponds to the old pattern of “root certificates pre-provisioned, intermediate material fetched on demand.” Think this layer through, and half of the “the key is too big to use” anxiety dissolves: what truly needs trusted delivery was never more than a few dozen bytes; the rest is a logistics problem, and logistics problems have logistics solutions.
The scenario ledger: where it works, where it does not
Tally the ledger at scenario granularity. For firmware and code-signing verification endpoints, the public key is provisioned into read-only storage and hundreds of KB are a one-time material cost — highly feasible. For long-term archival encryption and offline key distribution, the public key arrives by physical or trusted channels and size is irrelevant. For server-to-server authentication inside an enterprise network, if keys can be pre-distributed by the configuration system, it works as well. Conversely, open-Internet TLS handshakes must squeeze the public key into a certificate chain transmitted in real time, where hundreds of KB directly inflate handshake latency and failure rates — impractical at present. Resource-constrained IoT endpoints whose storage is measured in hundreds of KB must be assessed case by case, since the public key itself would crowd out firmware space. The conclusion is not “large-key schemes are useless” but that they come with an explicit map of applicability — which is why NIST did not select the scheme as a general standard while ISO still keeps its route open: the two judgments correspond to different scenario weightings.
Closing
The essence of size engineering is to put a string of bytes back into the system and revalue it. After systematic form, seeding, structural compression, distribution shape, and the scenario ledger are stacked together, the code-based route’s “bigness” turns from a blanket accusation into a set of discussable engineering parameters. When the day comes to choose a scheme for a concrete system, this ledger is the decision table: how does the public key flow, how many times, and where does it live — answer those three questions, and whether to use McEliece or BIKE decides itself.
Tags: Key SizesImplementation EngineeringClassic McElieceSystematic Form