Do E2.cardinality() first. You don't say which Sage version you are using but this sounds like something I fixed recently for curves with j=0 or 1728. See
http://trac.sagemath.org/ticket/15667 which was merged in Sage 6.2. John Cremona On 15 June 2014 10:14, Alberto Garcia <[email protected]> wrote: > More info: > I've just realised that the problem is not the function weil_pairing() but > p1.order(). > SAGE gets stuck calculating the order of the point. > > Regards. > > El domingo, 15 de junio de 2014 01:17:06 UTC+2, Alberto Garcia escribió: >> >> Hello, >> >> >> I'm trying to calculate a pairing with the SAGE weil_pairing() function >> while using a distortion map, but the weil_pairing() function never returns >> and it seems like is eating all the computer memory. >> Here is the code I'm using: >> >> >> sage: p = 293779600266612700060489507 >> >> sage: F = GF(p) >> >> sage: E = EllipticCurve(F, [-1,0]) >> >> sage: F2.<alpha>=GF(p^2, name='alpha',modulus=ZZ['x']('x^2+1')); >> >> sage: E2 = E.change_ring(F2) >> >> sage: def custom_weil_pairing(p1, p2, n): >> >> ....: wp = p1.weil_pairing(E2(-p2[0], alpha*p2[1]), n) >> >> ....: return wp >> >> ....: >> >> sage: p1=E2.random_element() >> >> sage: p2=E2.random_element() >> >> sage: custom_weil_pairing(p1, p2, p1.order()) >> >> >> Actually, p1 and p2 are point with the same order in my real code. >> >> I've been googling but I haven't found any known bug explaining this >> behavior. >> >> Am I doing something wrong? >> >> >> Regards. > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
