[DC1] Modular exponentiation (2 pts) [00PN]
Describe a recursive algorithm which computes the modular exponentiation b^e \bmod {m}, that is, the remainder when dividing b^e by m, in only O(\lg e) time. You may assume that 0 \leq b, e, m < 2^{32}, and that arithmetic operations such as addition and multiplication on 64-bit numbers take constant time.
Be sure to analyze the running time of the algorithm, and prove it is correct by (strong) induction on e.
Recall that (a \cdot b) \equiv _m (a \bmod m) \cdot (b \bmod m), so it does not matter whether you reduce modulo m before or after multiplication. For example, b^4 \bmod m \equiv _m (b \bmod m)^4.