constant-time-testing — Claude Code skill: testing and setup
This skill helps test whether a cryptographic implementation’s runtime varies with secret data. Use it when auditing crypto code or investigating a possible timing leak.
npx skills add trailofbits/skills --skill constant-time-testing -a claude-codeWhat constant-time-testing does
The skill focuses on measurements from running cryptographic code. It covers statistical timing tests and runtime tracing, then explains how formal, symbolic, dynamic, and statistical approaches differ. This is execution-time analysis, not a static inspection of compiler output.
The guide discusses branches driven by secrets, array lookups, division, and shifts as potential sources of timing variation. Statistical results can be affected by noise and do not identify the cause on their own, so interpretation matters. The material is aimed at cryptographic code that handles secret values.
What it helps with
- test whether runtime varies with secret inputs
- measure timing variation in a compiled crypto binary
- investigate a suspected timing leak in cryptographic code
- interpret results from runtime or statistical analysis
Example prompts for the agent
- Check whether this cryptographic implementation’s runtime depends on its secret key.
- Measure timing variation in the compiled version of this cryptographic function.
- Investigate whether a branch on secret data could reveal information through runtime differences.
How to install constant-time-testing
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill constant-time-testing -a claude-code2Manually: put the files in place
~/.claude/skills/constant-time-testing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/constant-time-testing/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill constant-time-testing -a codex2Manually: put the files in place
.agents/skills/constant-time-testing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill constant-time-testing -a cursor2Manually: put the files in place
.cursor/skills/constant-time-testing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install trailofbits/skills constant-time-testing2Manually: put the files in place
.github/skills/constant-time-testing/SKILL.md1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill constant-time-testing -a gemini-cli2Platform CLI
gemini skills install https://github.com/trailofbits/skills --path plugins/testing-handbook-skills/skills/constant-time-testingManually: put the files in place
.devin/skills/constant-time-testing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add trailofbits/skills --skill constant-time-testing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about constant-time-testing
How do I install constant-time-testing in Claude Code?
Run npx skills add trailofbits/skills --skill constant-time-testing -a claude-code. The skill file is located at ~/.claude/skills/constant-time-testing/SKILL.md.
What does constant-time-testing do?
It helps investigate timing leaks in running cryptographic code through statistical measurements and dynamic analysis. It also explains how to interpret results from different analysis approaches.
Can this skill inspect compiler output without running the program?
No. Its focus is runtime behavior and timing measurements; static inspection of compiled output is handled by a different tool.