In perl.git, the branch yves/rand_hash_seed has been created
<http://perl5.git.perl.org/perl.git/commitdiff/cf93fea4e565bed9732f279...>
at cf93fea4e565bed9732f279ed71ea2258c91c8aa (commit)
- Log -----------------------------------------------------------------
commit cf93fea4e565bed9732f279ed71ea2258c91c8aa
Author: Yves Orton <demer...@gmail.com>
Date: Sun Nov 4 12:59:25 2012 +0100
randomize order in buckets with collisions (do not merge)
M hv.c
commit 2c56c7d170f222dd303700ff30c0b08c358af6c1
Author: Yves Orton <demer...@gmail.com>
Date: Sat Nov 3 18:48:32 2012 +0100
switch to using global PL_hash_seed (via perlvars.h)
This means that we dont have to copy them on thread start.
M dist/threads-shared/shared.xs
M embed.fnc
M embed.h
M embedvar.h
M hv.h
M intrpvar.h
M perl.c
M perlapi.h
M perlvars.h
M proto.h
M sv.c
M universal.c
M util.c
commit a2739197fcedbc4f0ddbce3daa70e165f170466f
Author: Yves Orton <demer...@gmail.com>
Date: Sat Nov 3 18:47:43 2012 +0100
improve stats logic
M ext/Hash-Util/Util.xs
M ext/Hash-Util/lib/Hash/Util.pm
commit ea7697226aaec258f697bfe30e879f1016636810
Author: Yves Orton <demer...@gmail.com>
Date: Sat Nov 3 18:46:32 2012 +0100
add siphash
M hv.h
commit 0a5780eb1f801622a013def904b53f5ab6a7a922
Author: Yves Orton <demer...@gmail.com>
Date: Wed Oct 31 22:36:06 2012 +0100
hash seed var cleanup
M embedvar.h
M hv.h
M intrpvar.h
commit 79256260ead7483b88ef5e721f20232b3087720c
Author: Yves Orton <demer...@gmail.com>
Date: Mon Oct 29 10:18:24 2012 +0100
make regcharclass.pl use determinisitic hash ordering
M regcharclass.h
M regen/regcharclass.pl
commit 2973431d764e260a803358e18d4ceeed7667a3f8
Author: Yves Orton <demer...@gmail.com>
Date: Mon Oct 29 08:46:38 2012 +0100
move utility subs to Hash::Util as an experiment
M ext/Hash-Util/Util.xs
commit 0782a4fd5765e58c61149dccb96900d2f4b46752
Author: Yves Orton <demer...@gmail.com>
Date: Fri Oct 26 11:40:37 2012 +0200
Adds some hash related introspection routines to the hash:: namespace
hash::seed() - returns the current seed
hash::function_name() - returns the hash function
hash::value($string) - returns the hash value of a string
hash::bucket_info() - returns statistics about bucket utilization
of a hash. The first three arguements are keys in hash, buckets in
hash and used buckets in hash. If the hash actually has a hash array
allocated (they are lazily allocated on first update to facilitate
presetting the array size) the a list of counts of bucket lengths
follows, with the 0th count being of 0 empty buckets, 1st count
being the number of buckets with 1 key in it, etc. Only works on
non-magical (untied) hashes.
hash::bucket_array() - returns an arrayref which represents the
buckets of a hash. Each element is either an array ref containing
a list of keys in the bucket, or an integer represent K empty
buckets. Only works on non-magical (untied) hashes.
Currently these routines are undocumented and untested.
M ext/Hash-Util/lib/Hash/Util.pm
M universal.c
commit 4967a947955d8c478750bc803f07f48fd8a371f9
Author: Yves Orton <demer...@gmail.com>
Date: Tue Oct 23 12:16:02 2012 +0200
Make perl support a variety of new hash algorithms
This patch adds several new hash algorithms which can be used
as perls hash function.
They are as follows:
Murmur Hash: (v3) from google, see i
From http://code.google.com/p/smhasher/wiki/MurmurHash3
Superfast Hash: From Paul Hsieh.
From http://www.azillionmonkeys.com/qed/hash.html
DJB2: a hash function from Daniel Bernstein
From http://www.cse.yorku.ca/~oz/hash.html
SDBM: a hash function sdbm.
Also from http://www.cse.yorku.ca/~oz/hash.html
They have all be converted into Perl's ugly macro format. I have not
done any proper testing to make sure this conversion is correct.
All of them use the random hash seed.
You can enable a given function by defining one of
PERL_HASH_FUNC_MURMUR
PERL_HASH_FUNC_SUPERFAST
PERL_HASH_FUNC_DJB2
PERL_HASH_FUNC_SDBM
If none are defined then the build will use the old hash which is
Bob Jenkin's "one at a time" hash.
A new define PERL_HASH_FUNC is provided which expands to a string
containing the name of the chosen hash implementation.
Setting PERL_HASH_SEED_DEBUG to 1 will make perl output the current
seed (changed to hex) and the hash function it has been built with.
M hv.h
M perl.c
commit eab8e4cb9b2580347add9f4f181433dabe2f6d89
Author: Yves Orton <demer...@gmail.com>
Date: Mon Aug 27 08:54:50 2012 +0200
fix a hash key order dependency in cpan/autodie/t/hints_pod_examples.t
At the same time make part of the internals deterministic Just In Case.
Version bump on autodie to 2.13 as well.
M cpan/autodie/lib/Fatal.pm
M cpan/autodie/lib/autodie.pm
M cpan/autodie/lib/autodie/exception.pm
M cpan/autodie/lib/autodie/exception/system.pm
M cpan/autodie/lib/autodie/hints.pm
M cpan/autodie/t/hints_pod_examples.t
commit 0e6ed49757607859c512819d5779fff6be782969
Author: Yves Orton <demer...@gmail.com>
Date: Mon Aug 27 08:57:19 2012 +0200
fix hash key ordering dependencies in cpan/CGI/.. tests
Hash seed randomization makes various tests fail as they depend
on a particular hash key ordering.
Note this is not a patch that has been pushed upstream.
M cpan/CGI/Changes
M cpan/CGI/lib/CGI.pm
M cpan/CGI/lib/CGI/Util.pm
M cpan/CGI/t/autoescape.t
M cpan/CGI/t/function.t
M cpan/CGI/t/html.t
commit be81b23e5043b0dc3dae4363ce15e5655aad8301
Author: Yves Orton <demer...@gmail.com>
Date: Mon Aug 27 08:55:32 2012 +0200
fix hash key order dependency from cpan/Module-Pluggable/t/23depth.t
Hash seed randomization causes the order to change per process.
I have bumped Module-Pluggable's version here.
M cpan/Module-Pluggable/lib/Module/Pluggable.pm
M cpan/Module-Pluggable/t/23depth.t
commit d3bbbf1ce87e6a2c95d9f3307d77b821e52a573f
Author: Yves Orton <demer...@gmail.com>
Date: Sat Oct 20 21:06:56 2012 +0200
rip out HvREHASH logic and replace it with random hash seed per process
The general idea of the HvREHASH() logic is to avoid hashing attacks by
noticing degenerate hash patterns and triggering the use of a random
seed.
However the attack is avoided if the attacker cannot predict the hash
ordering of the perl process they are talking to. By randomizing the
hash seed at perl process startup we make the ordering unpredictable
and remove the need for the HvREHASH logic and all of its overhead.
M MANIFEST
M dist/threads-shared/lib/threads/shared.pm
M dist/threads-shared/shared.xs
M dist/threads-shared/t/blessed.t
M dump.c
M embedvar.h
D ext/Hash-Util-FieldHash/t/10_hash.t
M ext/Hash-Util/lib/Hash/Util.pm
M hv.c
M hv.h
M intrpvar.h
M perl.c
M sv.c
M sv.h
M t/lib/universal.t
M t/op/hash.t
M universal.c
M util.c
-----------------------------------------------------------------------
--
Perl5 Master Repository