# elliptic curve arithmetic without inversion

It seems when you add points on an elliptic curve in sage, it immediately divides by the z coordinate if it is not zero. Since I plan on working in a finite field of a large prime, I would rather it not calculate this inverse, but I'm not sure how to stop it from automatically doing so. How do I get it to leave the z coordinate alone so as to avoid inverting elements of my field?

edit retag close merge delete

In this case it may be simplest to implement the own addition of points on the curve. An own class witn an __add__ method and a __mul__ method would do the job. Which formulas should be implemented for which curve explicitly?

Here are some examples for the usage of __add__ and __mul__:

sage: 12+45
57
57
sage: E = EllipticCurve( GF(7), [2,3] )
sage: P, Q = E.random_point(), E.random_point()
sage: P, Q
((2 : 1 : 1), (3 : 1 : 1))