File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
core/src/main/java/org/bouncycastle/crypto/params Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,18 @@ public RSAKeyParameters(
4141
4242 private BigInteger validate (BigInteger modulus )
4343 {
44+ if ((modulus .intValue () & 1 ) == 0 )
45+ {
46+ throw new IllegalArgumentException ("RSA modulus is even" );
47+ }
48+
4449 // If you need to set this you need to have a serious word to whoever is generating
4550 // your keys.
4651 if (Properties .isOverrideSet ("org.bouncycastle.rsa.allow_unsafe_mod" ))
4752 {
4853 return modulus ;
4954 }
5055
51- if ((modulus .intValue () & 1 ) == 0 )
52- {
53- throw new IllegalArgumentException ("RSA modulus is even" );
54- }
55-
5656 if (!modulus .gcd (SMALL_PRIMES_PRODUCT ).equals (ONE ))
5757 {
5858 throw new IllegalArgumentException ("RSA modulus has a small prime factor" );
You can’t perform that action at this time.
0 commit comments