Skip to content
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

Why do the miller_rabin_test() at all? #2

Closed
tavianator opened this issue May 19, 2017 · 5 comments
Closed

Why do the miller_rabin_test() at all? #2

tavianator opened this issue May 19, 2017 · 5 comments

Comments

@tavianator
Copy link

It should be sufficient, and much faster, to just check if (P > 1 && N % P == 0) right?

@leonklingele
Copy link

leonklingele commented May 20, 2017

👍 but you need to check for P != N as well.

@leonklingele
Copy link

Throwing out normalizedEntropy will then make it even faster.

@aguinet
Copy link
Owner

aguinet commented May 20, 2017

That's stuff that are there because I was checking this step by step. I haven't done yet an optimization pass phase, so you might be right, but real-life benchmarks will tell! (need to do them!)

@tavianator
Copy link
Author

@leonklingele

but you need to check for P != N as well.

In general yeah. But if P is always 1024 bits and N is always 2048 bits then you don't need to :)

@aguinet
Copy link
Owner

aguinet commented May 31, 2017

So I did some benchmark and you're right, the miller rabin test was really slowing down the whole thing. Fixed code and benchmarking code has just been pushed!

@aguinet aguinet closed this as completed May 31, 2017
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

No branches or pull requests

3 participants