diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-13 13:33:44 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-13 13:33:44 +0700 |
commit | 1913ecde1fc3d60dbefabc5f6d745ba9d603d3b7 (patch) | |
tree | 8e98cb215b14e7446231cbca859134301a8ec5a5 | |
parent | According to RFC 6066, host_name should use ASCII encoding (diff) | |
download | BouncyCastle.NET-ed25519-1913ecde1fc3d60dbefabc5f6d745ba9d603d3b7.tar.xz |
Further refinement to random prime constructor
-rw-r--r-- | crypto/src/math/BigInteger.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/src/math/BigInteger.cs b/crypto/src/math/BigInteger.cs index 794f252e8..b35701fb3 100644 --- a/crypto/src/math/BigInteger.cs +++ b/crypto/src/math/BigInteger.cs @@ -706,10 +706,9 @@ namespace Org.BouncyCastle.Math if (CheckProbablePrime(certainty, random, true)) break; - for (int j = 1; j < magnitude.Length; ++j) + for (int j = 1; j < (magnitude.Length - 1); ++j) { - this.magnitude[j] ^= (random.Next() << 1); - this.mQuote = 0; + this.magnitude[j] ^= random.Next(); if (CheckProbablePrime(certainty, random, true)) return; |