diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-04-14 16:54:42 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-04-14 16:54:42 +0200 |
commit | 67a0eb7111d3f89e4a0cb21e43aefe6d87d37e04 (patch) | |
tree | c9b18e0da6e06ac165a485ee957b7850adb12e86 /vendor/github.com/dchest/siphash/hash_arm.go | |
parent | 2e8f2a2e8e83fd89f956cdde886d5d9d808132da (diff) |
[pkg] go mod vendor to build debian/ubuntu packages
Diffstat (limited to 'vendor/github.com/dchest/siphash/hash_arm.go')
-rw-r--r-- | vendor/github.com/dchest/siphash/hash_arm.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/github.com/dchest/siphash/hash_arm.go b/vendor/github.com/dchest/siphash/hash_arm.go new file mode 100644 index 0000000..428dd96 --- /dev/null +++ b/vendor/github.com/dchest/siphash/hash_arm.go @@ -0,0 +1,27 @@ +// +build arm + +package siphash + +// NB: ARM implementation of forgoes extra speed for Hash() +// and Hash128() by simply reusing the same blocks() implementation +// in assembly used by the streaming hash. + +func Hash(k0, k1 uint64, p []byte) uint64 { + var d digest + d.size = Size + d.k0 = k0 + d.k1 = k1 + d.Reset() + d.Write(p) + return d.Sum64() +} + +func Hash128(k0, k1 uint64, p []byte) (uint64, uint64) { + var d digest + d.size = Size128 + d.k0 = k0 + d.k1 = k1 + d.Reset() + d.Write(p) + return d.sum128() +} |