public int processBlock(byte[] in, int inOff, byte[] out, int outOff)
throws DataLengthException, IllegalStateException
{
if (roundKeys == null)
{
throw new IllegalStateException("ARIA engine not initialised");
}
if (inOff > (in.length - BLOCK_SIZE))
{
throw new DataLengthException("input buffer too short");
}
if (outOff > (out.length - BLOCK_SIZE))
{
throw new OutputLengthException("output buffer too short");
}
byte[] z = new byte[BLOCK_SIZE];
System.arraycopy(in, inOff, z, 0, BLOCK_SIZE);
int i = 0, rounds = roundKeys.length - 3;
while (i < rounds)
{
FO(z, roundKeys[i++]);
FE(z, roundKeys[i++]);
}
FO(z, roundKeys[i++]);
xor(z, roundKeys[i++]);
SL2(z);
xor(z, roundKeys[i]);
System.arraycopy(z, 0, out, outOff, BLOCK_SIZE);
return BLOCK_SIZE;
}