summaryrefslogtreecommitdiff
path: root/gnu/javax/crypto
diff options
context:
space:
mode:
authorRaif S. Naffah <raif@swiftdsl.com.au>2006-06-18 02:43:55 +0000
committerRaif S. Naffah <raif@swiftdsl.com.au>2006-06-18 02:43:55 +0000
commit677811417ff55ca1c6592394c52cc05fbf7a4ab4 (patch)
tree344f4a4142776078173c6e6aefe739aaee7e53c5 /gnu/javax/crypto
parentd7a5b661064b44cf2e828aa3d2afb68f84dcc752 (diff)
downloadclasspath-677811417ff55ca1c6592394c52cc05fbf7a4ab4.tar.gz
2006-06-18 Raif S. Naffah <raif@swiftdsl.com.au>
* gnu/java/security/util/Prime2.java: Removed. * gnu/java/security/key/dss/FIPS186.java: Remove unused imports. (generateParameters): Use isProbablePrime() in BigInteger instead of Prime2. * gnu/java/security/key/rsa/RSAKeyPairGenerator.java: Remove unused imports. (generate): Use isProbablePrime() in BigInteger instead of Prime2. * gnu/javax/crypto/key/dh/RFC2631.java: Remove unused imports. (generateParameters): Use isProbablePrime() in BigInteger instead of Prime2. * gnu/javax/crypto/key/srp6/SRPAlgorithm.java: Remove unused imports. (checkParams): Use isProbablePrime() in BigInteger instead of Prime2. * gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java: Remove unused imports. (generateParameters): Use isProbablePrime() in BigInteger instead of Prime2. * gnu/javax/net/ssl/provider/KeyPool.java: Remove unused imports. (generateRSAKeyPair): Use isProbablePrime() in BigInteger instead of Prime2.
Diffstat (limited to 'gnu/javax/crypto')
-rw-r--r--gnu/javax/crypto/key/dh/RFC2631.java5
-rw-r--r--gnu/javax/crypto/key/srp6/SRPAlgorithm.java5
-rw-r--r--gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java5
3 files changed, 6 insertions, 9 deletions
diff --git a/gnu/javax/crypto/key/dh/RFC2631.java b/gnu/javax/crypto/key/dh/RFC2631.java
index d6e30b4bc..7fcad8d86 100644
--- a/gnu/javax/crypto/key/dh/RFC2631.java
+++ b/gnu/javax/crypto/key/dh/RFC2631.java
@@ -40,7 +40,6 @@ package gnu.javax.crypto.key.dh;
import gnu.java.security.hash.Sha160;
import gnu.java.security.util.PRNG;
-import gnu.java.security.util.Prime2;
import java.math.BigInteger;
import java.security.SecureRandom;
@@ -157,7 +156,7 @@ public class RFC2631
q = U.setBit(m - 1).setBit(0);
// 6. Use a robust primality algorithm to test whether q is prime.
// 7. If q is not prime then go to 4.
- if (Prime2.isProbablePrime(q))
+ if (q.isProbablePrime(80))
{
break step4;
}
@@ -190,7 +189,7 @@ public class RFC2631
// 16. If p > 2^(L-1) use a robust primality test to test whether p is
// prime. Else go to 18.
//17. If p is prime output p, q, seed, counter and stop.
- if (Prime2.isProbablePrime(p))
+ if (p.isProbablePrime(80))
{
break algorithm;
}
diff --git a/gnu/javax/crypto/key/srp6/SRPAlgorithm.java b/gnu/javax/crypto/key/srp6/SRPAlgorithm.java
index b068863ed..e59ab373f 100644
--- a/gnu/javax/crypto/key/srp6/SRPAlgorithm.java
+++ b/gnu/javax/crypto/key/srp6/SRPAlgorithm.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.javax.crypto.key.srp6;
-import gnu.java.security.util.Prime2;
import gnu.javax.crypto.sasl.srp.SRPRegistry;
import java.math.BigInteger;
@@ -151,13 +150,13 @@ public class SRPAlgorithm
+ SRPRegistry.MINIMUM_MODULUS_BITLENGTH);
}
// 2. N should be a prime
- if (!Prime2.passEulerCriterion(N))
+ if (! N.isProbablePrime(80))
{
throw new IllegalArgumentException("N should be prime but isn't");
}
// 3. N should be of the form 2*q + 1, where q is prime
final BigInteger q = N.subtract(ONE).divide(TWO);
- if (!Prime2.passEulerCriterion(q))
+ if (! q.isProbablePrime(80))
{
throw new IllegalArgumentException("(N-1)/2 should be prime but isn't");
}
diff --git a/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java b/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java
index cf1a9cf75..d6adb3701 100644
--- a/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java
+++ b/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java
@@ -42,7 +42,6 @@ import gnu.classpath.Configuration;
import gnu.java.security.Registry;
import gnu.java.security.key.IKeyPairGenerator;
import gnu.java.security.util.PRNG;
-import gnu.java.security.util.Prime2;
import java.math.BigInteger;
import java.security.KeyPair;
@@ -244,10 +243,10 @@ public class SRPKeyPairGenerator implements IKeyPairGenerator
q = new BigInteger(1, qBytes);
q = q.setBit(0).setBit(l - 2).clearBit(l - 1);
}
- while (!Prime2.isProbablePrime(q));
+ while (! q.isProbablePrime(80));
p = q.multiply(TWO).add(ONE);
}
- while (p.bitLength() != l || !Prime2.isProbablePrime(p));
+ while (p.bitLength() != l || ! p.isProbablePrime(80));
// compute g. from FIPS-186, Appendix 4: e == 2
BigInteger p_minus_1 = p.subtract(ONE);