For affine points and the sum is computed via:
(if ) (if )
;
.
Let's verify that this operation is associative, i.e.
Note that the equations are independent of the curve parameters, but we will need to use the fact that the points all satisfy the curve equation
.
As a sanity check, let's first verify that the output of add(,) is always on the curve, and check the identity, inverses, and commutativity
Good, now for associativity in the general case...
Oops, we forgot to use the curve equation, we need to use our "equal" function which reduces into the quotient ring.
Now check the cases where 2 points are equal,
and also cases where 2 points are opposites,
and when all 3 points are equal
Just in case this all looked too easy, take a look at what is actually being compared...