diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2016-10-19 08:00:03 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-19 08:00:03 +0300 |
| commit | 7343291ac3d438f16453c2fbd1cec329ed2aa7ac (patch) | |
| tree | 86a6862ed17e006f5e7b2d8800936b0878e0a897 /src/test/ui/thinlto | |
| parent | 6ae80c6ac42e571b10398f35c9edd87c1f573ad9 (diff) | |
| parent | d07523c716cd384b257baca48046db1264aab7f6 (diff) | |
| download | rust-7343291ac3d438f16453c2fbd1cec329ed2aa7ac.tar.gz rust-7343291ac3d438f16453c2fbd1cec329ed2aa7ac.zip | |
Rollup merge of #37233 - michaelwoerister:blake2-for-ich, r=nikomatsakis
ICH: Use 128-bit Blake2b hash instead of 64-bit SipHash for incr. comp. fingerprints This PR makes incr. comp. hashes 128 bits wide in order to push collision probability below a threshold that we need to worry about. It also replaces SipHash, which has been mentioned multiple times as not being built for fingerprinting, with the [BLAKE2b hash function](https://blake2.net/), an improved version of the BLAKE sha-3 finalist. I was worried that using a cryptographic hash function would make ICH computation noticeably slower, but after doing some performance tests, I'm not any more. Most of the time BLAKE2b is actually faster than using two SipHashes (in order to get 128 bits): ``` SipHash libcore: 0.199 seconds libstd: 0.090 seconds BLAKE2b libcore: 0.162 seconds libstd: 0.078 seconds ``` If someone can prove that something like MetroHash128 provides a comparably low collision probability as BLAKE2, I'm happy to switch. But for now we are at least not taking a performance hit. I also suggest that we throw out the sha-256 implementation in the compiler and replace it with BLAKE2, since our sha-256 implementation is two to three times slower than the BLAKE2 implementation in this PR (cc @alexcrichton @eddyb @brson) r? @nikomatsakis (although there's not much incr. comp. specific in here, so feel free to re-assign)
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions
