Ticket #1119 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

[with patch, positive review] EllipticCurve.random_element for char=2

Reported by: malb Owned by: malb
Priority: major Milestone: sage-2.9
Component: number theory Keywords:
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

This should work:

sage: k.<a> = GF(2^5)
sage: E = EllipticCurve(k,[k.random_element() for _ in range(5)])
sage: E
Elliptic Curve defined by y^2 + (a^3+1)*x*y + (a^4+a^3+a)*y = x^3 +
(a^4+a^3+a^2+a)*x^2 + (a^4+a^2+a+1)*x + a^2 over Finite Field in a of
size 2^5
sage: E.random_element()
Exception (click to the left for traceback):
...
ZeroDivisionError: division by zero in finite field.

Attachments

ell_gf2_random.patch Download (4.6 KB) - added by malb 6 years ago.
ell_gf2_random2.patch Download (1.6 KB) - added by robertwb 5 years ago.

Change History

comment:1 Changed 6 years ago by malb

  • Owner changed from was to malb
  • Status changed from new to assigned
  • Summary changed from EllipticCurve.random_element for char=2 to [with patch] EllipticCurve.random_element for char=2

The attached patch fixes this (probably in a too naive way).

Changed 6 years ago by malb

comment:2 Changed 6 years ago by mabshoff

  • Milestone changed from sage-2.9 to sage-2.8.13

Changed 5 years ago by robertwb

comment:3 Changed 5 years ago by robertwb

Given E defined by f(x,y) = 0, the patch assumed that there were always exactly zero or two values of y for every x, which is not true. I've attached a patch fixing this issue.

Also, in the characteristic > 2 case, it never considered the 'negative' square-root. I changed this too.

Otherwise, the patch looks good.

comment:4 Changed 5 years ago by was

  • Summary changed from [with patch] EllipticCurve.random_element for char=2 to [with patch, positive review] EllipticCurve.random_element for char=2

#1119 looks good. It is slow but I don't know if that can be helped.

comment:5 Changed 5 years ago by mabshoff

  • Status changed from assigned to closed
  • Resolution set to fixed

Merged in 2.9.rc0.

Note: See TracTickets for help on using tickets.