internal DESTransform (SymmetricAlgorithm symmAlgo, bool encryption, byte[] key, byte[] iv)
: base (symmAlgo, encryption, iv)
{
byte[] clonedKey = null;
#if NET_2_0
if (key == null) {
key = GetStrongKey ();
clonedKey = key; // no need to clone
}
#endif
// note: checking (semi-)weak keys also checks valid key length
if (DES.IsWeakKey (key) || DES.IsSemiWeakKey (key)) {
string msg = Locale.GetText ("This is a known weak, or semi-weak, key.");
throw new CryptographicException (msg);
}
if (clonedKey == null)
clonedKey = (byte[]) key.Clone ();
keySchedule = new byte [KEY_BYTE_SIZE * 16];
byteBuff = new byte [BLOCK_BYTE_SIZE];
dwordBuff = new uint [BLOCK_BYTE_SIZE / 4];
SetKey (clonedKey);
}