← Back to section · Open Source Projects

The Place of Reference Implementations: Where the Ecosystem's 「Standard Answer」 Comes From

Every post-quantum algorithm that entered the NIST process arrived with a reference implementation. It is not fast, not side-channel resistant and not deployable as-is, yet it is the source of test vectors, the baseline for interoperability checks and the reference point for every later implementation. This piece explains what role reference implementations actually play in the open-source ecosystem, and the most common mistakes made when using them.

Published 22 November 2026 · 5 min read · PQ Frontier

The Place of Reference Implementations: Where the Ecosystem's 「Standard Answer」 Comes From
AI-generated site artwork
Video explainer · PQC Open Source Projects: from papers to key-exchange code

One class of code holds a special status in the post-quantum open-source ecosystem: reference implementations. The NIST standardization process requires every submission to come with a reference implementation written in a high-level language, and after an algorithm is finalized, official or semi-official versions of these implementations circulate alongside the standard text. Their names appear constantly in the acknowledgements and provenance notes of other projects, yet few people spell out what they are actually for, and why the whole ecosystem revolves around them. This piece explains that role in full.

First Role: Disambiguating the Standard Text

Cryptographic standards are written in natural language and mathematical formulas, and however rigorous the text, implementation-level ambiguities remain: how a certain intermediate value is serialized, in what order a hash input is concatenated, which branch a boundary case takes. These questions cannot be settled by arguing over the text; the final arbiter is code that runs. The reference implementation is that arbiter: when two implementations disagree, you first look at what the reference computes. Maintained personally by the algorithm’s design team and revised in sync with the specification, its authority on the question of 「what this algorithm is」 can exceed that of any second-hand interpretation. When an open-source project adopts an algorithm, its first step is often to get the reference implementation running as the control group for all subsequent work.

Second Role: The Source of Test Vectors

How is correctness verified? By known-answer tests: given fixed inputs, the output must match officially published expected values byte for byte. Where do those expected values come from? They are produced by running the reference implementation. The intermediate-value and final-value test data NIST publishes for standards such as ML-KEM and ML-DSA all originate from confirmed reference implementations. A verification chain thus forms across the ecosystem: production libraries check themselves against test vectors, test vectors are vouched for by reference implementations, and reference implementations are vouched for by the standard text and the design teams. When any link disagrees, the chain lets you locate where the problem sits. In interoperability testing, when two teams’ implementations fail to handshake, the eventual procedure is likewise to compare intermediate values against the reference implementation segment by segment.

What It Deliberately Does Not Do: Speed and Side Channels

A reference implementation optimizes for exactly two things: correctness and clarity. To that end it is often deliberately 「naive」: the plainest loops, the most readable variable names, no vectorization, no bit tricks. More importantly, it usually does not guarantee constant-time execution; its table lookups may vary with secret data and its memory access patterns are unmasked — in other words, it is essentially undefended against side channels. That is not a defect but a division of labour: side-channel resistance demands platform-specific, repeated polishing, which naturally conflicts with the goal of 「one codebase, readable everywhere」. Compiling a reference implementation straight into a production system is the most typical and most dangerous misuse in this field, and several security advisories trace back to it. The correct posture is to lock it into the testing and reference position.

The Pipeline That Grew Around It

Understanding the reference implementation’s place lets you see the division of labour among PQC open-source projects. The first link is the reference implementation itself, from the submission team. The second is clean reimplementation, represented by PQClean: rewriting the reference code to a uniform engineering discipline — portable, auditable, composable — still without chasing speed. The third is optimized implementations: vectorization and assembly tuning for x86, ARM or microcontrollers, where constant-time concerns are handled seriously and benchmarking projects such as pqm4 do the evaluating. The fourth is production adoption: libraries like OpenSSL and Bouncy Castle turn the algorithm into a fully engineered, formally supported feature that passes their own code review, security processes and compliance certification. Research libraries like liboqs span the second and third links. Each project’s position on this chain defines the scope of its promises; demanding fourth-link standards from the first link, or using first-link code to do the fourth link’s job, is a category error.

An Easily Overlooked Detail: Reference Implementations Change Too

During standardization, parameters and details are adjusted and reference implementations are updated with them; draft and final versions may be mutually incompatible — the evolution from Kyber to ML-KEM is the example. This means the sentence 「we used the reference implementation」 is meaningless without a version attached, and open-source projects should record the corresponding specification version when archiving and citing implementations, or reference verification degenerates into confusion. That is why serious projects carefully register the provenance and version of every implementation in their metadata.

Who Maintains the 「Standard Answer」

One more easily overlooked question: who is responsible for reference implementations in the long run? At finalization, the maintainers are the design teams, who know the details best. But as time passes and team members move on, the revision cadence slows, and errata often have to be pushed by the community through mailing lists and repositories. Meanwhile, the test vectors published by standards bodies gradually take over the role of 「final authority」 — once frozen and published, vectors become a more stable reference than code, because any implementation can check itself against them without depending on whether some codebase still compiles. That is why, in a mature ecosystem, test-vector documents rank no lower than the reference implementations themselves: the former are static and archivable, the latter are alive and rot as toolchains age. For project maintainers, archiving the exact reference-implementation and test-vector versions once depended on is the cheapest form of self-protection.

Closing

Reference implementations are the origin point of the post-quantum open-source ecosystem: they define correctness, produce test vectors and serve as the control group for every implementation. They are not for production and should not be used for production; their authority comes from restraint. When evaluating any PQC open-source project, ask first 「where does it sit on this pipeline, and what does it use the reference implementation for」 — and the project’s positioning and credibility become roughly clear.

Tags: Reference ImplementationsTest VectorsOpen Source Ecosystem