vector-forge
Mutation-driven test vector generation. Finds implementations of a cryptographic algorithm or protocol, runs mutation testing to identify escaped mutants, then generates new test vectors that deliberately exercise the uncovered code paths. Compares before/after mutation kill rates to prove vector effectiveness. Use when generating cryptographic test vectors, measuring Wycheproof coverage gaps, finding escaped mutants via mutation testing, creating cross-implementation test suites, or improving t
Security Assessment
Detected risks:
About vector-forge
Mutation-driven test vector generation for cryptographic algorithms and protocols. The skill uses mutation testing to systematically identify gaps in test vector coverage, then generates new test vectors that deliberately exercise the uncovered code paths, and measures effectiveness by comparing mutation kill rates before and after. It is intended for generating cryptographic test vectors, measuring Wycheproof-style coverage gaps, finding escaped mutants, and building cross-implementation test suites; it is not for cases where no implementation exists yet, a single trivial implementation with no edge cases, application logic rather than algorithm implementations, or an algorithm with no public test vectors to compare against.
The workflow runs in six phases. Discovery finds implementations of the target algorithm, distinguishing pure implementations in high-level languages (the best mutation targets) from FFI wrapper crates (low value at the binding layer) and reference implementations. Harness writes or adapts a test vector harness per implementation that reads vectors from JSON (Wycheproof format recommended), exercises the API, and asserts both acceptance and rejection plus roundtrip assertions; the harness must live inside the implementation's package so the mutation framework can see it. Baseline runs mutation testing with existing vectors only and records metrics such as total mutants, killed, survived, not covered, timed out, efficacy, and coverage. Escape Analysis classifies escaped mutants by code path using the Trailmark call graph and the genotoxic skill's triage methodology. Vector Gen creates vectors targeting the escapes, and Validation re-runs mutation testing to compare before and after.
Prerequisites include trailmark (installed via `uv pip install trailmark` if `uv run trailmark` fails), at least one implementation in a language with mutation testing support, a test harness, and a mutation testing framework. Framework choices include gremlins for Go, cargo-mutants for Rust, mutmut for Python, and Mull for C/C++, with parallel execution recommended for large codebases. A central principle is that FFI bindings must not be mutated at the wrapper layer; the underlying implementation language must be mutated instead, and a harness that only checks valid vectors will miss permissive mutations such as turning an AND into an OR in validation.
FAQ
When should this skill not be used?
When no implementations exist yet, when there is only a single trivial implementation with no edge cases, when testing application logic rather than algorithm implementations, or when the algorithm has no public test vectors to compare against.
Which mutation testing frameworks are supported?
gremlins for Go, cargo-mutants for Rust, mutmut for Python, and Mull for C/C++. Parallel execution is recommended for large codebases.
How are FFI wrapper crates handled?
They are low value at the binding layer because mutations to wrappers do not affect the underlying implementation. You must mutate the underlying implementation language instead, for example using Mull for C/C++ underneath Rust, Go, or Python.
Why must the harness assert rejection and not just acceptance?
A harness that only checks valid vectors will miss all permissive mutations, such as changing `&` to `|` in validation. The harness should assert both acceptance for valid vectors and rejection for invalid ones, plus roundtrip assertions.
How is the value of new test vectors measured?
By comparing mutation kill rates before and after. Running mutation testing with existing vectors, with new vectors, and with both combined, then taking the delta between baseline and combined, shows the new vectors' concrete coverage value.
All Files
8 filesInstall vector-forge
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
trailofbits/skills