dchest/siphash — pull request #5 by dgryski (2014-11-09 23:16:25+00:00)
Title: Add experimental 128-bit siphash output

The changes required for 128-bit output are small, so hash128.go is a modified
copy of hash.go. I've also included an amd64 assembly core, similarly
modified from the amd64 core for the regular 64-bit siphash. Patching the
assembly core was a bit trickier.

The test cases for siphash-128 are from the reference implementation.

Benchmarks for the pure-Go vs the asm core:

benchmark old ns/op new ns/op delta
BenchmarkHash128_8 35.0 29.0 -17.14%
BenchmarkHash128_16 42.2 33.3 -21.09%
BenchmarkHash128_40 65.5 46.5 -29.01%
BenchmarkHash128_64 88.2 60.0 -31.97%
BenchmarkHash128_128 150 95.1 -36.60%
BenchmarkHash128_1K 1023 576 -43.70%
BenchmarkHash128_8K 7953 4357 -45.22%

benchmark old MB/s new MB/s speedup
BenchmarkHash128_8 228.56 275.44 1.21x
BenchmarkHash128_16 379.05 480.80 1.27x
BenchmarkHash128_40 610.29 860.14 1.41x
BenchmarkHash128_64 725.90 1066.54 1.47x
BenchmarkHash128_128 850.00 1346.35 1.58x
BenchmarkHash128_1K 1000.77 1777.15 1.78x
BenchmarkHash128_8K 1029.93 1879.78 1.83x