Discrete Math Notes:
Chapter 8: Applications of Discrete Mathematics
8.6 Fast exponentiation
Iterative, uses a loop to accomplish repeated operations in contrast with a recursive algorithm which uses recursion
Overview:
There are two elements in the domain that map to the same element in the target if a function f has a domain of size at least n+1 and a target of size at most n, where n is a positive integer (i.e., the function is not one-to-one). If the exponent y is a large value, the variables s and p in the exponentiation method could grow quite huge. In fact, the values of s and p may grow to be so high that they exceed the maximum value that a computer variable can hold. For really big values, cryptographic applications necessitate computing xy mod n.