Skip to content

Added miller-rabin primality test for bignums #493

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

Merged
merged 2 commits into from
May 2, 2023

Conversation

dsmurrow
Copy link
Contributor

@dsmurrow dsmurrow commented May 1, 2023

Pull Request Template

Description

I'm planning on adding an RSA implementation in the next few days. For that I needed an efficient primality test, and since we already had one implement I figured I'd use it, but I needed it to work on BigInts. At first I tried to use generics but I ended up needing like 7 trait bounds and it still didn't work so I bit the bullet and added another implementation that explicitly operates on BigInts.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I ran bellow commands using the latest version of rust nightly.
  • I ran cargo clippy --all -- -D warnings just before my last commit and fixed any issue that was found.
  • I ran cargo fmt just before my last commit.
  • I ran cargo test just before my last commit and all tests passed.
  • I checked COUNTRIBUTING.md and my code follows its guidelines.

Please make sure that if there is a test that takes too long to run ( > 300ms), you #[ignore] that or
try to optimize your code or make the test easier to run. We have this rule because we have hundreds of
tests to run; If each one of them took 300ms, we would have to wait for a long time.

@dsmurrow dsmurrow requested review from siriak and imp2002 as code owners May 1, 2023 00:23
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit f4d73ac into TheAlgorithms:master May 2, 2023
@dsmurrow dsmurrow deleted the bigmiller branch May 3, 2023 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants