# How to work with points in GF(p**2) for a prime p

I'm constructing elliptic curves over fields of size $p^{2}$ for some prime $p$, and I want to do arithmetic with points on these curves. I think my question is best asked with an example: Say I put

p=431
k=GF(p**2)
E=EllipticCurve(k,[0,329,0,1,0])
E


Sage will say

Elliptic Curve defined by y^2 = x^3 + 329*x^2 + x over Finite Field in z2 of size 431^2


I understand that z2 in this case is the root of an irreducible polynomial used in the construction of GF(p**2). Say I want to use sage to figure out what $ (272z2 + 405 : 167z2 + 52 : 1)$ is. This is what I would type into sage:

2*E(272*z2 + 405, 167*z2 + 52, 1)


But if I do that, I get an error saying that z2 is undefined. I've also gotten the error message

unsupported operand parent(s) for +: '<class 'tuple'>' and 'Integer Ring'


I'm not sure how to get sage to treat z2 as the root of the irreducible polynomial. It seems to think of it as a variable that should have a value assigned to it. Any help would be greatly appreciated.

edit retag close merge delete

Sort by » oldest newest most voted

The generator is obtained by doing

sage: k.gen()
z2


Here z2 is just its name. You can store it in a Python variable z2 if you like

sage: z2 = k.gen()

more