Bernstein's cryptoint library defends constant-time code against compiler optimizations

The cryptoint library (2025) [pdf]

Daniel J. Bernstein's cryptoint library provides constant-time integer operations for C/C++ that resist gcc and clang optimizations which can silently reintroduce branches and timing leaks. Rather than merely blocking conditional-selection branches, it prevents compilers from introducing any bool conditions internally, using a global volatile zero plus platform assembly. Already used across SUPERCOP, lib25519, libmceliece, libntruprime, and OpenSSH's sntrup761, each function is verified through symbolic execution and SMT equivalence checking.

This is not a fool's errand: it is common-sense engineering.

More from this day

2026-10-17