next up previous
Next: Up: Previous:

Repeated Squaring

Compute: ab mod n, where a and b are nonnegative integers and n is a positive integer.

Let \(b \;=\; <b_k, b_{k-1}, \ldots, b_1, b_0>\).

Compute ac mod n by doubling c for each i and incrementing c when bi= 1.


next up previous
Next: Up: Previous: