private Point SimpleMultiply(Point p, BigInt k) { if (!(this.field.IsValidElement(p.X)) || !(this.field.IsValidElement(p.Y)) ) { throw new ArgumentException("The input point must be taken over the field."); } if (p.IsInfinity()) { return(p); } if (k.Equals(BigInt.ZERO)) { return(Point.INFINITY); } if (k.Equals(BigInt.ONE)) { return(p); } if (k.Signum() == -1) { k = k.Abs(); p = this.Negate(p); } sbyte[] ba = k.ToByteArray(); int degree = ByteArrayUtil.DegreeOf(ba) - 1; Point x = p; for (int i = degree; i >= 0; i--) { x = this.Dbl(x); if (ByteArrayUtil.GetBitByDegree(i, ba)) { x = this.Add(p, x); } } return(x); }