← Back to section · Research Resources

A Guide to NIST Submission Package Code: Reference Implementations, Optimized Implementations, and Known Answer Tests

Every NIST PQC submission package ships with code: a reference implementation, platform-optimized implementations, and KAT files. This guide explains what each of the three is for, the directory conventions, and how versions line up after standardization.

Published 22 November 2026 · 6 min read · PQ Frontier

A Guide to NIST Submission Package Code: Reference Implementations, Optimized Implementations, and Known Answer Tests
AI-generated site artwork
Video explainer · Open Source Code Index: from repositories to trusted code

What is actually inside a submission package

NIST’s post-quantum cryptography standardization process required every candidate algorithm to arrive as a complete submission package, which — alongside the specification document — included compilable, runnable source code. Researchers opening these archives for the first time are often startled by the number of directories, but the structure is in fact highly uniform: a reference implementation written for clarity, one or more optimized implementations targeting specific processors, and a set of Known Answer Test (KAT) files. Understanding this three-way split is the starting point for using any PQC code resource.

The reference implementation is usually written in portable C, depends on no particular instruction set, and deliberately follows the pseudocode order of the specification. Its value is not speed but its role as an executable specification: when a symbol or formula in the document is ambiguous, the reference implementation’s behavior is the submitting team’s authoritative interpretation. Optimized implementations are the opposite: they may use vector instructions such as AVX2 or NEON, or hand-written assembly, and their directory names often carry a platform marker. Their outputs must agree with the reference implementation byte for byte, but their internal structure may differ completely.

KAT files: the anchor that pins down behavior

KAT files are the most easily overlooked part of a submission package, and the part with the most lasting value. They record the complete intermediate values and outputs of key generation, encapsulation, decapsulation, signing, and verification under a fixed random seed. Anyone who builds the same implementation and compares its KAT output can immediately tell whether a port is correct and whether compiler optimizations have disturbed the semantics.

For researchers, KAT files serve two further purposes. The first is cross-validation: if you reimplement an algorithm in another language, the KAT is the cheapest available correctness oracle. The second is regression testing: re-running the KAT after modifying code surfaces behavioral drift at once. Note that a KAT is bound to one round and one parameter set of a submission; after an algorithm’s encoding or parameters change during standardization, an old KAT naturally stops applying to the new implementation. That is not a bug in the implementation — the anchor itself has moved.

A quick read of the directory structure

Submission packages from different teams differ in detail, but common directory names converge strongly, and once you know the conventions you can locate what you need in any package within a minute. The ref directory holds the portable reference implementation; opt or platform-suffixed directories (such as avx2, aarch64, or m4) hold optimized implementations; the kat directory holds the known answer test files; and the nist directory usually holds the wrapper layer written to satisfy the submission interface requirements — NIST’s prescribed API signatures (function names, parameter order, return-value conventions) live in this layer. The algorithm’s internal implementation is separate from this wrapper, so if you only want to reuse the algorithmic core, read the internals directly instead of treating the submission interface as the definition of the algorithm.

Two frequently ignored files are also worth reading first. One is the parameter header file: differences between parameter sets (ML-KEM-512, 768, and 1024, for example) are often switched via compile-time macros or separate headers, so before changing a parameter, confirm which set you are actually touching. The other is the randomness interface file: submission implementations typically abstract the source of random bytes into a replaceable function, and it is precisely by fixing this source that the KAT becomes reproducible. If you forget this during performance testing or security evaluation, you may end up measuring the system random number generator’s overhead rather than the algorithm itself.

Practical notes on downloading and building

Submission packages are downloaded from NIST’s official project pages, usually as compressed archives that include a Makefile or brief build instructions after extraction. The three most common obstacles on a first build are: a compiler too old to support the instruction-set flags an optimized implementation needs; the KAT generator and the main implementation sharing one build script, so a build failure takes both down together and the scope of the problem is easily misjudged; and some packages assuming a particular endianness or word size, which needs manual checking on less common platforms. The safe approach is to build only the reference implementation first and get the KAT passing, establishing a known-good baseline, then enable optimized implementations one at a time for comparison.

One more warning about licensing. Code in submission packages is provided by each team under the submission terms, and the terms of use are whatever the accompanying license or notice file in the package says; teams’ wording is not uniform — some explicitly use a permissive license, others attach only a brief statement that the code is for evaluation. Before lifting submission code directly into your own project, read the license file in the package; if it is ambiguous, prefer an implementation from an aggregate library with clear licensing — which is one of the reasons the next category of code resources exists.

After standardization: where did the code go

After FIPS 203, FIPS 204, and FIPS 205 were published in 2024, the submission code for ML-KEM, ML-DSA, and SLH-DSA completed its historical mission. NIST’s official pages still keep every round’s submission packages available for download, but they correspond to Kyber, Dilithium, and SPHINCS+ as specified at submission time, and there are detail-level differences from the final standards — ML-KEM, for example, adjusted Kyber’s key derivation and encoding — so using submission code directly as a standards implementation yields incompatible results.

Code that remains maintained after the standards’ release flows mainly to three places: project repositories maintained by the original submission teams (such as the codebases linked from each algorithm’s official website), aggregate codebases (see this section’s guide to liboqs and PQClean), and commercial and open-source implementations entering validation programs. When choosing code, a researcher should first confirm one thing: whether the code aligns with the submission specification or with the final FIPS text. Repository documentation usually states this explicitly; treat vague cases with caution.

Checking maintenance status and version correspondence

To judge whether a piece of submission code is still usable, look at four things: the date of the repository’s most recent commit and release; the specification version stated in the documentation (which submission round, draft, or final standard); whether maintainers are still responding in the issue tracker; and whether the repository provides test scripts that check against official test vectors. The project pages of NIST’s Computer Security Resource Center (CSRC) preserve each round’s submission packages and status notes, and are the primary source for verifying version correspondence.

When citing, prefer a three-part form — algorithm name plus round or standard number plus repository tag or commit hash — for example, noting whether what you used was the round-three submission package or a release aligned with FIPS 203. Disputes over the reproducibility of cryptography experiments turn out, nine times out of ten, to be unclear version correspondence rather than a problem with the algorithm itself. Apply the habits in this guide to every code resource, and the guides that follow will be much easier going.

Tags: NISTreference implementationsubmission packageKAT