Constant-time support lands in LLVM: Protecting cryptographic code at the compiler level
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Cryptography engineers can now get compiler-level guarantees that optimisation passes will not silently reintroduce timing leaks into code they deliberately wrote to be constant-time.
Trail of Bits has added constant-time support to LLVM 21, the compiler toolkit behind Clang. Timing attacks happen when a computer's actions take slightly longer depending on secret data, such as a cryptographic key. Programmers write code to take the same time regardless, but compilers sometimes undo that while optimising. This change lets the compiler preserve those guarantees instead of breaking them.
For any company shipping cryptographic software, this closes a real and largely invisible risk: a compiler update quietly reintroducing timing vulnerabilities into code that was carefully hardened against them. Trail of Bits' contribution to LLVM 21 makes those guarantees explicit at build time, reducing audit burden and security exposure. Competing compilers without equivalent support leave this class of bug undetected.
Trail of Bits contributed constant-time support to LLVM 21, landing in mainline. It introduces the __builtin_ct_select family of intrinsics plus supporting infrastructure that stops Clang, and other LLVM-based compilers, from transforming deliberately constant-time cryptographic code into time-varying equivalents during optimisation. The mechanism guards against branching-related timing attacks specifically. The article gives no benchmark numbers and does not address cache-timing side channels.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.