liveBook · Manning

Constant-time programming

Constant-time programming is the practice of designing algorithms whose execution behavior does not depend on secret data or varying input values.

How 2 Manning books explain it

Hacking Cryptography

A constant-time implementation is software or hardware whose execution behavior does not depend on secret-dependent values or control flow.

How it is used
Protects cryptographic operations from timing attacks and side-channel analysis by removing secret-dependent execution differences.
How deep it goes
Explains power-analysis failures, ladder operations, and branchless control flow, while deferring many Montgomery optimization details.
Examples
Uses RSA exponentiation traces, the Montgomery ladder, and GCC inline-assembly summation with conditional moves.
What you can do after
Apply it via fixed-operation algorithms, branchless control flow, and constant-time validation for sensitive cryptographic inputs.

Read how Hacking Cryptography explains constant-time programming →

Real-World Cryptography

A constant-time algorithm executes in a pattern whose duration does not depend on secret data.

How it is used
Defends sensitive cryptographic computations against timing and related software side-channel attacks.
How deep it goes
Explains branch-free comparisons and algorithmic patterns, while stopping short of formal proofs or implementation-level completeness.
Examples
Uses Go authentication-tag comparison, Montgomery’s ladder, and RSA square-and-multiply-always.
What you can do after
Apply it by removing secret-dependent branches and memory accesses from cryptographic implementations.

Read how Real-World Cryptography explains constant-time programming →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.