Test if a point is on an elliptic curve.
(point-on-weierstrass-elliptic-curve-p point p a b) tests whetherFunction:
(defun point-on-weierstrass-elliptic-curve-p (point p a b) (declare (xargs :guard (and (dm::primep p) (< 3 p) (fep a p) (fep b p) (pointp point) (point-in-pxp-p point p)))) (or (eq point :infinity) (let ((x (car point)) (y (cdr point))) (let ((y^2 (mul y y p)) (x^3 (mul x (mul x x p) p))) (let ((x^3+ax+b (add x^3 (add (mul a x p) b p) p))) (equal y^2 x^3+ax+b))))))