hash_asm.go 863 B

12345678910111213141516171819202122232425
  1. //go:build amd64 && !appengine && !gccgo
  2. // +build amd64,!appengine,!gccgo
  3. // Written in 2012 by Dmitry Chestnykh.
  4. //
  5. // To the extent possible under law, the author have dedicated all copyright
  6. // and related and neighboring rights to this software to the public domain
  7. // worldwide. This software is distributed without any warranty.
  8. // http://creativecommons.org/publicdomain/zero/1.0/
  9. // This file contains a function definition for use with assembly implementations of Hash()
  10. package siphash
  11. //go:noescape
  12. // Hash returns the 64-bit SipHash-2-4 of the given byte slice with two 64-bit
  13. // parts of 128-bit key: k0 and k1.
  14. func Hash(k0, k1 uint64, b []byte) uint64
  15. //go:noescape
  16. // Hash128 returns the 128-bit SipHash-2-4 of the given byte slice with two
  17. // 64-bit parts of 128-bit key: k0 and k1.
  18. func Hash128(k0, k1 uint64, b []byte) (uint64, uint64)