Skip to content

Commit ec381a1

Browse files
committed
github bcgit#499 tweak to RSA exception test
1 parent 29bcca1 commit ec381a1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/src/main/java/org/bouncycastle/crypto/params/RSAKeyParameters.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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");

0 commit comments

Comments
 (0)