NBitcoin.BouncyCastle.Math.EC.ECCurve.ImportPoint C# (CSharp) Метод

ImportPoint() публичный Метод

public ImportPoint ( NBitcoin.BouncyCastle.Math.EC.ECPoint p ) : NBitcoin.BouncyCastle.Math.EC.ECPoint
p NBitcoin.BouncyCastle.Math.EC.ECPoint
Результат NBitcoin.BouncyCastle.Math.EC.ECPoint
		public virtual ECPoint ImportPoint(ECPoint p)
		{
			if(this == p.Curve)
			{
				return p;
			}
			if(p.IsInfinity)
			{
				return Infinity;
			}

			// TODO Default behaviour could be improved if the two curves have the same coordinate system by copying any Z coordinates.
			p = p.Normalize();

			return ValidatePoint(p.XCoord.ToBigInteger(), p.YCoord.ToBigInteger(), p.IsCompressed);
		}

Usage Example

Пример #1
0
        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));
        }
All Usage Examples Of NBitcoin.BouncyCastle.Math.EC.ECCurve::ImportPoint