Re: Question about tcp hash function tcp_hashfn()



On Fri, Jun 02, 2006 at 07:40:38AM +0200, Florian Weimer (fw@xxxxxxxxxxxxx) wrote:
* Evgeniy Polyakov:

That is wrong. And I have a code and picture to show that,
and you dont - prove me wrong :)

Here we go:

static inline num2ip(__u8 a1, __u8 a2, __u8 a3, __u8 a4)
{
__u32 a = 0;

a |= a1;
a << 8;
a |= a2;
a << 8;
a |= a3;
a << 8;
a |= a4;

return a;
}

"gcc -Wall" was pretty illuminating. 8-P After fixing this and
switching to a better PRNG, I get something which looks pretty normal.

:) thats true, but to be 100% honest I used different code to test for
hash artifacts...
That code was created to show that it is possible to _have_ artifacts,
but not specially to _find_ them.

But it still does not fix artifacts with for example const IP and random
ports or const IP and linear port selection.

Values must be specially tuned to be used with Jenkins hash, for example
linear port with const IP produce following hash buckets:
100 24397
200 12112
300 3952
400 975
500 178
600 40
700 3
800 1

i.e. one 800-entries bucket (!) while xor one always have only 100 of
them (for 100*hash_size number of iterations).

So, your prove does not valid :)

--
Evgeniy Polyakov
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Making Datatypes Constant and Emulating Const Correctness
    ... Being relatively new to Perl with Java and bits of C under my belt, ... I'm new to C+++, too, but remember a number of uses for the const keyword ... an array to some analizer function as a constant strongly signals that no ... some reference (e,g. a blessed hash reference) ...
    (comp.lang.perl.misc)
  • Re: CMap and struct
    ... So make it const. ... The HashKey function inside CMap cannot produce any hash value from ... SDataType objects; SDataType objects should be able to turn into integer ...
    (microsoft.public.vc.mfc)
  • Re: Hash value not correct in CryptVerifyDetachedMessageSignature
    ... > to verify it with Hash calculated using OpenSSL. ... const BYTE* pbDetachedSignBlob, ... DWORD cbDetachedSignBlob, ...
    (microsoft.public.platformsdk.security)
  • reversing a hash function
    ... I have this hash function: ... const b: longword; ... These two hash functions are the same and will always produce a value ...
    (sci.crypt)