Lattice-based cryptography vs code-based cryptography: two families

Lattice-based schemes such as ML-KEM are the primary NIST key encapsulation standard, while code-based schemes such as HQC and Classic McEliece rest on error-correcting codes and differ widely in key size. This page sets the two families side by side using the sources listed on the page.

On this page

Which family fits your post-quantum key exchange, and why it matters

Lattice-based schemes such as ML-KEM are built on structured lattices, while code-based schemes such as HQC and Classic McEliece are built on error-correcting codes. For most architects and reviewers, the distinction that matters most in practice is public key size and standards status, not the underlying mathematics. ML-KEM is the primary general-purpose key encapsulation standard, published by NIST as FIPS 203 on 13 August 2024. NIST selected HQC on 11 March 2025 as a backup in case ML-KEM is ever broken, and it planned a draft standard in about a year and a final standard in 2027. Classic McEliece is standardized in ISO/IEC 18033-2:2006/Amd 2, which the IETF draft draft-josefsson-mceliece-05 says ISO adopted in June 2026. Before you choose a family, confirm with each standard or vendor which version and edition applies to your deployment.

You will meet this question in several places. Architects and security leads see both names in TLS and SSH documentation, in library release notes and in tenders that list acceptable algorithms. Procurement reviewers see them in vendor questionnaires that ask which key encapsulation mechanism a product uses. The practical consequence of the size difference is large: the ML-KEM-768 public key is 1184 bytes according to RFC 9935, while the Classic McEliece 348864 public key is 261120 bytes according to liboqs. A key of that size changes handshake messages, certificate sizes and storage, so a protocol or appliance designed around small keys may not accept it without changes.

When you review a vendor's answer, ask which family it uses, which exact parameter set it implements and whether the implementation follows the current specification. Note that ML-KEM and HQC are both key encapsulation mechanisms and appear in TLS 1.3 hybrid groups such as X25519MLKEM768, defined in draft-ietf-tls-ecdhe-mlkem-04, while Classic McEliece is disabled by default in liboqs and its upstream project has no active maintenance. BSI recommends that post-quantum schemes be used in combination with classical schemes where possible, and RFC 9794 defines the hybrid combinations that such deployments rely on. Confirm the current status of each algorithm in the standard that your regulator or customer names, because a backup standard and a primary standard carry different expectations for planning and support.

Lattice and code-based schemes side by side

This table sets the lattice family (ML-KEM, and the Kyber lineage) against the code-based family (HQC and Classic McEliece) on the attributes the sources give: basis, named schemes, documents, standards status, and sizes in bytes for named parameter sets. Sizes are tied to the parameter set they describe, so compare like with like. Read the status row first, since it shows which scheme is standardized and which is still in process.

AttributeLattice-based (ML-KEM)Code-based (HQC and Classic McEliece)
Underlying basisStructured lattices, with the learning with errors problem over module lattices (Kyber project page)Error-correcting codes; HQC's security rests on the Quasi-Cyclic Syndrome Decoding problem (HQC team site)
Named schemesML-KEM, formerly CRYSTALS-Kyber, with 512, 768 and 1024 parameter sets (RFC 9935)HQC with HQC-1, HQC-3 and HQC-5 variants; Classic McEliece with 348864, 460896, 6688128, 6960119 and 8192128 sets (HQC team site, liboqs Classic McEliece)
Defining document and dateFIPS 203, announced by NIST on 13 August 2024 (NIST news 2024-08); RFC 9935, March 2026NIST selected HQC on 11 March 2025 (NIST HQC announcement); draft-josefsson-mceliece-05, 23 June 2026, transcribes the ISO text for Classic McEliece
Standards statusFinalized NIST standard FIPS 203, the primary standard for general encryption (NIST news 2024-08)HQC: NIST planned a draft standard in about a year and a final standard in 2027 (NIST HQC announcement). Classic McEliece: standardized by ISO in June 2026 in ISO/IEC 18033-2:2006/Amd 2 (draft-josefsson-mceliece-05)
Public key size in bytesML-KEM-512: 800; ML-KEM-768: 1184; ML-KEM-1024: 1568 (RFC 9935)HQC-1: 2241; HQC-3: 4514; HQC-5: 7237 (HQC team site). Classic McEliece 348864: 261120 (liboqs Classic McEliece)
Ciphertext size in bytesML-KEM-512: 768; ML-KEM-768: 1088; ML-KEM-1024: 1568 (RFC 9935)HQC-1: 4433; HQC-3: 8978; HQC-5: 14421 (HQC team site). Classic McEliece 348864: 96 (liboqs Classic McEliece)
Where it is supportedShown in RFC 9935 and TLS hybrid groups such as X25519MLKEM768 (draft-ietf-tls-ecdhe-mlkem-04); OpenSSL 3.5.0 and Go 1.24 include ML-KEM supportAvailable in liboqs, where Classic McEliece is disabled by default and upstream has no active maintenance (liboqs Classic McEliece). Confirm support in the libraries and versions you run
Role in NIST's current planPrimary standard for general encryption (NIST news 2024-08)NIST describes HQC as a backup in case quantum computers someday crack ML-KEM (NIST HQC announcement)

What each family is and where practitioners meet it

Lattice-based key encapsulation is the family that practitioners meet most often in current deployments. ML-KEM is the name NIST gave to the scheme formerly called CRYSTALS-Kyber, and it is specified in FIPS 203, published on 13 August 2024 as the primary standard for general encryption. The Kyber project describes it as an IND-CCA2 KEM whose security relies on learning with errors over module lattices. FrodoKEM is also a learning with errors KEM, but it uses an unstructured lattice. It was not selected by NIST, was a Round 3 alternate candidate, and is standardized in ISO/IEC 18033-2:2006/Amd 2:2026 according to the FrodoKEM project site.

  • Defining document: FIPS 203 for ML-KEM. The IETF specifies its use in TLS and other protocols through RFC 9935, which gives ML-KEM-768 a public key of 1184 bytes and a ciphertext of 1088 bytes.
  • Security problem: Learning with errors over module lattices for ML-KEM, and learning with errors over unstructured lattices for FrodoKEM.
  • Where it appears in protocols: The hybrid TLS 1.3 groups X25519MLKEM768, SecP256r1MLKEM768 and SecP384r1MLKEM1024 in draft-ietf-tls-ecdhe-mlkem-04, which lists client key shares of 1216, 1249 and 1665 bytes respectively.
  • Where it appears in libraries: OpenSSL 3.5.0, released 8 April 2025, supports ML-KEM and makes X25519MLKEM768 part of its default TLS key shares. Go 1.24 provides crypto/mlkem, implements ML-KEM-768 and ML-KEM-1024 as in FIPS 203, and enables X25519MLKEM768 by default in crypto/tls. OpenSSH 10.0 uses the hybrid mlkem768x25519-sha256 by default.
  • Size and form: RFC 9935 lists ML-KEM-512 with a public key of 800 bytes and ML-KEM-1024 with 1568, and gives a 32-byte shared secret across the set.

Before relying on any of these, confirm the exact version and build your environment runs, because default behavior and supported groups vary between releases.

Differences that change systems, configurations or decisions

Lattice-based and code-based schemes differ in key size, ciphertext size, computing cost and standardization status. Each difference below changes what a system must store, transmit or approve, so each one is worth checking before a design is fixed.

Public key size gap

ML-KEM-768 has a 1184-byte public key, while Classic McEliece 348864 has a public key of 261120 bytes. A design that stores, caches or sends public keys in fixed-size fields, or that carries them inside a handshake, has to be sized for the larger family. Check the key size for every parameter set you intend to run, not only the one in a summary table, and confirm the limits of your protocol stack and certificate tooling before selecting a code-based scheme.

RFC 9935 sizes

Ciphertext size differences

ML-KEM-768 produces a 1088-byte ciphertext, while Classic McEliece 348864 produces a 96-byte ciphertext. The ciphertext is the part sent across the wire during key establishment, so the smaller ciphertext of the code-based scheme reduces that transfer while its public key is much larger. Measure both directions of the exchange, including the client and server key shares, before deciding which cost a network path or a constrained device can carry.

Classic McEliece ciphertext
96 bytes
RFC 9935 sizes

Relative computing cost

NIST said in March 2025 that HQC demands more computing resources than ML-KEM and is a lengthier algorithm. The source does not quantify the difference, so do not treat it as a measured gap. Ask the implementer for benchmark results on the hardware you run, and record the figures alongside the parameter set you selected so the trade-off can be reviewed later.

NIST HQC announcement

Standards status and timing

FIPS 203 is a published NIST standard for ML-KEM, announced on 13 August 2024. HQC was selected on 11 March 2025, and NIST planned a draft standard in about a year and a final standard in 2027. NIST's project page, read on 4 December 2026, says the HQC process is underway and does not name a FIPS number for it. Procurement and audit evidence that requires a final standard should be checked against the status on the day the decision is made.

NIST PQC project

ISO route for code-based and FrodoKEM

Classic McEliece is described in an IETF draft as standardized by ISO in June 2026 in ISO/IEC 18033-2:2006/Amd 2. FrodoKEM is also standardized in that amendment and was not selected by NIST. A design or procurement that cites NIST standards will not find these schemes under FIPS, so reviewers should check whether their standards policy accepts ISO-published mechanisms before choosing one.

Classic McEliece draft

Maintenance note in liboqs

The liboqs page for Classic McEliece states that upstream has no active maintenance, and that the scheme is disabled by default and must be enabled with a build flag. A team that builds liboqs into its product should decide who will track upstream changes, confirm the build option is set deliberately, and record that the implementation is not actively maintained by its upstream project.

liboqs Classic McEliece

Where ML-KEM and code-based schemes show up in protocols and products

The clearest place to see lattice-based key establishment in practice is in default protocol settings. The IETF draft draft-ietf-tls-ecdhe-mlkem-04, dated 8 February 2026 as a Standards Track draft, defines TLS 1.3 hybrid groups that pair ML-KEM with an elliptic curve: X25519MLKEM768 (codepoint 4588), SecP256r1MLKEM768 (4587) and SecP384r1MLKEM1024 (4589). Engineers running TLS stacks should check which of these groups their libraries offer and in what order. Three widely used stacks already default to ML-KEM hybrids. OpenSSL 3.5.0, released 8 April 2025, changes its default TLS key shares to offer X25519MLKEM768 and X25519. Go 1.24 enables X25519MLKEM768 in crypto/tls when Config.CurvePreferences is nil, and the GODEBUG setting tlsmlkem=0 reverts this. OpenSSH 10.0, released 9 April 2025, uses the hybrid mlkem768x25519-sha256 for key agreement by default. Operators should confirm these defaults against the version they actually run, since a default in one release may be changed or overridden in configuration.

Code-based schemes appear in a different and narrower set of places. The liboqs project, which provides a library of post-quantum algorithms, lists Classic McEliece with specification version SUPERCOP-20221025. Its documentation says upstream has no active maintenance and that the scheme is disabled by default, so it must be enabled at build time with -DOQS_ENABLE_KEM_CLASSIC_MCELIECE=ON. The same liboqs project also lists HQC with specification version v5.1.0. On the standards side, the IETF draft draft-josefsson-mceliece-05, dated 23 June 2026 as Informational, transcribes ISO text stating that ISO standardized Classic McEliece in June 2026 in ISO/IEC 18033-2:2006/Amd 2. Reviewers should read that amendment directly and not rely on the draft's summary. The sources listed on this page do not list HQC in any of the product defaults named above, so teams should not assume HQC is enabled in OpenSSL, Go, OpenSSH or TLS hybrid groups. Confirm HQC support in each product and version under review, and note that NIST's project page, read on 4 December 2026, says the HQC key encapsulation mechanism is in standardization without naming a final FIPS number.

The practical takeaway is that the size gap between families affects where each can be deployed. ML-KEM-768 has a 1184-byte public key and 1088-byte ciphertext according to RFC 9935, while Classic McEliece 348864 has a 261120-byte public key and 96-byte ciphertext according to liboqs. Before adopting a code-based scheme, teams should confirm that their handshake messages, certificates or key storage can carry those sizes, and that their products expose the scheme at all. BSI's guidance, which names TR-02102-1 version 2026-01 as its current recommendation, says post-quantum schemes should be used in combination with classical schemes where possible. Teams planning a rollout should ask each vendor which algorithms, versions and build flags it supports, and whether the component is maintained.

How to work out which family applies to your system

This sequence shows how to tell whether a lattice-based or code-based scheme is in use, and which parameter set and version it runs, by checking the standard that names it, the key and ciphertext sizes your stack accepts, the library defaults and the vendor documentation. Each step ends with a check you can record, and the result is a confirmed list of schemes for your exact versions.

  1. Identify the scheme name from the standard or contract

    Start with the document that governs your system, whether that is a vendor specification, a protocol draft, a procurement requirement or an internal design record, and list every key establishment and signature scheme it names. Note whether each name is a standardized identifier such as FIPS 203 (ML-KEM) or a candidate name such as HQC or Classic McEliece, and whether it is cited in ISO/IEC 18033-2. Lattice schemes in this family include ML-KEM and FrodoKEM, while code-based schemes include HQC and Classic McEliece. Your output is a written list of scheme names, each tagged with the document that names it.

  2. Map each scheme to its family and status

    For each name on the list, record the family it belongs to and its current standardization status, using the NIST project page, the IETF draft or the project site for that scheme. NIST describes ML-KEM as built around structured lattices and HQC as built around error-correcting codes, and it has selected HQC for standardization with a final standard planned for 2027. Mark any scheme that is a backup, an alternate candidate or a standard published outside NIST, so the list separates primary choices from fallback options. The output is a table with columns for scheme, family, status and source.

  3. Check key and ciphertext sizes against your stack

    Compare the public key and ciphertext sizes for each parameter set with the limits in your protocol messages and certificate chain, using the byte values given in the RFC or library page for that scheme. Public key sizes differ widely between families: ML-KEM-768 has a 1184-byte public key, while Classic McEliece 348864 has a 261120-byte public key and a 96-byte ciphertext. Confirm that your handshake buffers, certificate size limits and key storage can hold the larger value, and record any field that would need changing. The output is a sizing table that shows, for each scheme, which limit it hits first.

  4. Confirm library version and default enablement

    Check the exact version of each cryptographic library you run, and check whether the scheme is enabled by default in that build. The liboqs page states that Classic McEliece is disabled by default and must be turned on with a build flag, and that its upstream project has no active maintenance. Go 1.24 enables X25519MLKEM768 by default in crypto/tls, and OpenSSH 10.0 uses the hybrid mlkem768x25519-sha256 by default. Run the library's own listing command or read its build configuration, then record the version and whether each scheme is active. The output is a version-stamped list of enabled schemes.

  5. Check the vendor documentation for the parameter set

    Read the vendor documentation for the product that terminates the connection, and find the parameter set it uses for each scheme, such as ML-KEM-768 or HQC-3. Look for the security category, the key sizes and the protocol group identifier, and note any statement about hybrid use, since BSI recommends combining post-quantum schemes with classical ones where possible. If the documentation does not give a parameter set, ask the vendor in writing and record the date of the reply. The output is a vendor-confirmed parameter list for each product.

  6. Confirm compatibility for the exact versions you run

    Test the chosen scheme and parameter set on the versions you actually deploy, because a scheme name alone does not establish that two implementations interoperate. Run a handshake or key exchange between your client and server builds and record the negotiated group or algorithm identifier from the logs. Repeat the test for each version pair in production, and do not assume that a result for one release applies to another. The output is a compatibility record that names each tested version, the scheme negotiated and the date of the test.

Questions readers ask about lattice-based and code-based cryptography

Are ML-KEM and HQC the same thing?

No. They are different key encapsulation mechanisms built on different mathematical foundations. ML-KEM is built around structured lattices, while HQC is built around error-correcting codes. NIST's March 2025 announcement describes this split directly: it selected HQC as a backup in case quantum computers someday crack ML-KEM, which only makes sense because the two rest on different assumptions. The HQC team describes its security as resting on the Quasi-Cyclic Syndrome Decoding problem, and ML-KEM's security relies on learning with errors over module lattices. Because the assumptions differ, a weakness found in one family does not automatically apply to the other. Confirm which algorithm your product implements before drawing conclusions.

Which post-quantum family did NIST standardize first?

The lattice family came first. NIST announced FIPS 203 (ML-KEM, formerly CRYSTALS-Kyber), FIPS 204 (ML-DSA, formerly CRYSTALS-Dilithium) and FIPS 205 (SLH-DSA, formerly Sphincs+) on 13 August 2024. ML-KEM is described as the primary standard for general encryption. The code-based family came later. NIST selected HQC on 11 March 2025, and its project page, read on 4 December 2026, says HQC was selected for standardization with the process underway. NIST's March 2025 announcement noted that HQC was the only algorithm standardized from its fourth round and that a draft standard was planned for about a year later, with a final standard in 2027.

Is HQC required for compliance?

The sources in this topic do not establish that HQC is required by any regulation or mandate. NIST selected HQC as a backup encryption mechanism, and its project page says standardization is underway, but a selection is not the same as an obligation for commercial organizations. Requirements that matter for your environment may come from a contract, a sector regulator, or a national security system policy, so check those documents directly. The BSI guidance in this topic recommends combining post-quantum schemes with classical schemes where possible. Ask your compliance team and any federal customer which algorithms they expect you to support.

Why are Classic McEliece key sizes so large?

The liboqs documentation lists public key sizes that are far larger than other schemes. For example, the Classic-McEliece-348864 public key is 261120 bytes, while its ciphertext is only 96 bytes. By comparison, ML-KEM-768 has a 1184-byte public key according to RFC 9935. The sources in this topic report the sizes but do not explain the design reasons behind them, so avoid assuming a cause. In practice, large public keys affect handshake messages, storage and certificate sizes, so measure the impact in your own protocol stack. Also note that liboqs says upstream Classic McEliece has no active maintenance and is disabled by default.

Do organizations need both families?

The sources do not say that every organization must deploy both families. NIST's position is that HQC serves as a backup to ML-KEM, which suggests a diversity rationale: a second, differently based scheme limits the impact of a future break in one family. Whether that matters for your environment depends on your threat model, data lifetime and how hard your system is to change later. Hybrid designs add another dimension. RFC 9794 defines a PQ/T hybrid as combining at least one post-quantum algorithm with at least one traditional algorithm. Ask your architects which combination your products support and how it is configured.

What should I ask a vendor about lattice and code-based algorithms?

Ask which family each product uses and which specific algorithm and parameter set it implements, such as ML-KEM-768, HQC-1 or Classic-McEliece-348864. Ask for the specification version the product follows, the security model, and whether the algorithm is enabled by default. Request the key and ciphertext sizes, and ask how the product handles the larger sizes in its protocol messages. For hybrid deployments, ask which classical and post-quantum algorithms are combined and whether the configuration matches the RFC or draft cited in the vendor's documentation. Also ask how the vendor will update the algorithm if standards change, and whether the library is actively maintained.

How DeployOpen works on this

When a migration plan needs to compare lattice-based and code-based key establishment, DeployOpen starts from the systems that use each family and the sizes and standards that apply to them. The work is scoped in writing, built against the product versions you run, and handed over with documentation your security and compliance teams can review.

How we scope

  • We list the key establishment points in your environment and which product, library or protocol version carries each one.
  • We record which algorithm families, parameter sets and key sizes each system is expected to use, based on the versions in scope.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before any work starts.

How we build

  • We configure and test the libraries and protocols that carry ML-KEM, HQC or Classic McEliece in your own infrastructure, checking each against its current specification.
  • We measure handshake and key sizes on your actual network path, since published sizes apply to the algorithm, not to your deployment.
  • We flag systems where a code-based option has a larger public key than the lattice option, so the sizing impact is visible before rollout.

How we hand over

  • We document each chosen algorithm, its standard or draft reference and the version it was tested against, so reviewers can trace the decision.
  • We leave a record of which components were checked, which remain pending standardization, and what to confirm before the next upgrade.
  • We deliver the configuration and evidence in a form your auditors and internal reviewers can work from directly.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, covering changes in library versions and standards status.
  • We retest after each library upgrade, since specification versions and default settings can change between releases.
  • We confirm with you when a standard is finalized or a draft changes, so the documented choices stay aligned with the current text.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.