liveBook · Manning

Constant-time programming

Also called constant-time algorithm

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 →

What to know first

Related concepts

Questions about constant-time programming

What is 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.

Which Manning books explain constant-time programming?

Hacking Cryptography and Real-World Cryptography.

What should I know before learning constant-time programming?

Manning books that teach constant-time programming usually introduce digital signature, nonce, RSA and square and multiply first.

What is constant-time programming also called?

Constant-time programming is also called constant-time algorithm.

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.