summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2016-05-07 15:12:30 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2016-05-07 15:12:30 +0700
commita803651ae8ece3cb203bdaaee0cffef8f43689c7 (patch)
tree55ed969e6e277acbaf8a69637dc8824fdf2c936b
parentExtra test method (diff)
downloadBouncyCastle.NET-ed25519-a803651ae8ece3cb203bdaaee0cffef8f43689c7.tar.xz
Update ECDomainParameters GetHashCode
-rw-r--r--crypto/src/crypto/parameters/ECDomainParameters.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/crypto/src/crypto/parameters/ECDomainParameters.cs b/crypto/src/crypto/parameters/ECDomainParameters.cs
index 9d1544771..732fbdfa4 100644
--- a/crypto/src/crypto/parameters/ECDomainParameters.cs
+++ b/crypto/src/crypto/parameters/ECDomainParameters.cs
@@ -104,10 +104,14 @@ namespace Org.BouncyCastle.Crypto.Parameters
 
         public override int GetHashCode()
         {
-            return curve.GetHashCode()
-                ^	g.GetHashCode()
-                ^	n.GetHashCode()
-                ^	h.GetHashCode();
+            int hc = curve.GetHashCode();
+            hc *= 37;
+            hc ^= g.GetHashCode();
+            hc *= 37;
+            hc ^= n.GetHashCode();
+            hc *= 37;
+            hc ^= h.GetHashCode();
+            return hc;
         }
     }
 }