Compute: ab mod n, where a and b are nonnegative integers and n is a positive integer.
Let .
Compute ac mod n by doubling c for each i and incrementing c when bi= 1.