shake-128 in 32-bits platform I am implementing shake in 32-bits microcontroller, so I would like to use bit interleaving.
I checked the code in: https://github.com/floodyberry/supercop/blob/master/crypto_hash/keccak/simple32bi/Keccak-simple32BI.c but I do not understand how is the bit interleaving transformation done in this code. Could anyone give an insight for understanding this.

Also, I compare the results of the function KeccakF for previous link and the 64-bit implementation (https://github.com/floodyberry/supercop/blob/master/crypto_hash/keccak/simple/Keccak-simple.c) and the result is not the same. they are supposed to be same or aren't they?

Thank you
The bit interleaving code looks like this:

{
    const UINT32 * pI = (const UINT32 *)in;
    UINT32 * pS = state;
    UINT32 t, x0, x1;
    int i;
    for (i = laneCount-1; i &gt;= 0; --i)
    {
        x0 = *(pI++);
        t = (x0 ^ (x0 &gt;&gt;  1)) &amp; 0x22222222UL;  x0 = x0 ^ t ^ (t &lt;&lt;  1);
        t = (x0 ^ (x0 &gt;&gt;  2)) &amp; 0x0C0C0C0CUL;  x0 = x0 ^ t ^ (t &lt;&lt;  2);
        t = (x0 ^ (x0 &gt;&gt;  4)) &amp; 0x00F000F0UL;  x0 = x0 ^ t ^ (t &lt;&lt;  4);
        t = (x0 ^ (x0 &gt;&gt;  8)) &amp; 0x0000FF00UL;  x0 = x0 ^ t ^ (t &lt;&lt;  8);
        x1 = *(pI++);
        t = (x1 ^ (x1 &gt;&gt;  1)) &amp; 0x22222222UL;  x1 = x1 ^ t ^ (t &lt;&lt;  1);
        t = (x1 ^ (x1 &gt;&gt;  2)) &amp; 0x0C0C0C0CUL;  x1 = x1 ^ t ^ (t &lt;&lt;  2);
        t = (x1 ^ (x1 &gt;&gt;  4)) &amp; 0x00F000F0UL;  x1 = x1 ^ t ^ (t &lt;&lt;  4);
        t = (x1 ^ (x1 &gt;&gt;  8)) &amp; 0x0000FF00UL;  x1 = x1 ^ t ^ (t &lt;&lt;  8);
        *(pS++) ^= (x0 &amp; 0x0000FFFF) | (x1 &lt;&lt; 16);
        *(pS++) ^= (x0 &gt;&gt; 16) | (x1 &amp; 0xFFFF0000);
    }
}


There is also the matching deinterleave code in the extract function.

I also wrote a Keccak/SHA3 class using that code (or something similar) as a base. For whatever reason I did not like the way that looked, and ended up writing my own, which ended up being 1.45X faster (just the interleave, not the hash) when compiled compared to my implementation of this interleave code, so there are faster ways to do it.

I also found it is easier to interleave/deinterleave the entire state during dev/testing when you absorb or extract as you can view intermediate values of the state working variables and compare to a reference implementation.