| Store | Cart

Re: about "Switch default hash to SIPHASH on 64 bit builds andONE_AT_A_TIME on 32 bit builds"

From: bulk88 <bul...@hotmail.com>
Wed, 5 Dec 2012 10:52:35 -0500
demerphq wrote:
> On 5 December 2012 02:28, bulk88 <bul...@hotmail.com> wrote:>> http://perl5.git.perl.org/perl.git/commit/3db6cbfca39da94d152d3e860e2aa79b9c6bb161>> why? what are the disadvantages?> > Murmurhash has been broken. It is too easy to attack. We cant use it> as the default hash for perl.> > SipHash is secure and relatively fast. One-at-a-time we believe is> relatively secure at least with the modification I made to it earlier> this year.> > SipHash relies on 64 bit types, so cannot build on a 32 bit computer.> > Thus I made the default be SipHash for 64 bit builds and 32 bit builds> will continue to use One-at-a-time.> >> What is the difference between a 64 build>> and a 32 bit build? What about compilers/platforms that have compiler>> emulated 64 bit integers, like 32 bit x86?> > If someone can figure out how to build SipHash in this situations it> would be nice.> > Cheers,> Yves> 

Perl can be built with emulated 64 bit ints ( USE_64_BIT_INT, I know 
Cygwin Perls by default have 64 bit IVs on 32 bit x86). These emulated 
64 bit ints are slower than 32 bit ints since the compiler emulates them 
with function calls. For an actual example, here is the code a Win32 
compiler uses to emulate a 64 bit int multiply 
http://www.jbox.dk/sanos/source/lib/llmul.asm.html . Maybe you should 
use a combination of pointer size (which is always native to the CPU), 
and U64 to select the correct hash algorithm, if the pointer is 32 bits, 
then the hash algo should be the 32 bit one. But, what about non-x86 
CPUs that might have native 64 bit ints but 32 bit memory?

I think I saw some benchmarks on the different hash algorithms a month 
or 2 ago on the ML someone posted but I can't find the post.

Recent Messages in this Thread
bulk88 Dec 05, 2012 01:28 am
Craig A. Berry Dec 05, 2012 01:30 pm
demerphq Dec 05, 2012 09:50 pm
bulk88 Dec 05, 2012 10:57 pm
Craig A. Berry Dec 06, 2012 04:50 am
bulk88 Dec 07, 2012 12:40 am
demerphq Dec 06, 2012 07:35 am
bulk88 Dec 07, 2012 12:20 am
bulk88 Dec 07, 2012 01:00 am
bulk88 Dec 07, 2012 03:35 am
bulk88 Dec 05, 2012 11:00 pm
bulk88 Dec 05, 2012 03:52 pm
H.Merijn Brand Dec 05, 2012 03:58 pm
Brad Gilbert Dec 09, 2012 04:49 pm
Messages in this thread