← Back to section · Software & Developer Tools

Building and Maintaining Test Vector Suites: Making Vectors Outlive the Code

A good test vector suite is public infrastructure for a cryptographic ecosystem. This article covers coverage design, generation with independent cross-confirmation, format and metadata conventions, and how to maintain and version vectors as specifications evolve.

Published 22 November 2026 · 6 min read · PQ Frontier

Building and Maintaining Test Vector Suites: Making Vectors Outlive the Code
AI-generated site artwork
Video explainer · PQC testing: the gates an implementation must pass

In cryptographic engineering, test vectors are the least glamorous and longest-lived asset: implementations get rewritten, languages fall out of fashion, teams turn over, yet a good vector suite can be reused by generation after generation of implementations as the operational definition of “what correct means.” Vector suites matter even more for post-quantum algorithms — the algorithms are new, the details are many, and implementers are spread across the globe, so one authoritative suite saves countless repeated mistakes. But a suite is not made by running a reference implementation once and saving the output; both building and maintaining it have their pitfalls, and doing it wrong can cast an error into a standard. This article covers four aspects: how to design coverage, how vectors are generated so they can be trusted, how to set format and metadata, and how to maintain them over the long term.

Coverage Design: Lay It Out by Dimension, Not by Volume

The first lesson of a vector suite is coverage structure. The most basic dimensions are parameter sets and operations: key generation, encapsulation, decapsulation, signing, and verification under every parameter set all need cases — leave any cell empty and some implementation will hide a bug in exactly that cell and pass. The second dimension is input shape: empty and long messages, boundary lengths, context parameters empty and full, associated data present and absent — these shapes often take different code branches and are fertile ground for errors. The third dimension is the deterministic and randomized paths: fixed-seed deterministic cases guarantee reproducible comparison, while randomized paths that can only be checked by property remind implementers that vectors alone are not enough.

One class of cases is easily forgotten and deserves deliberate design: cross-parameter and cross-version pairings that should fail. Using a key from parameter set A to decapsulate a ciphertext from set B, for example — if the suite explicitly includes such negative cases with their expected failure mode, it prevents implementations from silently producing wrong results under parameter confusion. The general principle of coverage design: every case should be able to answer “which class of error do I guard against?” Cases that cannot answer are mostly filler, and a suite that guards against nothing is decoration no matter how large.

Generation: Reference Generation Plus Independent Cross-Confirmation

The biggest risk of vectors is writing the generator’s error into the answer key. If a suite is generated by a single implementation that happens to misread the specification at some point, every later implementer will be “corrected” by the vectors in the wrong direction — and because everyone tests against the same suite, the error will look impressively consistent. The defense is cross-confirmation: vectors are first generated by the reference implementation, then an independently developed implementation computes the same batch of inputs on its own, and only byte-for-byte agreement earns inclusion; where they disagree, adjudicate which side is right first — and the adjudication itself often unearths ambiguities in the specification text, a by-product as valuable as the vectors.

The generation process should also preserve complete regenerability: the generation scripts, the version identifiers of the implementations used, and the list of input seeds are all archived, so anyone can reproduce the batch from scratch at any time. A suite that cannot be regenerated is fragile: the moment the specification is fine-tuned, nobody dares touch it, and the whole batch must be discarded and redone. Inclusion thresholds are worth keeping conservative: a smaller suite in which every cell has been cross-confirmed beats a large one of murky provenance. A common compromise is to publish a core subset early for implementers’ self-testing, then expand it in rolling fashion as cross-confirmation progresses, marking each batch’s confirmation status with a version number.

Format and Metadata: Readable by Machines and Humans Alike

The vector file format directly affects how widely a suite gets used. The common practice is a structured text format, one record per case with fields for inputs, optional intermediate values, and expected outputs, plus a stable identifier per case so problem reports can cite it. Pure binary bulk files are compact but hostile to human review and version diffing, and have been steadily marginalized. Field names should correspond strictly to the specification’s terminology, sparing implementers a layer of guesswork mapping.

Metadata matters as much as the vectors themselves. Every suite should state at minimum: the algorithm and specification version it corresponds to, the parameter sets, the generating and confirming parties, the total case count and coverage notes, a checksum of the whole package, and how to obtain and cite it. The checksum’s role is often underestimated: it lets users confirm that the file in hand is byte-identical to the publisher’s, avoiding debugging time wasted on corrupted or tampered vectors. Metadata should also state scope and known limitations honestly — for example, that the suite contains no negative vectors, or that one parameter set has not yet been cross-confirmed. An honest statement of boundaries builds more trust than an inflated claim of full coverage.

Long-Term Maintenance: Evolving with Specification Revisions

Publishing a suite is not the end. Specifications adjust details during standardization and later revisions — parameter fine-tuning, encoding clarifications, error-handling clarifications — and every change requires assessing the impact on the vectors. Three maintenance disciplines apply. First, version binding: suite versions correspond explicitly to specification versions, every suite can answer “which version of the specification was I generated against,” and test results that mix vectors from different versions should be marked invalid. Second, incremental evolution rather than demolition: new cases are appended under new identifiers, old cases affected by a revision are marked deprecated with the reason and their replacement noted, and history is preserved so older implementations can still regress against the version they target. Third, a feedback channel: when an implementer finds a divergence using the vectors, there must be a clear submission path back to the maintainers, who adjudicate and then either update the vectors or publish an erratum — a suite’s credibility accumulates precisely through such public adjudications.

For users of a suite, the other side of maintenance is engineering discipline on their own part: pin the version in use and record its checksum, route vector upgrades through review like dependency upgrades, and state the vector version in test reports. Only then does a suite truly become shared foundation for the whole ecosystem rather than a text file of unknown origin sitting in some corner.

Summary

The essentials of building a vector suite compress into four sentences: design coverage by dimension and be able to say which error each case guards against; generation must be cross-confirmed and regenerable; keep the format structured, the metadata complete, and the checksum pinned; and bind maintenance to specification versions, evolve incrementally, and close the feedback loop. Do these four things solidly and a vector suite can outlive any single implementation and deserve more trust than any of them — which is exactly its meaning as public infrastructure.

Tags: Test VectorsTest InfrastructureVersioning