Permalink
Please
sign in to comment.
Browse files
runtime: use some startup randomness in the fallback hashes
Fold in some startup randomness to make the hash vary across different runs. This helps prevent attackers from choosing keys that all map to the same bucket. Also, reorganize the hash a bit. Move the *m1 multiply to after the xor of the current hash and the message. For hash quality it doesn't really matter, but for DDOS resistance it helps a lot (any processing done to the message before it is merged with the random seed is useless, as it is easily inverted by an attacker). Update #9365 Change-Id: Ib19968168e1bbc541d1d28be2701bb83e53f1e24 Reviewed-on: https://go-review.googlesource.com/2344 Reviewed-by: Ian Lance Taylor <iant@golang.org>
- Loading branch information...
Showing
with
75 additions
and 82 deletions.
- +12 −8 src/runtime/alg.go
- +31 −35 src/runtime/hash32.go
- +32 −39 src/runtime/hash64.go
0 comments on commit
ce5cb03