Let $p \ne 2,3$, and let $E: y^2=x^3+ax+b$ be an elliptic curve over $\mathbb F_p$ with identity element $O$. For every affine point $P=(x_1,y_1) \in E(\mathbb F_p)$, define $-P=(x_1,-y_1)$, and define $-O=O$. If $P,Q \in E(\mathbb F_p)$, then $P+O=O+P=P$ and $P+(-P)=O$. For affine points $P=(x_1,y_1)$ and $Q=(x_2,y_2)$ with $Q \ne -P$, put
Then the chord-and-tangent addition law on $E(\mathbb F_p)$ is given by $P+Q=(x_3,y_3)$ in the nonvertical affine case and by the exceptional identity formulas above in the vertical and identity cases.