}
  private static final BigInteger RSADP(final RSAPrivateKey K, BigInteger c)  {    // 1. If the representative c is not between 0 and n - 1, output    //    "representative out of range" and stop.    final BigInteger n = K.getModulus();    if (c.compareTo(ZERO) < 0 || c.compareTo(n.subtract(ONE)) > 0)      {        throw new IllegalArgumentException();      }    // 2. The representative m is computed as follows.    BigInteger result;    if (!(K instanceof RSAPrivateCrtKey))      {        // a. If the first form (n, d) of K is used, let m = c^d mod n.        final BigInteger d = K.getPrivateExponent();        result = c.modPow(d, n);      }    else      {        // from [3] p.13 --see class docs:        // The RSA blinding operation calculates x = (r^e) * g mod n before        // decryption, where r is random, e is the RSA encryption exponent, and        // g is the ciphertext to be decrypted. x is then decrypted as normal,        // followed by division by r, i.e. (x^e) / r mod n. Since r is random,        // x is random and timing the decryption should not reveal information        // about the key. Note that r should be a new random number for every        // decryption.        final boolean rsaBlinding = Properties.doRSABlinding();        BigInteger r = null;        BigInteger e = null;        if (rsaBlinding)          { // pre-decryption            r = newR(n);            e = ((RSAPrivateCrtKey) K).getPublicExponent();            final BigInteger x = r.modPow(e, n).multiply(c).mod(n);            c = x;          }        // b. If the second form (p, q, dP, dQ, qInv) and (r_i, d_i, t_i)        //    of K is used, proceed as follows:        final BigInteger p = ((RSAPrivateCrtKey) K).getPrimeP();        final BigInteger q = ((RSAPrivateCrtKey) K).getPrimeQ();        final BigInteger dP = ((RSAPrivateCrtKey) K).getPrimeExponentP();        final BigInteger dQ = ((RSAPrivateCrtKey) K).getPrimeExponentQ();        final BigInteger qInv = ((RSAPrivateCrtKey) K).getCrtCoefficient();        // i.    Let m_1 = c^dP mod p and m_2 = c^dQ mod q.        final BigInteger m_1 = c.modPow(dP, p);        final BigInteger m_2 = c.modPow(dQ, q);        // ii.   If u > 2, let m_i = c^(d_i) mod r_i, i = 3, ..., u.        // iii.  Let h = (m_1 - m_2) * qInv mod p.        final BigInteger h = m_1.subtract(m_2).multiply(qInv).mod(p);        // iv.   Let m = m_2 + q * h.        result = m_2.add(q.multiply(h));        if (rsaBlinding)          { // post-decryption            result = result.multiply(r.modInverse(n)).mod(n);          }      }    // 3. Output m    return result;  }