public static bool IsWeakKey(byte[] rgbKey)
{
if (rgbKey == null)
throw new CryptographicException(SR.Cryptography_InvalidKeySize); // Desktop compat: Strange exception for a null value, but this is what we threw in classic CLR.
if (!(rgbKey.Length*8).IsLegalSize(s_legalKeySizes))
throw new CryptographicException(SR.Cryptography_InvalidKeySize);
byte[] rgbOddParityKey = rgbKey.FixupKeyParity();
if (EqualBytes(rgbOddParityKey, 0, 8, 8))
return true;
if ((rgbOddParityKey.Length == 24) && EqualBytes(rgbOddParityKey, 8, 16, 8))
return true;
return false;
}