public static BigInteger modPowInsecure(BigInteger base, BigInteger exponent,
      BigInteger modulus) {
    if (modulus.signum() <= 0) {
      throw new ArithmeticException("modulus must be positive");
    }
    return INSTANCE.get().modPowInsecureImpl(base, exponent, modulus);
  }
public static BigInteger modPowInsecure ( BigInteger base , BigInteger exponent , BigInteger modulus ) { if ( modulus . signum ( ) <= 0 ) { throw new ArithmeticException ( "modulus must be positive" ) ; } return INSTANCE . get ( ) . modPowInsecureImpl ( base , exponent , modulus ) ; }
Calculate (base ^ exponent) % modulus; faster, VULNERABLE TO TIMING ATTACKS.

@param base the base, must be positive
@param exponent the exponent
@param modulus the modulus
@return the (base ^ exponent) % modulus
@throws ArithmeticException if modulus is non-positive, or the exponent is negative and the
base cannot be inverted