Detects timing side-channel vulnerabilities in cryptographic code. Use when implementing or reviewing crypto code, encountering division on secrets, secret-dependent branches, or constant-time programming questions in C, C++, Go, Rust, Swift, Java, Kotlin, C#, PHP, JavaScript, TypeScript, Python, or Ruby.
A Claude Code skill that detects timing side-channel vulnerabilities in cryptographic code by analyzing assembly or bytecode output for dangerous instructions.
When activated, this skill helps Claude:
| Language | Analysis Method | Reference Guide | |----------|-----------------|-----------------| | C/C++ | Assembly (gcc/clang) | references/compiled.md | | Go | Assembly (go) | references/compiled.md | | Rust | Assembly (rustc) | references/compiled.md | | Swift | Assembly (swiftc) | references/swift.md | | Java | JVM bytecode (javap) | references/vm-compiled.md | | Kotlin | JVM bytecode (kotlinc + javap) | references/kotlin.md | | C# | CIL (ilspycmd) | references/vm-compiled.md | | PHP | Zend opcodes (VLD/OPcache) | references/php.md | | JavaScript | V8 bytecode (Node.js) | references/javascript.md | | TypeScript | V8 bytecode (tsc + Node.js) | references/javascript.md | | Python | CPython bytecode (dis) | references/python.md | | Ruby | YARV bytecode | references/ruby.md |
| Architecture | Division Instructions | Common Use | |--------------|----------------------|------------| | x86_64 | DIV, IDIV | Servers, desktops | | ARM64 | UDIV, SDIV | Mobile, Apple Silicon | | ARM | UDIV, SDIV | Embedded | | RISC-V | DIV, DIVU, REM | Emerging platforms | | PowerPC | DIVW, DIVD | Legacy servers | | s390x | D, DR, DL | Mainframes | | i386 | DIV, IDIV | Legacy |
skills/constant-time-analysis/
├── SKILL.md # Entry point - routing, analyzer usage, triage
├── README.md # This file
└── references/
├── compiled.md # C, C++, Go, Rust analysis
├── swift.md # Swift analysis
├── vm-compiled.md # Java and C# bytecode, JVM/.NET setup
├── kotlin.md # Kotlin analysis (Android/JVM)
├── php.md # PHP analysis (VLD installation, opcodes)
├── javascript.md # JavaScript/TypeScript analysis
├── python.md # Python analysis (dis module)
└── ruby.md # Ruby analysis (YARV)
The analyzer tool is located at ct_analyzer/analyzer.py in the plugin root. Its
test suite and samples live in ct_analyzer/tests/:
test_samples/ — vulnerable and constant-time inputs for detector teststriage_samples/ — one known-answer fixture per supported language, each
pairing true positives with false positives the analyzer cannot distinguish.
expectations.json records the verdict and rationale for every case;
TestTriageMatrix asserts the analyzer still reports both members of each
pair, and fails rather than skipping if no fixture could be exercised.The skill activates automatically when Claude detects:
You can also invoke it explicitly by asking Claude to check code for timing vulnerabilities.
"Check this crypto function for timing vulnerabilities"
"Is this signature verification constant-time?"
"Help me replace this division with Barrett reduction"
"Analyze this ML-KEM implementation for KyberSlash-style issues"
"What constant-time patterns should I use here?"
| Vulnerability | Detection | Fix | |--------------|-----------|-----| | Secret division | DIV, IDIV, SDIV, UDIV | Barrett reduction | | Secret branches | JE, JNE, BEQ, BNE | Bit masking, cmov | | Secret comparison | Early-exit memcmp | crypto/subtle | | Variable-time FP | FDIV, FSQRT | Avoid in crypto |
npx skills add trailofbits/constant-time-analysis下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Use the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawhub CLI.
Transcribe audio via OpenAI Audio Transcriptions API (Whisper).
Gemini CLI for one-shot Q&A, summaries, and generation.
Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
Query Google Places API (New) via the goplaces CLI for text search, place details, resolve, and reviews. Use for human-friendly place lookup or JSON output for scripts.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Category:developer