Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

Conversation

@adamantike
Copy link
Contributor

rsa.randnum.randint(m) generates a random number 1 <= x <= m, so randint(n - 4) + 2 returned a value in range [3, n-2] instead of [2, n-2].

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 90.201% when pulling cee82f8 on adamantike:miller-rabin-trivial into e5839ee on sybrenstuvel:master.

rsa/prime.py Outdated

x = pow(a, d, n)
if x == 1 or x == n - 1:
if x in {1, n - 1}:
Copy link
Owner

Choose a reason for hiding this comment

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

Please don't mix code style changes with actual bugfixes. Constructing a set for every test is not a good idea, and might be quite a bit slower than simply having x == 1 or x == n - 1.

@adamantike adamantike changed the title Trivial fixes on primality testing Trivial fix on primality testing Mar 29, 2016
@adamantike
Copy link
Contributor Author

Fixed! Travis test fails because of 9a9e08c.

@adamantike
Copy link
Contributor Author

Test fixed by taking care of + 2 changed to + 1.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.351% when pulling f65f232 on adamantike:miller-rabin-trivial into 96eaa5e on sybrenstuvel:master.

@sybrenstuvel
Copy link
Owner

sybrenstuvel commented Apr 15, 2016

Merged in f520014, thanks again.

@adamantike adamantike deleted the miller-rabin-trivial branch April 15, 2016 22:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants