public int ProcessBlock(
byte[] input,
int inOff,
byte[] output,
int outOff)
{
if (WorkingKey == null)
{
throw new InvalidOperationException("AES engine not initialised");
}
if ((inOff + (32 / 2)) > input.Length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + (32 / 2)) > output.Length)
{
throw new DataLengthException("output buffer too short");
}
if (forEncryption)
{
UnPackBlock(input, inOff);
EncryptBlock(WorkingKey);
PackBlock(output, outOff);
}
else
{
UnPackBlock(input, inOff);
DecryptBlock(WorkingKey);
PackBlock(output, outOff);
}
return BLOCK_SIZE;
}