/* * Measure whether all values appear with equal frequency */ #include #include #include #include typedef unsigned char u1; typedef unsigned long u4; typedef unsigned long long u8; #define BUCKETS (1<<8) typedef struct ranctx { u4 a; u4 b; u4 c; u4 d;} ranctx; #define rot(x,k) ((x<>(32-k))) static u4 iii = 0; static u4 ranval( ranctx *x ) { u4 e = x->a - rot(x->b, 27); x->a = x->b ^ rot(x->c, 17); x->b = x->c + x->d; x->c = x->d + e; x->d = e + x->a; return x->d; } static void raninit( ranctx *x, u4 seed ) { u4 i; x->a = 0xf1ea5eed; x->b = x->c = x->d = seed; for (i=0; i<20; ++i) { (void)ranval(x); } } /* initialize the data collection array */ static void datainit( u8 *data) { u4 i; for (i=0; i