liveBook · Manning

Test vector

As explained in Real-World Cryptography

A test vector is a predefined cryptographic input together with an expected result for validating an implementation.

A test vector pairs a predefined cryptographic input with its expected output. Feeding these matching pairs to an implementation checks whether it behaves correctly. section 16.2

Use test vectors to:

  • Validate an implementation against the behavior specified by a cryptographic standard. section 16.2
  • Expose tricky bugs in widely used algorithms and implementations. section 16.3
  • Reduce the chance of mistakes when implementing a primitive or protocol, though vectors cannot replace careful design or a good library. section 16.2 section 16.3

Wycheproof catches edge cases

Google’s Wycheproof provides suites of test vectors for algorithms such as ECDSA and AES-GCM. Running an implementation against these inputs and expected results can reveal subtle bugs. section 16.3

How Real-World Cryptography covers it

How deep it goes
Defines matching input-output lists and their testing role, but does not detail vector formats or algorithm-specific construction.
Examples
Uses standard-provided matching pairs and Wycheproof suites targeting ECDSA, AES-GCM, and other common algorithms.
What it assumes
Assumes an implementation and a specified cryptographic primitive or protocol, while treating test-vector use as a practical validation step.
What you can do after
Diagnose/debug with test-vector suites by finding mismatches and tricky bugs in cryptographic implementations.
How it connects
Connects cryptographic standards, primitives, protocols, implementations, algorithms, and cryptographic libraries.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Real-World Cryptography. The section links point to the parts of the book it draws on.