From f7b23c3f83641bd96dbef93cc2a758b64035f2d1 Mon Sep 17 00:00:00 2001 From: jonnysp Date: Sat, 22 Sep 2018 08:42:00 +0200 Subject: [PATCH] correction ECB CBC --- LibHac/Crypto.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LibHac/Crypto.cs b/LibHac/Crypto.cs index 3fc623c7..115ae84e 100644 --- a/LibHac/Crypto.cs +++ b/LibHac/Crypto.cs @@ -30,7 +30,7 @@ namespace LibHac aes.Key = key; aes.Mode = CipherMode.ECB; 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.Mode = CipherMode.CBC; 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.Mode = CipherMode.CBC; 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); } }