From 59220167b4fd0230e3e7e9edba7178849e187a34 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Wed, 19 Feb 2014 11:02:55 +0700 Subject: Use ToBigInteger() for A/B comparison in curve equality --- crypto/src/math/ec/ECCurve.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crypto/src/math') 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); -- cgit 1.5.1