github tweak to RSA exception test
@@ -41,6 +41,11 @@ public RSAKeyParameters(
private BigInteger validate(BigInteger modulus)
{
+ if ((modulus.intValue() & 1) == 0)
+ {
+ throw new IllegalArgumentException("RSA modulus is even");
+ }
+
// If you need to set this you need to have a serious word to whoever is generating
// your keys.
if (Properties.isOverrideSet("org.bouncycastle.rsa.allow_unsafe_mod"))
@@ -48,11 +53,6 @@ private BigInteger validate(BigInteger modulus)
return modulus;
}
- if ((modulus.intValue() & 1) == 0)
- {
- throw new IllegalArgumentException("RSA modulus is even");
- }
-
if (!modulus.gcd(SMALL_PRIMES_PRODUCT).equals(ONE))
{
throw new IllegalArgumentException("RSA modulus has a small prime factor");
