liveBook · Manning

Montgomery ladder

As explained in Hacking Cryptography

The Montgomery ladder is a regular sequence of arithmetic operations for scalar multiplication that reduces dependence on secret scalar bits.

The Montgomery ladder is a regular arithmetic sequence for exponentiation or scalar multiplication. Its security goal is to keep secret bits from changing the observable operation pattern. section 10.4.2 section 10.5

A powering-ladder form processes exponent bits from most significant to least significant:

  • Initialize R₀ and R₁ to 1 and e, respectively, then scan each bit of e. section 10.4.2
  • For a 1 bit, update R₀ to R₀ × R₁ and R₁ to R₁². section 10.4.2
  • For a 0 bit, update R₁ to R₀ × R₁ and R₀ to R₀². section 10.4.2
  • Keep one multiplication, one squaring, and one swap operation per bit, regardless of the bit value. section 10.4.2

The ladder produces the same result as square-and-multiply while making power traces harder to distinguish between zero and one bits. Regular control flow is necessary but does not excuse variable iteration bounds or other secret-dependent behavior. section 10.4.2 section 10.5

Figure 10.6 Power trace of an RSA exponentiation showing how the square-and-multiply algorithm reveals the exponent
figure

Contrast the ladder’s regular operation pattern with a square-and-multiply power trace that exposes exponent bits. section 10.4.2

How Hacking Cryptography covers it

How deep it goes
Explains register updates and operation regularity, but defers optimization techniques and does not provide a complete production implementation.
Examples
Uses RSA exponentiation traces and OpenSSL 0.9.8o elliptic-curve scalar multiplication to illustrate exposure and residual leakage.
What it assumes
Assumes familiarity with exponent bits and square-and-multiply while establishing constant-time execution through explicit register updates.
What you can do after
Apply it via a regular arithmetic schedule to reduce secret-bit leakage during exponentiation or scalar multiplication.
How it connects
Connects constant-time implementations with square-and-multiply, double-and-add, timing attacks, power analysis, and elliptic-curve cryptography.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hacking Cryptography. The section links point to the parts of the book it draws on.