summary refs log tree commit diff
path: root/crypto/src
diff options
context:
space:
mode:
authorDavid Hook <dgh@cryptoworkshop.com>2022-03-23 15:12:05 +1100
committerDavid Hook <dgh@cryptoworkshop.com>2022-03-23 15:12:05 +1100
commitd2c21efe437d17d375cbe81d0d2c3968cfab44c7 (patch)
tree4c0c2a2f98b66a42d3256d6936aa6fd2f5dc0214 /crypto/src
parentadded RSA/EC checks (diff)
downloadBouncyCastle.NET-ed25519-d2c21efe437d17d375cbe81d0d2c3968cfab44c7.tar.xz
minor corrections, updated ECPointTest
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/crypto/parameters/RsaKeyParameters.cs2
-rw-r--r--crypto/src/math/ec/ECCurve.cs9
2 files changed, 7 insertions, 4 deletions
diff --git a/crypto/src/crypto/parameters/RsaKeyParameters.cs b/crypto/src/crypto/parameters/RsaKeyParameters.cs
index b1e1a8edf..4f8dba680 100644
--- a/crypto/src/crypto/parameters/RsaKeyParameters.cs
+++ b/crypto/src/crypto/parameters/RsaKeyParameters.cs
@@ -91,7 +91,7 @@ namespace Org.BouncyCastle.Crypto.Parameters
             return modulus.GetHashCode() ^ exponent.GetHashCode() ^ IsPrivate.GetHashCode();
         }
 
-        int AsInteger(string envVariable, int defaultValue)
+        internal static int AsInteger(string envVariable, int defaultValue)
         {
             String v = Platform.GetEnvironmentVariable(envVariable);
 
diff --git a/crypto/src/math/ec/ECCurve.cs b/crypto/src/math/ec/ECCurve.cs
index 2b193ba06..3861dc4cb 100644
--- a/crypto/src/math/ec/ECCurve.cs
+++ b/crypto/src/math/ec/ECCurve.cs
@@ -700,9 +700,12 @@ namespace Org.BouncyCastle.Math.EC
             if (isInternal)
             {
                 this.m_q = q;
-                knownQs.add(q);
+                if (!knownQs.Contains(q))
+                {
+                    knownQs.Add(q, q);
+                }
             }
-            else if (knownQs.contains(q))
+            else if (knownQs.Contains(q))
             {
                 this.m_q = q;
             }
@@ -718,7 +721,7 @@ namespace Org.BouncyCastle.Math.EC
                 }
 
                 if (Primes.HasAnySmallFactors(q) || !Primes.IsMRProbablePrime(
-                    q, random, getNumberOfIterations(qBitLength, certainty)))
+                    q, random, GetNumberOfIterations(qBitLength, certainty)))
                 {
                     throw new ArgumentException("Fp q value not prime");
                 }