-
-
Notifications
You must be signed in to change notification settings - Fork 49k
Add Pollard’s Rho algorithm for discrete logarithm #13657
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
Add Pollard’s Rho algorithm for discrete logarithm #13657
Conversation
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.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
- Added Wikipedia URL for Pollard's rho algorithm for logarithms - Removed unused Tuple import - All doctests and unit tests pass
- Replace generic parameter names (g, h, p) with descriptive names (base, target, modulus) - Replace generic function name 'f' with 'pseudo_random_function' - Add proper type hints for all parameters and return values - Replace single-letter variables with descriptive names throughout - Maintain backward compatibility with positional arguments - All tests and doctests continue to pass
e958476 to
b31cc12
Compare
- Use modern type hint syntax (int | None instead of Optional[int]) - Fix import order (removed unused typing import) - Fix line length issues by breaking long lines - Remove trailing whitespace and blank line whitespace - Replace unittest assertions with regular assert statements - Fix unused variable issues - Rename unused loop variables to _variable - Add missing newlines at end of files - All ruff checks now pass while maintaining functionality
1b909d7 to
b241790
Compare
|
Hi @MaximSmolskiy , could you please look to this issue and the PR i've raised. Thanks :) |
|
Hi , please review this PR and suggest me changes. Thanks :) |
|
How is this different than maths/pollard_rho.py? Different? More readable? Faster? |
| base : int | ||
| The generator (base of the exponential). | ||
| target : int | ||
| The target value (target ≡ base^x mod modulus). | ||
| modulus : int |
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.
Please do not repeat the datatypes (int) from above, because if one is changed and the other is not, then readers become confused
Describe your change:
Checklist: