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

Faster prime generation #6

Merged
merged 2 commits into from
Oct 21, 2024
Merged

Faster prime generation #6

merged 2 commits into from
Oct 21, 2024

Conversation

lumip
Copy link
Owner

@lumip lumip commented Oct 21, 2024

No description provided.

…me candidates.

Sophie Germain primes can only have a value of 5 modulo 6, which is used to improve the prime finding algorithm in MultiplicativeGroupAlgebra.CreateCryptoGroup, which previously was checking every odd number.
This reduces the number of primality tests that are performed by up to 2/3.

Also joins the previously separate test cases into a single implementation and fixes a bug in which the rng mock was
not returning the expected bytes.
@lumip lumip merged commit 762796d into master Oct 21, 2024
2 checks passed
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.

1 participant