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


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Question on elliptic curves...


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()
Thanks for any help you can provide!

-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));
}