public static ECPoint ImportPoint(ECCurve c, ECPoint p)
        {
            ECCurve other = p.Curve;

            if (!c.Equals(other))
            {
                throw new ArgumentException("Point must be on the same curve");
            }
            return(c.ImportPoint(p));
        }
Beispiel #2
0
        public static ECPoint ImportPoint(ECCurve c, ECPoint p)
        {
            //IL_0015: Unknown result type (might be due to invalid IL or missing references)
            ECCurve curve = p.Curve;

            if (!c.Equals(curve))
            {
                throw new ArgumentException("Point must be on the same curve");
            }
            return(c.ImportPoint(p));
        }
Beispiel #3
0
        public virtual bool Equals(ECPoint other)
        {
            if (this == other)
            {
                return(true);
            }
            if (other == null)
            {
                return(false);
            }
            ECCurve curve       = Curve;
            ECCurve curve2      = other.Curve;
            bool    flag        = null == curve;
            bool    flag2       = null == curve2;
            bool    isInfinity  = IsInfinity;
            bool    isInfinity2 = other.IsInfinity;

            if (isInfinity || isInfinity2)
            {
                return(isInfinity && isInfinity2 && (flag || flag2 || curve.Equals(curve2)));
            }
            ECPoint eCPoint  = this;
            ECPoint eCPoint2 = other;

            if (!flag || !flag2)
            {
                if (flag)
                {
                    eCPoint2 = eCPoint2.Normalize();
                }
                else if (flag2)
                {
                    eCPoint = eCPoint.Normalize();
                }
                else
                {
                    if (!curve.Equals(curve2))
                    {
                        return(false);
                    }
                    ECPoint[] array = new ECPoint[2]
                    {
                        this,
                        curve.ImportPoint(eCPoint2)
                    };
                    curve.NormalizeAll(array);
                    eCPoint  = array[0];
                    eCPoint2 = array[1];
                }
            }
            return(eCPoint.XCoord.Equals(eCPoint2.XCoord) && eCPoint.YCoord.Equals(eCPoint2.YCoord));
        }
Beispiel #4
0
        public virtual bool Equals(ECPoint other)
        {
            if (this == other)
            {
                return(true);
            }
            if (other == null)
            {
                return(false);
            }
            ECCurve curve      = this.Curve;
            ECCurve curve2     = other.Curve;
            bool    flag       = null == curve;
            bool    flag2      = null == curve2;
            bool    isInfinity = this.IsInfinity;
            bool    flag4      = other.IsInfinity;

            if (isInfinity || flag4)
            {
                return((isInfinity && flag4) && ((flag || flag2) || curve.Equals(curve2)));
            }
            ECPoint point = this;
            ECPoint p     = other;

            if (!flag || !flag2)
            {
                if (flag)
                {
                    p = p.Normalize();
                }
                else if (flag2)
                {
                    point = point.Normalize();
                }
                else
                {
                    if (!curve.Equals(curve2))
                    {
                        return(false);
                    }
                    ECPoint[] points = new ECPoint[] { this, curve.ImportPoint(p) };
                    curve.NormalizeAll(points);
                    point = points[0];
                    p     = points[1];
                }
            }
            return(point.XCoord.Equals(p.XCoord) && point.YCoord.Equals(p.YCoord));
        }
        public static ECPoint ImportPoint(ECCurve c, ECPoint p)
        {
            ECCurve cp = p.Curve;
            if (!c.Equals(cp))
                throw new ArgumentException("Point must be on the same curve");

            return c.ImportPoint(p);
        }