summary refs log tree commit diff
path: root/crypto/src/math
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-11-13 13:33:44 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-11-13 13:33:44 +0700
commit1913ecde1fc3d60dbefabc5f6d745ba9d603d3b7 (patch)
tree8e98cb215b14e7446231cbca859134301a8ec5a5 /crypto/src/math
parentAccording to RFC 6066, host_name should use ASCII encoding (diff)
downloadBouncyCastle.NET-ed25519-1913ecde1fc3d60dbefabc5f6d745ba9d603d3b7.tar.xz
Further refinement to random prime constructor
Diffstat (limited to '')
-rw-r--r--crypto/src/math/BigInteger.cs5
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;