Beispiel #1
0
 public int CompareTo(ECFieldElement other)
 {
     if (ReferenceEquals(this, other))
     {
         return(0);
     }
     if (!curve.Equals(other.curve))
     {
         throw new InvalidOperationException("Invalid comparision for points with different curves");
     }
     return(Value.CompareTo(other.Value));
 }
Beispiel #2
0
        public int CompareTo(ECPoint other)
        {
            if (!Curve.Equals(other.Curve))
            {
                throw new InvalidOperationException("Invalid comparision for points with different curves");
            }
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            int result = X.CompareTo(other.X);

            if (result != 0)
            {
                return(result);
            }
            return(Y.CompareTo(other.Y));
        }