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
A better Carmichael lambda function #8283
Comments
based on 4.3.3 |
comment:1
Attachment: trac_8283-improve_carmichael_lambda.patch.gz I don't use |
comment:2
Applies okay to 10.26.2 mac and passes sage -testall. Okay with me. Minh, what do you think? |
apply on top of previous one |
comment:3
Attachment: trac_8283-reviewer.patch.gz Replying to @wdjoyner:
I agree with Yann's rewrite. It's much more compact than the previous version. However, I have attached the reviewer patch trac_8283-reviewer.patch, whose changes include:
These import statements are no longer required due to Yann's rewrite of the Carmichael lambda function.
to the module preamble, so that it now reads
This has the effect of importing only what is required, i.e. the class
with the more compact
Only my patch needs review by anyone but me. If it's OK, then the whole ticket gets a positive review. |
Author: Yann Laigle-Chapuy |
Reviewer: David Joyner, Minh Van Nguyen |
comment:4
I read this over - looks good. I also installed it on top of the previous patch - passed sage -t devel/sage/sage/crypto/util.py. Is that enough, or it sage -testall necessary? If that is okay, positive review from me. |
comment:5
Replying to @wdjoyner:
Running all doctests in the cryptography module subdirectory would be nice. Something like:
The module |
comment:6
Done. All tests passed! |
Merged: sage-4.3.4.alpha1 |
Reported by ylchapuy:
Here is another implementation:
This is a bit faster than the current implementation and, if you replace lcm with sage.rings.integer.LCM_list, it is even faster.
A bug with the current function is that the output is not always an integer: e.g., carmichael_lambda(16) is of type sage.rings.rational.Rational .
Component: cryptography
Author: Yann Laigle-Chapuy
Reviewer: David Joyner, Minh Van Nguyen
Merged: sage-4.3.4.alpha1
Issue created by migration from https://trac.sagemath.org/ticket/8283
The text was updated successfully, but these errors were encountered: