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
Avoid order computation in EllipticCurveIsogeny function #24640
Comments
comment:2
This is related to ticket #22161, although our proposed fix is different from Kevin's. (I wasn't sure how to deal with tickets that already have a branch.) Basically, I am convinced that you never want to compute the group order or even the point order separately, ever. You should just always list all the multiples of P until you repeat back to where you started. In any other context, this would be a slow way to compute the point order, but in this context, it's a free computation, since you need the entire list of points anyway in order to apply Velu's formulas. |
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:4
Can you add an example demonstrating the speedup? |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
We added a doctest demonstrating the speedup. The test takes around a minute; we can try to think of ways to make it faster. Without our changes, the same test takes practically forever. |
comment:8
I changed a few small things:
Is there a smaller example? The current one take me about 75s
New commits:
|
comment:9
Thanks Kevin! Here's a smaller example that takes under 2 seconds with the patch, and still takes a very long time without the patch. (Hopefully integer factorization algorithms in the future will not improve to the point where the second part of the previous sentence becomes false.) I also added a speed optimization in the field creation step to help things along.
|
comment:11
We have updated our branch to include the faster doctest. New commits:
|
comment:12
Sorry to bug you again. But is there a even smaller example? I think the doctests are suppose to take under a second. Alternatively, you can flag it as a long test. http://doc.sagemath.org/html/en/developer/doctesting.html#run-long-doctests As a side question, how are you able to come up with these primes? After this, it should be go to go. Can you set the ticket as 'need review'? and I can give it a positive review. |
comment:13
You just pick random exponents until the resulting p is a prime. What you want is:
However, I'm worried that if p is too small then improvements in future factoring technology will render the second point false while still not invalidating the main conclusion that factoring is too slow and should be avoided in general. I think the lowest we should go is (180, 194). This runs in under 1 second on my machine. The full test is then:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
I have changed the status to 'needs review' and the branch has been updated to include the faster doctest. The doctest runs in under 1 second on my machine as well. |
comment:17
I made a small aesthetic change which was to fix some trailing spaces. I only made trivial code changes to this ticket so I hope it's okay that I'm the reviewer and am giving it a positive review. New commits:
|
comment:19
Reviewer name missing. |
comment:20
Opps. Sorry! |
Reviewer: Kevin Lui |
Changed branch from u/klui/avoid_order_computation_in_ellipticcurveisogeny_function to |
When computing the points in the kernel set of the isogeny, it is unnecessary and slow to perform the computation of P.order(): slow because computing the order requires factoring the order of E in many cases, and unnecessary because the preceding code block checks that P has finite order, and in the finite order case we can just compute all multiples of P until we get the identity since we need to compute all of these points anyway in order to list the kernel set. For curves of cryptographic size and kernels of small order, we have measured that eliminating the P.order() computation makes the EllipticCurveIsogeny function run 200 times faster.
I (David) discussed this problem with William Stein and Kevin Lui at JMM 2017, and Kevin identified the source of the problem, but seems to have never checked in a fix.
Component: elliptic curves
Keywords: isogeny
Author: Madison Van Dyk; David Jao
Branch/Commit:
926ff9b
Reviewer: Kevin Lui
Issue created by migration from https://trac.sagemath.org/ticket/24640
The text was updated successfully, but these errors were encountered: