correction ECB CBC

This commit is contained in:
jonnysp 2018-09-22 08:42:00 +02:00
parent ab8dda98b4
commit f7b23c3f83

View file

@ -30,7 +30,7 @@ namespace LibHac
aes.Key = key; aes.Key = key;
aes.Mode = CipherMode.ECB; aes.Mode = CipherMode.ECB;
aes.Padding = PaddingMode.None; aes.Padding = PaddingMode.None;
Array.Copy(aes.CreateDecryptor().TransformFinalBlock(src, srcIndex, src.Length), srcIndex, dest, destIndex, length); Array.Copy(aes.CreateDecryptor().TransformFinalBlock(src, srcIndex, length), 0, dest, destIndex, length);
} }
} }
@ -46,7 +46,7 @@ namespace LibHac
aes.IV = iv; aes.IV = iv;
aes.Mode = CipherMode.CBC; aes.Mode = CipherMode.CBC;
aes.Padding = PaddingMode.None; aes.Padding = PaddingMode.None;
Array.Copy(aes.CreateDecryptor().TransformFinalBlock(src, srcIndex, src.Length), srcIndex, dest, destIndex, length); Array.Copy(aes.CreateDecryptor().TransformFinalBlock(src, srcIndex, length), 0, dest, destIndex, length);
} }
} }
@ -62,7 +62,7 @@ namespace LibHac
aes.IV = iv; aes.IV = iv;
aes.Mode = CipherMode.CBC; aes.Mode = CipherMode.CBC;
aes.Padding = PaddingMode.None; aes.Padding = PaddingMode.None;
Array.Copy(aes.CreateEncryptor().TransformFinalBlock(src, srcIndex, src.Length), srcIndex, dest, destIndex, length); Array.Copy(aes.CreateEncryptor().TransformFinalBlock(src, srcIndex, length), 0, dest, destIndex, length);
} }
} }