From 04c94f95d1a1c6a12f5412228a2bcdc00f5de3b2 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Fri, 20 Jan 2017 06:01:23 +0000 Subject: switch SipHash from SipHash24 to SipHash13 variant SipHash13 is secure enough to be used in hash-tables, and SipHash's author confirms that. Rust already considered switch to SipHash13: https://github.com/rust-lang/rust/issues/29754#issue-116174313 Jean-Philippe Aumasson confirmation: https://github.com/rust-lang/rust/issues/29754#issuecomment-156073946 Merged pull request: https://github.com/rust-lang/rust/pull/33940 From: Sokolov Yura aka funny_falcon Date: Thu, 8 Dec 2016 20:31:29 +0300 Signed-off-by: Urabe, Shyouhei Fixes: [Feature #13017] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'random.c') diff --git a/random.c b/random.c index 6362055dac..ddbbeedf92 100644 --- a/random.c +++ b/random.c @@ -1457,7 +1457,7 @@ random_s_rand(int argc, VALUE *argv, VALUE obj) } #define SIP_HASH_STREAMING 0 -#define sip_hash24 ruby_sip_hash24 +#define sip_hash13 ruby_sip_hash13 #if !defined _WIN32 && !defined BYTE_ORDER # ifdef WORDS_BIGENDIAN # define BYTE_ORDER BIG_ENDIAN @@ -1501,7 +1501,7 @@ rb_hash_start(st_index_t h) st_index_t rb_memhash(const void *ptr, long len) { - sip_uint64_t h = sip_hash24(seed.key.sip, ptr, len); + sip_uint64_t h = sip_hash13(seed.key.sip, ptr, len); #ifdef HAVE_UINT64_T return (st_index_t)h; #else -- cgit v1.2.3