Check if a given point (x, y) lies on the curve
bool containsPoint(BigInt x, BigInt y) { BigInt leftSide = (y * y - ((x * x + a) * x + b)) % p; return leftSide == BigInt.zero; }