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

exercise-66 #1

Closed
skaunov opened this issue Sep 7, 2023 · 2 comments
Closed

exercise-66 #1

skaunov opened this issue Sep 7, 2023 · 2 comments

Comments

@skaunov
Copy link
Contributor

skaunov commented Sep 7, 2023

Hi, @erhant ! Please tell me if such issues is welcome, since it's just a way of discussions for me. Also I'm not a Pythonist, so I can't suggest a nice commit in case...

So. I feel like https://github.com/erhant/moonmath/tree/master/elliptic-curves#exercise-66 isn't done in the spirit of the exercise. To me it looks like the idea was take all projective plane points and filter them getting the set of those which are in the curve.

It's still a question for me what's the best way not to double check projective points... Is there an iterator over them in Sage? Or just find out a fine traversing algorithm, which seems not a huge headache in a small field.

@skaunov
Copy link
Contributor Author

skaunov commented Sep 7, 2023

Though I managed to stitch a thing.

F = FiniteField(5)
P = ProjectiveSpace(2, F)

for p in P:
  if p[1]^2 * p[2] == p[0]^3 + p[0] * p[2]^2 + p[2]^3 :
    print(p)

@erhant
Copy link
Owner

erhant commented Sep 9, 2023

Greetings @skaunov,

Please tell me if such issues is welcome, since it's just a way of discussions for me
Sure thing! This is precisely why I have gathered my answers in this repo ;)

Thank you for the suggestion, firstly I solved it by iterating over the affine points with $z=1$ because in the example it particularly says:

Moreover, a point at infinity [X : Y : 0] can only satisfy the equation in (5.19) for any a and
b, if X = 0, which implies that the only point at infinity relevant for Short Weierstrass elliptic
curves is [0 : 1 : 0], since [0 : k : 0] = [0 : 1 : 0] for all k ∈ F∗. Therefore, we can exclude all points at infinity except the point [0 : 1 : 0].

However, I liked your suggestion of using ProjectiveSpace; I think the snippet you wrote does the job! I also found the following ProjectiveSpace_field.curve online. Apparently we can construct a curve from the projective field, but I couldn't get it to work for this exercise.

Anyways, I wrote the following:

F5 = GF(5)
F5P2 = ProjectiveSpace(F5, 2)
points = [(x, y, z) for (x, y, z) in F5P2 if y^2 * z == x^3 + x * z^2 + z^3]

I will be adding it to the solution 👌🏻

@skaunov skaunov closed this as completed Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants