Hi, I am unable to understand the iterative version of fast modular exponentiation code.
The prod function does overflow safe multiplication, again similar to fast exponentiation code, but hard to get. asked 25 Aug '18, 14:16

Recursive version of fast modular exponentiation is easy to understand, so first you should try the recursive version
It is the recursive algorithm for fast exponentiation, try to get it first. answered 25 Aug '18, 15:14
