1
0
mirror of https://github.com/henrydcase/nobs.git synced 2024-11-26 17:11:22 +00:00
nobs/hash/sha3
Henry Case 49bf0db8fd SHAKE: Don't use function pointers (#20)
* xorIn and copyOut function pointers cause input and output data
  to be moved to heap. This degrades performance of calling code.

* This change removes usage of those function pointers. We will always
  use unaligned implementation as it's faster (but may crash on some
  systems)

* Benchmark compares generic vs unaligned xorIn and copyOut

benchmark                          old ns/op     new ns/op     delta
BenchmarkPermutationFunction-4     463           815           +76.03%
BenchmarkShake128_MTU-4            4443          8180          +84.11%
BenchmarkShake256_MTU-4            4739          9060          +91.18%
BenchmarkShake256_16x-4            71886         132629        +84.50%
BenchmarkShake256_1MiB-4           3695138       6649012       +79.94%
BenchmarkCShake128_448_16x-4       21210         24611         +16.03%
BenchmarkCShake128_1MiB-4          3009342       3396496       +12.87%
BenchmarkCShake256_448_16x-4       26034         27785         +6.73%
BenchmarkCShake256_1MiB-4          3654713       3829404       +4.78%
2019-05-14 17:08:33 +01:00
..
testdata SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
doc.go Temporarily change sha3 import location 2018-07-05 15:51:09 +01:00
hashes_generic.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
hashes.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
keccakf_amd64.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
keccakf_amd64.s SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
keccakf.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
register.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
sha3_s390x.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
sha3_s390x.s SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
sha3_test.go SHAKE: Don't use function pointers (#20) 2019-05-14 17:08:33 +01:00
sha3.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
shake_generic.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
shake.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
xor_generic.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
xor_unaligned.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00
xor.go SM3 and cSHAKE 2018-06-23 16:34:45 +01:00