#hash #sip-hash #bindings #function #portable #avx2 #faster

nightly no-std highwayhash

Bindings to AVX-2-optimized SIP-like hash functions

4 releases

Uses old Rust 2015

0.0.14 Sep 4, 2018
0.0.13 Aug 25, 2017
0.0.12 Aug 25, 2017
0.0.11 Feb 8, 2017
0.0.10 Jan 31, 2017

#1870 in Algorithms

Apache-2.0

215KB
4K SLoC

C++ 2.5K SLoC // 0.2% comments Visual Studio Project 879 SLoC Rust 335 SLoC // 0.0% comments Java 271 SLoC // 0.3% comments Visual Studio Solution 78 SLoC C 72 SLoC // 0.8% comments Shell 12 SLoC // 0.3% comments

highwayhash-rs

Rust Bindings to AVX2-optimized SIP-like hash functions. This crate offers bindings to three hash functions implemented in C++ here:

  • siphash: A portable implementation of the SIP hash function, that is about 2 times faster than the reference implementation.
  • siphash13: A faster but weaker variant of siphash.
  • highwayhash64: A new hash that mixes the inputs using AVX2 instructions. It is about 5 times faster than siphash. A preliminary cryptanalysis is given here.

For highwayhash64 there are three implementations: one using AVX2, another one using SSE4.1 and a third one that is portable by not relying on specific instruction sets. To profit from the faster implementations, make sure to enable the instruction sets at compile time using RUSTFLAGS="-C target-cpu=native" or similar.

Status

The bindings are in an early state. They currently should work on Unix, but are only tested on Linux. make and a C++ compiler are required to build the underlying C++ library. A nightly Rust compiler is required.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps