bc-java icon indicating copy to clipboard operation
bc-java copied to clipboard

Safe Prime generation

Open Colbix opened this issue 4 years ago • 0 comments

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

Colbix avatar Jun 18 '21 19:06 Colbix