Skill: Constant-Time Analysis
by Trail of Bits
Compiles cryptographic code and reads the emitted assembly for variable-time instructions, then triages which flagged operations actually touch secrets.
Finds secrets left in memory in C, C++ and Rust — including wipes the compiler deleted — and requires IR or assembly evidence before calling one optimized away.
Add this skill to your favorite AI agent in a few steps.
Learn how to use this skill with different AI agents.
Audit this crate for secrets left in memory — I want to know whether our key-wiping actually survives at -O2, with the assembly to back it up.
Writing a wipe over a key buffer is easy. Proving the wipe survived the optimizer is not: dead-store elimination routinely deletes a memset whose result is never read, which is precisely the shape of every secret-zeroization call. A source-level grep for memset or zeroize therefore tells you what the developer intended, not what the binary does.
This skill from Trail of Bits audits C, C++ and Rust for sensitive data left in memory, and treats "the compiler removed it" as a claim requiring proof. A finding may only be reported as optimized-away when backed by compiler evidence — an IR or assembly diff.
The skill runs an eight-phase orchestrated pipeline, spawning a sub-agent per phase with recoverable state, so an interrupted run resumes from its recorded current_phase rather than restarting. Analysis is read-only against the audited codebase; artifacts go to a temporary working directory.
Detection covers more than missing calls:
It needs real build context: a compile_commands.json for C/C++ or a Cargo.toml for Rust, and it fails fast rather than guessing when neither is derivable. IR comparison defaults to O0, O1 and O2 — O1 is the diagnostic level, since a wipe that disappears there is plain dead-store elimination while O2 catches more aggressive removals.
Confidence gating is explicit about degraded runs. Advanced findings (SECRET_COPY, MISSING_ON_ERROR_PATH, NOT_DOMINATING_EXITS) depend on Serena MCP for semantic queries; when it is unavailable the skill downgrades them to needs_review instead of reporting them at full confidence or dropping them. Rust PoC support is narrower than C/C++ and the skill marks the unsupported categories rather than implying coverage it does not have.
Useful for auditing cryptographic implementations, authentication and session handling, and any codebase where credentials or PII pass through buffers whose lifetime you need to reason about.
by Trail of Bits
Compiles cryptographic code and reads the emitted assembly for variable-time instructions, then triages which flagged operations actually touch secrets.
by Trail of Bits
Trail of Bits' CodeQL skill: build databases, run taint-tracking and data-flow queries across eight languages, and model project-specific sources and sinks.
by Trail of Bits
Trail of Bits' skill for writing production-quality Semgrep rules — pattern design, taint mode for data-flow bugs, and mandatory test-driven validation.
Trail of Bits' security review skill for PRs, commits, and diffs: risk-first analysis with git history, blast radius, and honest coverage limits.