Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EllipticCurve.random_element for char=2 #1119

Closed
malb opened this issue Nov 7, 2007 · 5 comments
Closed

EllipticCurve.random_element for char=2 #1119

malb opened this issue Nov 7, 2007 · 5 comments

Comments

@malb
Copy link
Member

malb commented Nov 7, 2007

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.

Component: number theory

Issue created by migration from https://trac.sagemath.org/ticket/1119

@malb malb added this to the sage-2.9 milestone Nov 7, 2007
@malb
Copy link
Member Author

malb commented Nov 8, 2007

comment:1

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

@malb malb assigned malb and unassigned williamstein Nov 8, 2007
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 11, 2007

comment:2

Attachment: ell_gf2_random.patch.gz

@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-2.9, sage-2.8.13 Nov 11, 2007
@robertwb
Copy link
Contributor

comment:3

Attachment: ell_gf2_random2.patch.gz

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.

@williamstein
Copy link
Contributor

comment:4

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

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Dec 15, 2007

comment:5

Merged in 2.9.rc0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants