Fast modular exponentiation