De/Encrypt in-place to enhance performance

This commit is contained in:
BtbN
2019-06-14 16:58:06 +02:00
parent 9e49e27833
commit d07e941272
4 changed files with 18 additions and 20 deletions

View File

@@ -22,13 +22,12 @@ namespace eAmuseTest
compress = compress.ToLower();
IEnumerable<byte> decryptedData = data;
if (eamuse_info != null)
decryptedData = RC4.ApplyEAmuseInfo(eamuse_info, data);
RC4.ApplyEAmuseInfo(eamuse_info, data);
var rawData = decryptedData;
byte[] rawData = data;
if (compress == "lz77")
rawData = LZ77.Decompress(decryptedData);
rawData = LZ77.Decompress(data).ToArray();
else if (compress != "none")
throw new ArgumentException("Unsupported compression algorithm");