bc-java
bc-java copied to clipboard
Safe Prime generation
I've found that generating a safe prime using Java Bouncy Castle is slower than using OpenSSL. It looks like the Java version is using Sophie Germain as the prime generator while the C version is using a sieve method. Would it be possible to convert the C version into a Java version to reduce the safe prime generation time? Thank you for your consideration.
References: BC Safe Prime - https://github.com/bcgit/bc-java/blob/master/core/src/main/java/org/bouncycastle/crypto/generators/DHParametersHelper.java OpenSSL Safe Prime - https://github.com/openssl/openssl/blob/OpenSSL_1_1_1-stable/crypto/bn/bn_prime.c