public override int EncryptBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
{
if (inputBuffer == null)
throw new ArgumentNullException("inputBuffer");
if (outputBuffer == null)
throw new ArgumentNullException("outputBuffer");
if ((inputOffset + (32 / 2)) > inputBuffer.Length)
{
throw new IndexOutOfRangeException("input buffer too short");
}
if ((outputOffset + (32 / 2)) > outputBuffer.Length)
{
throw new IndexOutOfRangeException("output buffer too short");
}
if (_encryptionKey == null)
{
_encryptionKey = GenerateWorkingKey(true, Key);
}
UnPackBlock(inputBuffer, inputOffset);
EncryptBlock(_encryptionKey);
PackBlock(outputBuffer, outputOffset);
return BlockSize;
}