Modular Exponentiation
https://en.wikipedia.org/wiki/Modular_exponentiation
Applications is like Public-Key Cryptography
Modular Exponentiation
This is from CPH
The following function calculates the value of xnmodm:
There’s also this version from cp-algorithms, iterative
Both do binary exponentiation.