> From: Patrick Schaaf <[EMAIL PROTECTED]> > static u32 hash_abcd_host(struct ct_key *key) > { > u32 res; > PER_HASH_TIMER_1( > res = 0x47441DFB * ntohl(key->sip) > + 0x57655A7D * ntohl(key->dip) > + 0x1C7F1D2D * ntohs(key->sport) > + 0xDF91D738 * ntohs(key->dport) > + key->proto; > ); > return res; > } > > Slightly surprising, this code runs about half as fast as the normal abcd, > on my little endian box.
I guess that shows that the ntohl/s's take about as much time as the rest. > Now there is http://bei.bof.de/cttest-0.5.tar.gz and an example > presentation at http://bei.bof.de/ex4/ (Is this getting out of hand?) > BTW, it should be possible to gather reports generated by different > people ... I suggest that you collect up their original data sets so other people can experiment with those. And finally, here's the current version of A-F which I am determined to make my LAST version. This is the result of a little more communication with my friendly crypto expert. /* for 32866 entries table size: length of longest bucket 256:158 512:89 1K:49 2K:30 4K:21 8K:13 16K:10 32K:8 64K:6 256K:4 */ unsigned long long ls, ld, lp; long sum; ls = (unsigned long long) key->sip * A; ld = (unsigned long long) key->dip * B; lp = (unsigned long long) C * (u32)((u32)(key->sport << 16) + key->dport); sum = (ls ^ (ls >> 32) + ld ^ (ld >> 32) + lp ^ (lp >> 32) + E * key->proto) ^ F; return sum; > As nobody requested the tarball yet, I've remade it with the latest > 64 bit ABCDEF code from Don. I also remade the ex4/ pictures, > in the abcd series, Don's new hash is named abcd_long. Looks good, > takes about 2.2 times as long as abcd. (Darn. So 64 bit does take a lot longer.) > I call it a night now. Take care. Me too.