-
-
Notifications
You must be signed in to change notification settings - Fork 657
compute traces of elliptic-curve endomorphisms #35546
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
Conversation
I like this and will certainly review it positively soon. I have a few questions first:
Thanks for your work on this! |
Some more comments, possibly more interesting:
|
Correction to previous point: if s=phi.scaling_factor() and d=phi.degree() then trace=s+d/s. That's in char.0 -- as before this gives the trace mod p in char p, provided d mod p is not 0. |
My comments above were by way of review |
Thank you for the very useful feedback, I think I've addressed it all in the current branch. I also have a question: Do you happen to know if the optimization with the scaling factor has appeared in the literature? I (re)discovered this trick a little while ago and assumed it was new, but evidently this was either known or obvious to you. |
Do you mean the s+d/s formula? No, I don't know a reference, it just seemed fairly obvious to me. Perhaps I thought of it while writing notes for a course a few years ago. |
Does this need a new review? If so I will. |
It's the same as before, only rebased onto the latest beta. I think you hadn't yet reviewed the changes I made following your first batch of comments, though. |
OK thanks, I thought that maybe I had something yet to do. I'll do it soon, hopefully this week while at LuCaNT (pity you are not here. @yyyyx4 !) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
On Linux 32-bit:
|
That's funny. I thought we had dealt with this issue of nondeterministic lifting of X coordinates. |
Indeed. The inconsistency stems from the following behaviour, which has nothing to do with any of the changes here (or earlier): sage: K.<Y> = NumberField(x^3 - x^2 + 7*x + 7)
sage: Y <= -Y
False
sage: -Y <= Y
False Therefore, in the failing doctest, the |
I'm not sure how to resolve this: It looks like this behavior is intended for number fields, since there's usually no mathematically meaningful ordering on their elements (in the sense of ordered fields). On the other hand, finite fields, which are equally un‑ordered, simply apply lexicographic comparison anyway. I suppose what this highlights is that Sage should — but currently doesn't — distinguish between mathematically meaningful orderings and simple comparison functions for practical purposes (sorting, deterministic choice). Fixing all that seems far beyond the scope of this ticket, though... |
I think we have to either output just the x-coordinate (OK for a test, not so good for the documentation), or add a random tag, |
1eb47f7
to
c039809
Compare
Documentation preview for this PR (built with commit c039809; changes) is ready! 🎉 |
Thanks, I added a random tag. Since nothing else changed since you looked at this, I'll set it back to "positive review". |
In this patch, we add a generic method to compute the trace of an elliptic-curve endomorphism.
The computation uses a variant of Schoof's algorithm, which relies (only) on evaluating the endomorphism on small-order points, hence the method is totally independent of the internal representation of the
EllipticCurveHom
.Adding this method is yet another step towards implementing endomorphism rings, especially for supporting the quaternionic (supersingular) case. I'm sure some speedups are possible, but they can come later.