मुख्य सामग्री पर जाएँ
Skillpedia
टेस्टिंग8.0k · #12738

vector-forge

यह क्या करती है

यह स्किल किसी क्रिप्टो एल्गोरिदम के इम्प्लीमेंटेशन खोजती है, म्यूटेशन टेस्टिंग से देखती है कि कौन-से कोड मार्ग बिना टेस्ट के हैं, और उन कमियों के लिए नए टेस्ट वेक्टर लिखती है। यह क्रिप्टो कोड की टेस्टिंग करने वाली टीमों के लिए है।

कब इस्तेमाल करें

  • ✓जब आप किसी क्रिप्टो एल्गोरिदम या प्रोटोकॉल के लिए टेस्ट वेक्टर बनाना चाहते हैं।
  • ✓जब आप जानना चाहते हैं कि आपके मौजूदा क्रिप्टो टेस्ट कोड को कितना कवर करते हैं।
  • ✓जब आप नए टेस्ट वेक्टर जोड़ने से पहले और बाद में म्यूटेशन किल रेट की तुलना करना चाहते हैं।

Skill का लिंक

https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/vector-forge/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/vector-forge/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरी क्रिप्टो लाइब्रेरी के टेस्ट वेक्टर में कमियाँ खोजिए और उन कोड मार्गों के लिए नए वेक्टर लिखिए जिन्हें कोई टेस्ट नहीं करता।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह म्यूटेशन टेस्टिंग चलाकर वे कोड बदलाव खोजती है जिन्हें मौजूदा टेस्ट नहीं पकड़ते, उन जगहों को निशाना बनाकर नए टेस्ट वेक्टर लिखती है, और फिर पहले व बाद के नतीजों की तुलना करती है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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 trailmark fails, 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
अक्सर पूछे जाने वाले सवाल

क्या इसके लिए मौजूदा टेस्ट वेक्टर चाहिए?

स्किल सबसे अच्छा तब काम करती है जब एल्गोरिदम के पास तुलना के लिए सार्वजनिक टेस्ट वेक्टर हों, और उन्हें इस्तेमाल करने वाला टेस्ट harness चाहिए।

शुरू करने से पहले क्या चाहिए?

कम से कम एक इम्प्लीमेंटेशन उस भाषा में जिसमें म्यूटेशन टेस्टिंग समर्थित हो, एक टेस्ट harness, और एक म्यूटेशन टेस्टिंग फ़्रेमवर्क।

इसे कब छोड़ना चाहिए?

जब म्यूटेट करने के लिए कोई इम्प्लीमेंटेशन न हो, या जब कोड एल्गोरिदम के बजाय एप्लिकेशन लॉजिक हो।

जानकारी

लेखक का मूल विवरण

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

लोकप्रियता

GitHub स्टार
8.0k
रैंकिंग में स्थान
#12738
लाइसेंस
CC-BY-SA-4.0
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

audit-context-building

8.0k

यह आपके एजेंट को सुरक्षा जाँच से पहले किसी अनजान कोड को समझने में मदद करती है, हर फ़ंक्शन की मान्यताएँ और निर्भरताएँ नक्शे में दिखाकर।

कोडिंगसिक्योरिटी

algorand-vulnerability-scanner

8.0k

यह आपके एजेंट को Algorand कॉन्ट्रैक्ट्स में 11 आम सुरक्षा समस्याएँ जाँचने में मदद करती है, जैसे रीकीइंग हमले और बिना जाँची फ़ीस।

कोडिंगसिक्योरिटी

audit-prep-assistant

8.0k

यह आपके एजेंट को बाहरी सुरक्षा समीक्षा के लिए कोड तैयार करने में मदद करती है, जैसे स्टैटिक एनालिसिस, टेस्ट कवरेज और दस्तावेज़ीकरण।

कोडिंगसिक्योरिटी

cairo-vulnerability-scanner

8.0k

यह आपके एजेंट को StarkNet के Cairo कॉन्ट्रैक्ट्स में 6 गंभीर समस्याएँ जाँचने में मदद करती है, जैसे ओवरफ़्लो और सिग्नेचर रीप्ले।

कोडिंगसिक्योरिटी

मिलती-जुलती skills