private static void Decrypt(byte[] target, int targetOffset, byte[] source, int sourceOffset, int length, ref DecryptContext ctx) { int si = sourceOffset; int ti = targetOffset; for (int i = 0; i < length; i++, si++, ti++) { var p = (byte)(source[si] ^ ctx.Key); ctx.Hash ^= p << ((ctx.Index % 4) * 8); target[ti] = p; ctx.Index += 1; } } }