
Constant time testing
Lets an agent measure timing side channels in running crypto code with dudect and Timecop
Constant time testing is an open-source agent skill for security. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 8.6K
- Last commit
- License
- CC-BY-SA-4.0
- Listing updated
Similar skills
About Constant time testing
This skill guides the agent through testing whether a compiled cryptographic implementation leaks secrets through execution time. It explains the four families of constant-time tools (formal, symbolic, dynamic and statistical) and when each fits, then sets out a staged workflow: a quick statistical pass with dudect, followed by dynamic tracing with Timecop over Valgrind to locate the exact line of a leak if one appears.
The guidance also covers reading results, such as interpreting t-values from Welch's test, and remediation patterns like replacing secret-dependent branches, table lookups and variable-time division with constant-time alternatives. It recommends re-running tests across compilers, optimization levels and CPU architectures, and adding a dudect check to continuous integration.
The skill expects a C or similar compiled implementation with a harness that feeds fixed and random inputs, and the Valgrind and dudect tooling installed. It is a guide to running the tests rather than a static code review, which is handled by a separate constant-time analysis plugin.
When your agent uses it
Measures timing side channels in cryptographic implementations by running them, using dudect for statistical analysis and Timecop over Valgrind for dynamic tracing. Covers the formal, symbolic, dynamic, and statistical tool categories and how to read a result. Use when testing whether a running implementation is constant-time, measuring timing variance on a compiled binary, or investigating a suspected timing attack. Not for statically inspecting compiler output — the constant-time-analysis plugin covers that.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Instructions only, no scripts(see the files on GitHub)
- License: CC-BY-SA-4.0(see the files on GitHub)
From a static check of its 3 files (25 KB) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the testing-handbook-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add trailofbits/skills
/plugin install testing-handbook-skills@trailofbitsOr copy only this skill to ~/.claude/skills/constant-time-testing:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/trailofbits/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/constant-time-testing &&
cp -R "$tmp/plugins/testing-handbook-skills/skills/constant-time-testing" ~/.claude/skills/constant-time-testing &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/constant-time-testing inside it instead.
Copy the skill folder to ~/.agents/skills/constant-time-testing to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/trailofbits/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/constant-time-testing &&
cp -R "$tmp/plugins/testing-handbook-skills/skills/constant-time-testing" ~/.agents/skills/constant-time-testing &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/constant-time-testing inside it instead.
Copy the skill folder to ~/.cursor/skills/constant-time-testing to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/trailofbits/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/constant-time-testing &&
cp -R "$tmp/plugins/testing-handbook-skills/skills/constant-time-testing" ~/.cursor/skills/constant-time-testing &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/constant-time-testing inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/trailofbits/skills.git --path plugins/testing-handbook-skills/skills/constant-time-testingOr copy the folder to ~/.gemini/skills/constant-time-testing yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/constant-time-testing:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/trailofbits/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/constant-time-testing &&
cp -R "$tmp/plugins/testing-handbook-skills/skills/constant-time-testing" ~/.copilot/skills/constant-time-testing &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/constant-time-testing inside it instead.
Get the folder:
git clone --depth 1 https://github.com/trailofbits/skills.gitThen copy skills/plugins/testing-handbook-skills/skills/constant-time-testing into your agent's skills folder as constant-time-testing. Agents that support SKILL.md read one folder per skill.
What it does
- Tool category overview
- Compares formal, symbolic, dynamic and statistical approaches to finding timing leaks, with their trade-offs.
- Statistical timing check
- Walks through a dudect harness comparing fixed and random input classes with Welch's t-test.
- Dynamic secret tracing
- Shows how to mark secrets as poisoned and run under Valgrind to pinpoint the leaking line.
- Common leak patterns
- Lists secret-dependent branches, table lookups, division and shifts that cause timing differences.
- Remediation and re-verification
- Suggests constant-time rewrites and repeated testing across compilers and architectures.
- CI integration guidance
- Describes running a timing test for a fixed duration in a build pipeline and failing on detected leaks.
Good for
- Check whether my AES or RSA routine leaks timing information
- Set up a dudect harness for my crypto function
- Find which line of my C code branches on a secret key
- Review a compiled binary for timing variance before release
- Investigate a suspected timing attack on my signing code
Constant time testing FAQ
When should Constant time testing trigger?
When testing whether a running implementation is constant-time, measuring timing variance on a compiled binary, or investigating a suspected timing attack.
Does Constant time testing cover static inspection of compiler output?
No. Static inspection of compiler output is handled by the separate constant-time-analysis plugin.
Which tools does Constant time testing rely on?
It centers on dudect for statistical analysis and Timecop over Valgrind for dynamic tracing, and points to other tools such as ct-verif and Binsec for formal and symbolic work.
Can Constant time testing prove my code is free of timing leaks?
No. The guidance states that dudect gives statistical confidence only and cannot guarantee the absence of leaks.
How do I install Constant time testing in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/constant-time-testing to use it in all your projects, or to .claude/skills/constant-time-testing in one project. Or install the testing-handbook-skills plugin, which includes it: /plugin marketplace add trailofbits/skills, then /plugin install testing-handbook-skills@trailofbits.
Does Constant time testing run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Constant time testing?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Constant time testing?
The closest alternatives to Constant time testing are Constant time analysis, Audit integrity, Secret serialization, Red team and Agent security hardening.
Where this comes from
- Description: from the skill's own SKILL.md.
More from trailofbits/skills

Generates Claude Code security testing skills from the Trail of Bits Testing Handbook
- Open source
- 8.6K GitHub stars
- Security

Guides mewt or muton mutation testing runs and triages surviving mutants
- Open source
- 8.6K GitHub stars
- Developer tools

Lets your agent write, review and debug property-based tests across languages
- Open source
- 8.6K GitHub stars
- Developer tools

Audits GitHub Actions workflows that run AI coding agents for prompt injection risks
- Open source
- 8.6K GitHub stars
- AI models and LLM tooling

Builds a verified map of an unfamiliar codebase before any bug hunting begins
- Open source
- 8.6K GitHub stars
- Security

Audits Algorand TEAL and PyTeal contracts against 11 platform-specific vulnerability
- Open source
- 8.6K GitHub stars
- Security






