Exponentiation { public static BigInteger modPow(BigInteger base, BigInteger exponent, BigInteger modulus) { if (GMP_AVAILABLE) { if (USE_SECURE_MOD_POW) { return exponent.signum() < 0 ? modInverse(Gmp.modPowSecure(base, exponent.negate(), modulus), modulus) : Gmp.modPowSecure(base, exponent, modulus); } else { return exponent.signum() < 0 ? modInverse(Gmp.modPowInsecure(base, exponent.negate(), modulus), modulus) : Gmp.modPowInsecure(base, exponent, modulus); } } else { return base.modPow(exponent, modulus); } }  static BigInteger modPow(BigInteger base, BigInteger exponent, BigInteger modulus); static BigInteger modInverse(final BigInteger a, final BigInteger modulus); static final boolean USE_SECURE_MOD_POW; static final boolean GMP_AVAILABLE; }
@Test public void testModPow() { fail("Not yet implemented"); }