Karim Belabas on Sat, 11 Feb 2023 08:40:05 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Question on elliptic curves...
|
- To: wraithx@morpheus.net
- Subject: Re: Question on elliptic curves...
- From: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
- Date: Sat, 11 Feb 2023 08:38:54 +0100
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1676101129; c=relaxed/relaxed; bh=vIhvAnamc+iY9pXmRyZ5b46a0dvVnqCNPAn3e/+jcQc=; h=DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To; b=eDPo1Va5dFrHIc/OO1e+cLUTksWC10Dn5kOTvOF9k7ZNN6TQn3Ib81pGPJlsCi1pVtJs/pnUY1WE+Q/v6mb9Bl7nP/PcQi9fpMScz7n+PslH5R6Xju1qbLBJMwfXAd9IqeOH5ub02+4S/OZVUJQDj3AauQ5LssY93GUjz9eXwSzISj/EGMvNCMzrtbDN1LXGfszkcsvtoBfwJ+qYQdBPui1VnVSbOTecjHtcH++DNy3t6IbAXNJoLpkwtj4C0r9otCMUFoogMXQ6a9lp2P92ySncRAaMuAp8jMyyL0J34dawa4VdOQRAlxCIdV4MGSBLrTP+9SE09JgBrl0y5mbcgCENIawBrgRk77b55P2+vQp7FwJnkZX/KuDnP0umgyNlDa4UMqX2Lcnb76c0PV4I5XFjBUtmoDcl9rLYAQ+gl15yJd1QvHU4taN4lhZpL+4KJe/ro3BaZJ2Ics2QVopnAq41mepkU9GBGK8ihQvfBIKSAs6sQxT1QnmBXd/QoaOyS54TDhAvlP30938GQz53zYGFVE7nE4iNKf7j6t/S5+K0V5tMt4XuTLPCcjOyE2LjfCV2dS4Y0zMjf/YYEfzpGntGUUS5HJ9Ujz3r7byodgSKasDrTNvEw6ohhgCWu2GAzKuJUpRNC6eEnQlu4kbv6e2b579NcLo5LQsvOpkEx9Y=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1676101129; cv=none; b=06oxVegPcK488voJJSw1v+hi/6L5UiXOHb2YsEeBrWE22XMfmb0F5Gf0nRe0mya+KU+dYdTtX3rdCTW5MuMTvJYpqS59QeAfVzUq0O4ye4++adhIJivM6cSRgedWDjHRe3yKHjwgzHYVPZ7tjUdDh47VV+2xc/nE6vUKHkKYrF00PzhNkXFgrO/6TBfhSrI6Mxn5fJqqxmLkVXmMofGiPJsOncoSxqhc1eOGrEJNnaLvHEXC2aospNu0b2wdPA6xSdUs/ZGJ8UMQBNtWkbrxZVbkR1zNUhnRLUjZU78yGzopU01BiecSXeD9DffAUr7ECqlVh39dozvz7HP5kQ9lU7INfkpeVGsPZVQ2SAin6MkmQ7uwCqKBQHvFXALZAy15toEB0bme2rwcTGglQzzBtU+OsjX+2wlhK+tZ4I7O3qrCtB2pEbfXfH18xVzmiZzQNj2HaiiZ3gULx+CTBSFLrMZaY1uNavhNfPtYx2RVkPZusvMKsI0u7vy2HYvjbWlZAW+bI30+l7XfM8El5F6oZaUWeGAjf4VFLQSa8FHI+toQ0NaDVAns2r6ouQzAj7Jwg2G0TqxFI31GUuDcMdstbMoNXSme0DB0GkxljTGdPSATsMVbCOUeP6qXeTobKuu1/Aej6qxRHFyXcBSt2tTDBME5xIfJ80dy1pw3Hqkjwsg=
- Authentication-results: smail; arc=none
- Cc: pari-users@pari.math.u-bordeaux.fr
- Delivery-date: Sat, 11 Feb 2023 08:40:05 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1676101129; bh=vIhvAnamc+iY9pXmRyZ5b46a0dvVnqCNPAn3e/+jcQc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WZ2ZvKWhirQR/V8VX1/162lpzYP24mXAkZdzt54i0Z83ak3bjpzS+Y2/6giErqlU0 yRuROplTdbyGckasFx0ob/H0mq6NRJpsFnUAwgVa78Gpg1Oq5s/+u89k+zLq4j5rwu VKZDFUo37eICVw+fpYToUA5J0ACdK1LCA3f/lWF58X+efrEBj2XEkAqlEvve9VoeSr Mw1e8pfllawmaLhwrVY8BhKVLpa81jkt2xOweSYIT4sROMZF1dJaMnV0c0Vk5WScjO Q/xhh3u4eH4mylEgGeWw1fO34wxCeMt31Sk2qGxMkguzXkjj/N9EIVCwVHTbtlVsPG aC20zs7Yemv07Q2SNhenvBdyMHvHshn8lIzszuiOGZPjEDmRXzAhLxcyVDUFDxyQ/s L6tEojeDWiZyMdrGW2oGS1kBC6e0Dxny9bmdDpUtDCKLiOkdRIwWFEWD7Ff0zEultJ NI+drRwXq3ym3zNhie6i3qU4q3qqpdPCEPX+soEnRfxrS9fA9F85alBNbHx8siL2t9 4FSEFVcGK9lFRHIPi22cuIzas+xpRkGjUh72m80VdcfMak7N1V92V2sHp2YM/AzIsy hNp625BI23dbcsuLCGuxptiAY5kcx9+lhFZB0jcz/Y31hTnlHa3JKF0afbDrhCdiHl ZkBfw/wZxkSosGG9QUCp2j3Q=
- In-reply-to: <63E7129B.4000007@morpheus.net>
- Mail-followup-to: wraithx@morpheus.net, pari-users@pari.math.u-bordeaux.fr
- References: <63E7129B.4000007@morpheus.net>
* wraithx@morpheus.net [2023-02-11 04:59]:
> 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()
[x,y] = ellmul(E, [-3,3], s);
CAVEAT: If s is a multiple of the point order, so that s*E(-3,3) is the
point at infinity, you will get a 'non existent component' error instead
of a ZeroDivision error in Sage. If you intend to trap it somewhere,
this can be done using iferr(), producing an e_COMPONENT exception.
Cheers,
K.B.
> 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));
> }
>
K.B.
--
Pr Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/
`