class Exponentiation {

	protected static BigInteger modPowSecure(final BigInteger base, final BigInteger exponent,
			final BigInteger modulus) {
		if (GMP_AVAILABLE) {
			return exponent.signum() < 0 // Gmp library can't handle negative exponents
					? modInverse(Gmp.modPowSecure(base, exponent.negate(), modulus), modulus)
					: Gmp.modPowSecure(base, exponent, modulus);
		} else {
			// Generate blinding factor to obfsucate the exponent
			return modPowerSecureJava(base, exponent, modulus);
		}
	}

}