Was wondering if you could help create a function to check reverse this function? It basically creates a 6 byte array, and uses an algorithm to set the values to match a pattern. I just need a function to check if a 6 byte, byte array matches a possible outcome of this function?

C#
   static public void calculate(ref byte[] aad, int op)
Code
        {
Code
            for (int j = 0; j < 6; j++)
Code
            {
Code
                Random Rand = new Random();
Code
                aad[j] = (byte)Rand.Next(0, 255);
Code
                int n;
Code
                int i;
Code
                int ofs;
Code
                byte d;
Code
Code
                aad[3 + op] = (byte)(aad[1 + op] ^ aad[2 + op] ^ aad[4 + op]);
Code
                aad[0 + op] = (byte)((aad[4 + op] ^ aad[1 + op]) + aad[2 + op]);
Code
                aad[5 + op] = 0;
Code
                d = (byte)0xd5;
Code
Code
                for (n = 0, ofs = 2; n < 17; n++, ofs += 6)
Code
                {
Code
                    for (i = -2; i <= 3; i++)
Code
                    {
Code
                        d = aad[op + ((ofs + i) % 6)] = (byte)(((ofs + i) % 5 != 0) ? aad[op + ((ofs + i) % 6)] + d : aad[op + ((ofs + i) % 6)] ^ d);
Code
                    }
Code
                }
Code
            }
Code
        }
Code