Prime2.isProbablePrime(p) && p.gcd(E).equals(ONE))
p.isProbablePrime(80) && p.gcd(E).equals(ONE))
  static KeyPair generateRSAKeyPair()  {    BigInteger p, q, n, d;    // Simplified version of GNU Crypto's RSAKeyPairGenerator.    int M = 256;    BigInteger lower = TWO.pow(255);    BigInteger upper = TWO.pow(256).subtract(ONE);    byte[] kb = new byte[32];    while (true)      {        nextBytes(kb);        p = new BigInteger(1, kb).setBit(0);        if (p.compareTo(lower) >= 0 && p.compareTo(upper) <= 0 &&            Prime2.isProbablePrime(p) && p.gcd(E).equals(ONE))          break;      }    while (true)      {        nextBytes(kb);        q = new BigInteger(1, kb).setBit(0);        n = q.multiply(p);        if (n.bitLength() == 512 && Prime2.isProbablePrime(q) &&            q.gcd(E).equals(ONE))          break;      }    d = E.modInverse(p.subtract(ONE).multiply(q.subtract(ONE)));    return new KeyPair(new JessieRSAPublicKey(n, E),                       new JessieRSAPrivateKey(n, d));  }