vector-forge
Fungsinya
Skill ini menemukan implementasi algoritma kripto, memakai mutation testing untuk melihat jalur kode mana yang belum teruji, dan menulis vektor uji baru untuk celah itu. Skill ini untuk tim yang menguji kode kripto.
Kapan dipakai
- βSaat Anda ingin membuat vektor uji untuk sebuah algoritma atau protokol kriptografi.
- βSaat Anda ingin tahu seberapa baik tes kripto yang ada menjangkau kode.
- βSaat Anda ingin membandingkan tingkat kill mutasi sebelum dan sesudah menambahkan vektor uji baru.
Link skill
https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/vector-forge/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTemukan celah dalam vektor uji pustaka kripto saya dan tulis yang baru untuk jalur kode yang tidak pernah diuji siapa pun.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini menjalankan mutation testing untuk menemukan perubahan kode yang lolos dari tes saat ini, menulis vektor uji baru yang diarahkan ke titik-titik tersebut, lalu membandingkan hasil sebelum dan sesudah.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Vector Forge
Uses mutation testing to systematically identify gaps in test vector coverage, then generates new test vectors that close those gaps. Measures effectiveness by comparing mutation kill rates before and after.
When to Use
- Generating test vectors for cryptographic algorithms or protocols
- Evaluating how well existing test vectors cover an implementation
- Finding implementation code paths that no test vector exercises
- Creating Wycheproof-style cross-implementation test vectors
- Measuring the concrete coverage value of a test vector suite
When NOT to Use
- No implementations exist yet (need code to mutate)
- Single trivial implementation with no edge cases
- Testing application logic rather than algorithm implementations
- The algorithm has no public test vectors to compare against
Prerequisites
- trailmark installed β if
uv run trailmarkfails, run:uv tool install trailmark
Python snippets: uv run --with trailmark python - (a tool env is not importable)
- At least one implementation of the target algorithm in a
language with mutation testing support
- A test harness that consumes test vectors and exercises
the implementation
- A mutation testing framework for the target language
---
## Rationalizations to Reject
| Rationalization | Why It's Wrong | Required Action |
|-----------------|----------------|-----------------|
| "We have enough test vectors" | Mutation testing proves otherwise | Run the baseline first |
| "The implementation's own tests are sufficient" | Own tests often share blind spots with the impl | Cross-impl vectors catch different bugs |
| "FFI crates can be mutation tested at the binding layer" | Mutations to wrappers don't affect the underlying impl | Mutate the actual implementation language |
| "Timeouts mean the mutation was caught" | Timeouts are ambiguous β could be killed or alive | Resolve timeouts before drawing conclusions |
| "All mutants are equivalent" | Most aren't β verify by reading the mutation | Classify each escaped mutant individually |
| "Checking valid vectors is enough" | Permissive mutations survive without negative assertions | Assert rejection for every invalid vector |
| "Manual analysis is fine" | Manual analysis misses what tooling catches | Install and run the tools |
---
## Workflow Overview
Phase 1: Discovery β Find implementations to test β Phase 2: Harness β Write/adapt test vector harness for each impl β Phase 3: Baseline β Run mutation testing with existing vectors β Phase 4: Escape Analysis β Classify escaped mutants by code path β Phase 5: Vector Gen β Create test vectors targeting escapes β Phase 6: Validation β Re-run mutation testing, compare before/after β Output: Coverage Report + New Test Vectors
---
## Phase 1: Discovery
Find implementations of the target algorithm. Look for:
1. **Pure implementations** in high-level languages (Go, Rust, Python)
β these are the best mutation testing targets
2. **FFI wrapper crates** β identify these early so you don't waste
time mutating wrapper glue code
3. **Reference implementations** β useful for cross-verification but
may not be the best mutation targets
For each implementation, note:
- Language and mutation testing framework
- Whether it's pure code or FFI wrappers
- Existing test suite size and coverage
- Which API surface the test vectors will exercise
### Implementation Type Classification
| Type | Mutation Value | Example |
|------|---------------|---------|
| Pure implementation | High | zkcrypto/bls12_381 (Rust), gnark-crypto (Go) |
| FFI bindings to C/asm | Low at binding layer | blst Rust crate |
| C/C++ implementation | High (use Mull) | blst C library |
| Generated code | Medium (mutations may be equivalent) | gnark-crypto generated field arithmetic |
**Key insight:** If an implementation delegates to another language
via FFI, you must mutate the *underlying* implementation, not the
bindings. For C/C++ underneath Rust/Go/Python, use Mull or similar.
---
## Phase 2: Harness
For each implementation, create a test harness that:
1. Reads test vectors from JSON files (Wycheproof format recommended)
2. Exercises the implementation's API for each vector
3. Asserts **both acceptance and rejection**:
- Valid vectors: deserialization succeeds, output matches expected
- Invalid vectors: deserialization fails or verification rejects
4. Adds **rou
Pertanyaan umum
Apakah perlu vektor uji yang sudah ada?
Skill ini paling baik bekerja jika algoritmanya punya vektor uji publik untuk dibandingkan, dan membutuhkan harness tes yang memakainya.
Apa yang saya butuhkan sebelum mulai?
Minimal satu implementasi dalam bahasa yang mendukung mutation testing, harness tes, dan kerangka mutation testing.
Kapan sebaiknya dilewati?
Ketika tidak ada implementasi untuk dimutasi, atau ketika kodenya adalah logika aplikasi, bukan algoritma.
Detail
Deskripsi asli dari pembuat
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 test vector coverage for crypto primitives.
repo: trailofbits/skills
Popularitas
- Bintang GitHub
- 8.0k
- Peringkat
- #12738
- Lisensi
- CC-BY-SA-4.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
audit-context-building
8.0kMembantu agent Anda mempelajari basis kode yang belum dikenal sebelum tinjauan keamanan, dengan memetakan apa yang diasumsikan, dijamin, dan bergantung pada setiap fungsi.
algorand-vulnerability-scanner
8.0kMembantu agent Anda memindai smart contract Algorand, yang ditulis dalam TEAL atau PyTeal, untuk 11 masalah keamanan umum seperti serangan rekeying dan biaya yang tidak diperiksa.
audit-prep-assistant
8.0kMembantu agent Anda menyiapkan basis kode untuk tinjauan keamanan dari luar, dengan analisis statis, cakupan tes, pembersihan kode mati, dan dokumentasi yang jelas.
cairo-vulnerability-scanner
8.0kMembantu agent Anda memindai smart contract Cairo di StarkNet untuk 6 masalah serius, termasuk overflow aritmetika, pesan lintas lapisan yang berisiko, dan replay tanda tangan.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.