public Point(FieldElement a, FieldElement b, FieldElement x, FieldElement y) { A = a; B = b; X = x; Y = y; // X and Y being null represents the point at infinity if (x == null && y == null) { return; } // make sure that the elliptic curve equation is satisfied // y^2 == x^3 + a*x + b if (y.Pow(2) != x.Pow(3) + a * x + b) { throw new Exception(string.Format("{0}, {1} is not on the curve", x, y)); } }
public static Point CreatePointAtInfinity(FieldElement a, FieldElement b) { return(new Point(a, b, null, null)); }