2002-07-07 00:41:09+0200, Joakim Axelsson <[EMAIL PROTECTED]> -> > > Now to make it even more impossible to attack I added a A,B factor to it: > "res ^= A ^ B;" Same A and B as in abcd* > > static u32 hash_rt_ab(struct ct_key *key) > { > u32 res; > > PER_HASH_TIMER_1( > res = ((key->dip & 0xF0F0F0F0) >> 4) | ((key->dip & 0x0F0F0F0F) << 4); > res ^= key->sip ^ key->proto; > res ^= key->dport ^ key->sport; > res ^= 0x47441DFB ^ 0x57655A7D; > res ^= (res >> 24); > res ^= (res >> 8); > ); > > return res; > } >
I guess you all are begining to get a little tired of my mails :-). Anyhow on our little misstake what ^ really does in C (should have known better :-). I guess I seldom use xor in my c-code.) res ^= 0x47441DFB ^ 0x57655A7D is kinda of useless then. So I changed it into: res = ((key->dip & 0xF0F0F0F0) >> 4) | ((key->dip & 0x0F0F0F0F) << 4); res ^= key->sip ^ key->proto; res ^= key->dport ^ key->sport; res ^= 0x47441DFB; res ^= (res >> 24); res ^= (res >> 8); res ^= 0x57655A7D; Results: http://aaricia.hemmet.chalmers.se/~gozem/cttest-0.2/rt_ab_xor/ New cttest.c (same url as before): http://aaricia.hemmet.chalmers.se/~gozem/cttest-0.2/cttest.c -- /Joakim Axelsson A.K.A Gozem@EFnet & OPN