4 * email: daniel.otte@rub.de
7 * this program generate a lookuptable for the h-function in grain
13 #define X(i) ((x)>>((i)))
18 (X(0)&X(3)) ^ (X(2)&X(3)) ^ (X(3)&X(4)) ^
19 (X(0)&X(1)&X(2)) ^ (X(0)&X(2)&X(3)) ^ (X(0)&X(2)&X(4)) ^
20 (X(1)&X(2)&X(4)) ^ (X(2)&X(3)&X(4)) ;
30 " * author: Daniel Otte \n"
31 " * email: daniel.otte@rub.de \n"
32 " * license: GPLv3 \n"
34 " * this program generate a lookuptable for the h-function in grain \n"
38 " * x0 x1 x2 x3 x4 - h");
40 for(i=0; i<0x20; ++i){
41 printf(" * %c %c %c %c %c - %c\n",
49 lut |= h(i)?0x80000000:0x00000000;
55 printf(" uint8_t lut[4]= {0x%2.2X, 0x%2.2X, 0x%2.2X, 0x%2.2X} \n",
56 lut&0xFF, (lut>>8)&0xFF, (lut>>16)&0xFF, (lut>>24)&0xFF);