/* Compile and link this file with tiger.c (it calls tiger_compress) */ #include typedef unsigned long long int word64; #ifdef __alpha typedef unsigned int word32; #else typedef unsigned long word32; #endif typedef unsigned char byte; typedef unsigned char octet[8]; word32 table[4*256][2]; static octet *table_ch = (octet*) table; main() { gen("Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham", 5); print_table(); } /* Big endian: */ #if !(defined(__alpha)||defined(__i386__)||defined(__vax__)) #define BIG_ENDIAN #endif gen(word32 str[16], int passes) { word64 state[3]; octet *state_ch = (octet*) state; byte tempstr[64]; int i; int j; int cnt; int sb; int col; int abc; state[0]=0x0123456789ABCDEFLL; state[1]=0xFEDCBA9876543210LL; state[2]=0xF096A5B4C3B2E187LL; #ifdef BIG_ENDIAN for(j=0; j<64; j++) tempstr[j^7] = ((byte*)str)[j]; #else for(j=0; j<64; j++) tempstr[j] = ((byte*)str)[j]; #endif for(i=0; i<1024; i++) for(col=0; col<8; col++) table_ch[i][col] = i&255; abc=2; for(cnt=0; cnt