throw new IllegalStateException("RSA engine not initialised");
}
if (key instanceof RSAPrivateCrtKeyParameters)
{
RSAPrivateCrtKeyParameters k = (RSAPrivateCrtKeyParameters)key;
if (k.getPublicExponent() != null) // can't do blinding without a public exponent
{
BigInteger input = core.convertInput(in, inOff, inLen);
BigInteger m = k.getModulus();
BigInteger r = calculateR(m);
BigInteger result = core.processBlock(r.modPow(k.getPublicExponent(), m).multiply(input).mod(m));
return core.convertOutput(result.multiply(r.modInverse(m)).mod(m));
}
return core.convertOutput(core.processBlock(core.convertInput(in, inOff, inLen)));