From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q19DC54A016520 for ; Thu, 9 Feb 2012 14:12:05 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnMDAMjEM0/ZSMDjjmdsb2JhbABDryQiAQEBAQkLCQkSBSSBcgEBBAE6PwULCw4TJQ8BBCghE4d8AwazL4tKCCYFBQULAgQHAgcHCwQBCwEUBgQFA4NfhB0EmneNHA X-IronPort-AV: E=Sophos;i="4.73,390,1325458800"; d="scan'208";a="143558976" Received: from fmmailgate02.web.de ([217.72.192.227]) by mail1-smtp-roc.national.inria.fr with ESMTP; 09 Feb 2012 14:11:59 +0100 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate02.web.de (Postfix) with ESMTP id 8CF741C0BC50E for ; Thu, 9 Feb 2012 14:11:59 +0100 (CET) Received: from frosties.localnet ([95.208.118.96]) by smtp.web.de (mrweb001) with ESMTPA (Nemesis) id 0MKJAE-1Rw1UG22T8-001mqr; Thu, 09 Feb 2012 14:11:59 +0100 Received: from mrvn by frosties.localnet with local (Exim 4.77) (envelope-from ) id 1RvTn3-0008GT-U8; Thu, 09 Feb 2012 14:11:58 +0100 From: Goswin von Brederlow To: "Gerd Stolpmann" Cc: "Goswin von Brederlow" , caml-list@inria.fr References: <1325263446.5036.104.camel@samsung> <87zkd531kl.fsf@frosties.localnet> <403c4e4bb2cfce801aad217c80365879.squirrel@gps.dynxs.de> <8739alfys0.fsf@frosties.localnet> <94bcc9a89c5835c1436752b9e59410ad.squirrel@gps.dynxs.de> Date: Thu, 09 Feb 2012 14:11:57 +0100 In-Reply-To: <94bcc9a89c5835c1436752b9e59410ad.squirrel@gps.dynxs.de> (Gerd Stolpmann's message of "Wed, 8 Feb 2012 12:12:08 +0100") Message-ID: <87haz0qhgi.fsf@frosties.localnet> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Provags-ID: V02:K0:Lnr+wcVC8XNQgUlHp04KTkr9jMB7VuC5C7D9BoK0q95 tmgN9RfIuKIhgZlpnutkHoDkmNwCTmxmWeIfhK1ghoLr9nERYc ch0TevMPHPHenb5CpoGeqL24FSm6r3HZIJyTUkkw1NE8uG9MbU mGgBtHWNSUZRrp7yrHiDNxpyETXwUU5+NasubOavkmzq2zWBCH OtTPRmqkgcMYGc0kcQ4SA== Subject: Re: [Caml-list] Hashtbl and security "Gerd Stolpmann" writes: > Well, looks like that the upper 32 bits aren't considered at all for > computing the hash value. This is for sure surprising - I would have > expected that these bits somehow go in to the final value (e.g. that they > are xor-ed with the lower half). > > My guess is that this was done to ensure that an int-to-something > hashtable can be marshalled from 64 to 32 bit systems. Not sure for what > this is important, but it looks like a nice symmetry. Marshaling hashtables of ints might be an argument. BUT: # Hashtbl.hash (1 lsr 40);; - : int = 0 # Hashtbl.hash (Int64.of_int (1 lsr 40));; - : int = 0 # Hashtbl.hash (Int64.of_int (1 lsr 40 + 1));; - : int = 1 > In trunk the method for ensuring this seems to have changed (see function > caml_hash_mix_intnat in > http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/trunk/byterun/hash.c?revision=12072&view=markup). > > Gerd Lets hope that fixes this. MfG Goswin