rurban / smhasher

Hash function quality and speed tests
https://rurban.github.io/smhasher/
Other
1.85k stars 178 forks source link

PRVHASH64_64M #175

Closed avaneev closed 3 years ago

avaneev commented 3 years ago

After more research on what I've got with PRVHASH, I've come up with a "minimal" implementation, which is good for table hash use. It's the smallest high-quality 64-bit hash function with good security in existence I think (420 bytes in x86_64 clang 11, -O2). It passes SMHasher tests. Please include it to your test suite.

https://github.com/avaneev/prvhash

rurban commented 3 years ago

prvhash42m_32, right?

avaneev commented 3 years ago

prvhash42m_32, right?

Yes, this is right, thank you!

avaneev commented 3 years ago

@rurban I've added a fix when MsgLen==0, and removed if( Msg < MsgEnd - 7 ) case which reduced code size by further 15-25 bytes without much speed impact.

avaneev commented 3 years ago

Made an additional adjustment to the function - it decreased code size in GCC (which previously unrolled it anyway). But in LLVM compilation the size did increase. This change also increased "small hash" performance quite a bit.

rurban commented 3 years ago

Check #179. Ensure to update the sizes

avaneev commented 3 years ago

Updated to v3.1, function's size is now below 380 bytes.

rurban commented 3 years ago

Done, just prvhash16 will be added later eventually