#include #include #include typedef unsigned char uc; typedef unsigned int ui; typedef unsigned long int L; static const uc irp = 27; static uc fmul(char a, ui b){uc sm=0; while(b) {if(b&1) sm ^= a; a = (a<<1)^((a>>7)&irp); b>>=1;} return sm;} typedef L ft(L); extern ft * T[256]; int main(){int gc = 0; for(int j=0; j<256; ++j) for(int k=0; k<256; k += 8) {L a = 0, b=0; for(int n=0; n<8; ++n) {a = (a<<8)|(k+n); b = (b<<8)|fmul(j, k+n);} {L c = (*T[j])(a); ++gc; if(c^b) exit(printf("%02x %02x\n%016lx\n%016lx\n", j, k, b, c));}} printf("%d Good\n", gc); return 0;} // 8192 Good