NaCl codifies constant-time design: no secret branches, no secret indices
Bernstein, Lange and Schwabe's paper 'The security impact of a new cryptographic library' (LATINCRYPT 2012) described NaCl, whose primitives were designed and implemented so that no secret data ever influences branches or memory addresses, eliminating timing and cache leaks by construction.
Background
NaCl crystallised a design philosophy that grew out of the 2005 cache-timing attacks: choose primitives (Curve25519 with its Montgomery ladder, Salsa20/ChaCha, Poly1305, Ed25519) that are naturally fast without lookup tables or secret-dependent branches, and expose a misuse-resistant API. Its descendants libsodium and the widespread adoption of X25519/Ed25519 in TLS 1.3, SSH, Signal and WireGuard brought constant-time-by-design into mainstream infrastructure.
Constant-time is a software contract with the hardware; later work (Hertzbleed 2022, GoFetch 2024) showed that CPUs do not always honour it.
Sources
- paperThe security impact of a new cryptographic library (LATINCRYPT 2012)cr.yp.to, cr.yp.to
- codeNaCl: Networking and Cryptography librarynacl.cr.yp.to, nacl.cr.yp.to