wraithx on Sat, 11 Feb 2023 05:00:56 +0100

 Question on elliptic curves...

• To: pari-users@pari.math.u-bordeaux.fr
• Subject: Question on elliptic curves...
• From: wraithx@morpheus.net
• Date: Fri, 10 Feb 2023 21:59:23 -0600
• Delivery-date: Sat, 11 Feb 2023 05:00:56 +0100
• Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=morpheus.net; s=mail; t=1676087985; bh=rHmYErMdfkzo35pfQ7D9LJamUZnwWhYAaKTQzSzMRi8=; h=Date:From:To:Subject:From; b=UNBuWYdDRWfBvShjP4ILevTRlTmNIq+3IleylShPWUbLOpAnZQ9DWOPJUi0JSDGxr DZ9TYLiM7pJp+xVmEhqVRUaaL0A69/ta2vpGcjKcslLP8tZMydN325nbWVYPMrHZj6 6QpMMO4okW+7DGGhbL2NmSN3LxppLvu78RhQv70I=
• User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

```Hello,

I was wondering how to convert the following sage code to Pari/GP?
```
I already have a conversion of the first function FindGroupOrderA, but in the function FindGroupOrderParam2, I'm not sure how to do the following two lines in Pari/GP:
```   P = s*E(-3,3)
x,y = P.xy()

-David C.

# Example SAGE code:
def FindGroupOrderA(p,A):
K = GF(p)
d = K((A+2)/4)
a = K(4*d-2)
b = K(16*d+2)
E = EllipticCurve(K,[0,a/b,0,1/b^2,0])
return E.cardinality()

# for parameter sigma = 2:s
def FindGroupOrderParam2(p,s):
K = GF(p)
E = EllipticCurve(K,[0,36])
P = s*E(-3,3)
x,y = P.xy()
x3 = (3*x+y+6)/(2*(y-3))
A = -(3*x3^4+6*x3^2-1)/(4*x3^3)
return FindGroupOrderA(p, A)

#=================================
# Conversion to Pari/GP:
FindGroupOrderA(p,A)={
my(K, d, a, b, E);
K = Mod(1,p);
d = K*((A+2)/4);
a = K*(4*d-2);
b = K*(16*d+2);
E = ellinit([0,a/b,0,1/b^2,0],K);
return(ellcard(E));
}

# for parameter sigma = 2:s
FindGroupOrderParam2(p,s)={
my(K,E,P,x,y,x3,A);
K = Mod(1,p);
E = ellinit([0,36],K);
P = s*E(-3,3); //?????
x,y = P.xy(); //?????
x3 = (3*x+y+6)/(2*(y-3));
A = -(3*x3^4+6*x3^2-1)/(4*x3^3);
return(FindGroupOrderA(p, A));
}

```