-
-
Notifications
You must be signed in to change notification settings - Fork 719
support passing two base points to .log() for elliptic-curve points #38347
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
support passing two base points to .log() for elliptic-curve points #38347
Conversation
|
Documentation preview for this PR (built with commit 544556d; changes) is ready! 🎉 |
GiacomoPope
left a comment
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.
This is great! Thank you, means I can stop hand-writing this function all the time myself haha.
070db92 to
eb6e4b3
Compare
|
Thanks! I applied your suggestions, added a new random test, and seem to have fixed the bugs that were caught by the random test. |
|
Cool! Thanks for making the changes. |
85ff4df to
1ec358a
Compare
1ec358a to
b9dbbb5
Compare
|
@GiacomoPope I've now simplified this following #38359 and I think it should be ready to be reviewed/merged. |
GiacomoPope
left a comment
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.
comment about comment, but this looks great.
SageMath version 10.5.beta1, Release Date: 2024-08-03
|
The CI seems to be morally green. |
sagemathgh-38805: use specialized 2-dimensional .log() method in .matrix_on_subgroup() This should be equivalent but faster (see sagemath#38347). ```sage sage: E = EllipticCurve(GF((2^77-33, 2)), [1,0]) ....: P, Q = E.gens() ....: pi = E.automorphisms()[-1] ....: %time pi.matrix_on_subgroup([P, Q]) ``` Sage 10.5.beta7: ``` CPU times: user 13.8 s, sys: 32.5 ms, total: 13.8 s ``` This branch: ``` CPU times: user 48.1 ms, sys: 64 µs, total: 48.2 ms ``` URL: sagemath#38805 Reported by: Lorenz Panny Reviewer(s): grhkm21
sagemathgh-38805: use specialized 2-dimensional .log() method in .matrix_on_subgroup() This should be equivalent but faster (see sagemath#38347). ```sage sage: E = EllipticCurve(GF((2^77-33, 2)), [1,0]) ....: P, Q = E.gens() ....: pi = E.automorphisms()[-1] ....: %time pi.matrix_on_subgroup([P, Q]) ``` Sage 10.5.beta7: ``` CPU times: user 13.8 s, sys: 32.5 ms, total: 13.8 s ``` This branch: ``` CPU times: user 48.1 ms, sys: 64 µs, total: 48.2 ms ``` URL: sagemath#38805 Reported by: Lorenz Panny Reviewer(s): grhkm21
sagemathgh-38805: use specialized 2-dimensional .log() method in .matrix_on_subgroup() This should be equivalent but faster (see sagemath#38347). ```sage sage: E = EllipticCurve(GF((2^77-33, 2)), [1,0]) ....: P, Q = E.gens() ....: pi = E.automorphisms()[-1] ....: %time pi.matrix_on_subgroup([P, Q]) ``` Sage 10.5.beta7: ``` CPU times: user 13.8 s, sys: 32.5 ms, total: 13.8 s ``` This branch: ``` CPU times: user 48.1 ms, sys: 64 µs, total: 48.2 ms ``` URL: sagemath#38805 Reported by: Lorenz Panny Reviewer(s): grhkm21
sagemathgh-38805: use specialized 2-dimensional .log() method in .matrix_on_subgroup() This should be equivalent but faster (see sagemath#38347). ```sage sage: E = EllipticCurve(GF((2^77-33, 2)), [1,0]) ....: P, Q = E.gens() ....: pi = E.automorphisms()[-1] ....: %time pi.matrix_on_subgroup([P, Q]) ``` Sage 10.5.beta7: ``` CPU times: user 13.8 s, sys: 32.5 ms, total: 13.8 s ``` This branch: ``` CPU times: user 48.1 ms, sys: 64 µs, total: 48.2 ms ``` URL: sagemath#38805 Reported by: Lorenz Panny Reviewer(s): grhkm21
sagemathgh-38805: use specialized 2-dimensional .log() method in .matrix_on_subgroup() This should be equivalent but faster (see sagemath#38347). ```sage sage: E = EllipticCurve(GF((2^77-33, 2)), [1,0]) ....: P, Q = E.gens() ....: pi = E.automorphisms()[-1] ....: %time pi.matrix_on_subgroup([P, Q]) ``` Sage 10.5.beta7: ``` CPU times: user 13.8 s, sys: 32.5 ms, total: 13.8 s ``` This branch: ``` CPU times: user 48.1 ms, sys: 64 µs, total: 48.2 ms ``` URL: sagemath#38805 Reported by: Lorenz Panny Reviewer(s): grhkm21
The points on an elliptic curve over a finite field form a group of rank up to$2$ . In this patch we add support for passing two base points instead of just one to the
.log()method, which will decompose the given point as a linear combination of the given points. This functionality is already available via the.abelian_group()method of the elliptic curve, but the latter is much slower since it relies only on generic-group algorithms and does not exploit the Weil pairing:⌛ Dependencies
.log()method in finite fields #38350