mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
NotTransform and XorTransform implementations moved to separate file.
This commit is contained in:
@@ -27,7 +27,6 @@ using GameRes.Utility;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace GameRes.Formats
|
||||
{
|
||||
@@ -391,38 +390,6 @@ namespace GameRes.Formats
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class NotTransform : ICryptoTransform
|
||||
{
|
||||
private const int BlockSize = 256;
|
||||
|
||||
public bool CanReuseTransform { get { return true; } }
|
||||
public bool CanTransformMultipleBlocks { get { return true; } }
|
||||
public int InputBlockSize { get { return BlockSize; } }
|
||||
public int OutputBlockSize { get { return BlockSize; } }
|
||||
|
||||
public int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount,
|
||||
byte[] outputBuffer, int outputOffset)
|
||||
{
|
||||
for (int i = 0; i < inputCount; ++i)
|
||||
{
|
||||
outputBuffer[outputOffset++] = (byte)~inputBuffer[inputOffset+i];
|
||||
}
|
||||
return inputCount;
|
||||
}
|
||||
|
||||
public byte[] TransformFinalBlock (byte[] inputBuffer, int inputOffset, int inputCount)
|
||||
{
|
||||
byte[] outputBuffer = new byte[inputCount];
|
||||
TransformBlock (inputBuffer, inputOffset, inputCount, outputBuffer, 0);
|
||||
return outputBuffer;
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
System.GC.SuppressFinalize (this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create stream in TGA format from the given image pixels.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user