-static
-uint32_t g_function(uint32_t x){
- uint32_t z;
- /* sbox substitution */
- X3 = pgm_read_byte(&(seed_sbox2[X3]));
- X2 = pgm_read_byte(&(seed_sbox1[X2]));
- X1 = pgm_read_byte(&(seed_sbox2[X1]));
- X0 = pgm_read_byte(&(seed_sbox1[X0]));
- /* now the permutation */
- Z0 = (X0 & M0) ^ (X1 & M1) ^ (X2 & M2) ^ (X3 & M3);
- Z1 = (X0 & M1) ^ (X1 & M2) ^ (X2 & M3) ^ (X3 & M0);
- Z2 = (X0 & M2) ^ (X1 & M3) ^ (X2 & M0) ^ (X3 & M1);
- Z3 = (X0 & M3) ^ (X1 & M0) ^ (X2 & M1) ^ (X3 & M2);
- return z;
-}
-#endif