mod_pow for RSA