summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-02-19 11:02:55 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-02-19 11:02:55 +0700
commit59220167b4fd0230e3e7e9edba7178849e187a34 (patch)
treebfe41377c5f8fce7a69ee9163f11bc136b64769e
parentChanges to build system in preparation for beta release (diff)
downloadBouncyCastle.NET-ed25519-59220167b4fd0230e3e7e9edba7178849e187a34.tar.xz
Use ToBigInteger() for A/B comparison in curve equality
-rw-r--r--crypto/src/math/ec/ECCurve.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/math/ec/ECCurve.cs b/crypto/src/math/ec/ECCurve.cs
index 5c7592a92..f8ea8ba3c 100644
--- a/crypto/src/math/ec/ECCurve.cs
+++ b/crypto/src/math/ec/ECCurve.cs
@@ -276,8 +276,8 @@ namespace Org.BouncyCastle.Math.EC
             if (null == other)
                 return false;
             return Field.Equals(other.Field)
-                && A.Equals(other.A)
-                && B.Equals(other.B);
+                && A.ToBigInteger().Equals(other.A.ToBigInteger())
+                && B.ToBigInteger().Equals(other.B.ToBigInteger());
         }
 
         public override bool Equals(object obj) 
@@ -288,8 +288,8 @@ namespace Org.BouncyCastle.Math.EC
         public override int GetHashCode()
         {
             return Field.GetHashCode()
-                ^ Integers.RotateLeft(A.GetHashCode(), 8)
-                ^ Integers.RotateLeft(B.GetHashCode(), 16);
+                ^ Integers.RotateLeft(A.ToBigInteger().GetHashCode(), 8)
+                ^ Integers.RotateLeft(B.ToBigInteger().GetHashCode(), 16);
         }
 
         protected abstract ECPoint DecompressPoint(int yTilde, BigInteger X1);