def is_on_curve(self, point):
        """
        Checks whether a point is on the curve.

        Args:
            point (AffinePoint): Point to be checked.

        Returns:
            bool: True if point is on the curve, False otherwise.
        """
        X, Y = point.X, point.Y
        return (
                pow(Y, 2, self.P) - pow(X, 3, self.P) - self.a * X - self.b
            ) % self.P == 0
Checks whether a point is on the curve.

        Args:
            point (AffinePoint): Point to be checked.

        Returns:
            bool: True if point is on the curve, False otherwise.