blake2b_amd64.go 629 B

12345678910111213141516171819202122232425
  1. // Copyright 2016 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build !go1.7 && amd64 && !gccgo && !appengine
  5. // +build !go1.7,amd64,!gccgo,!appengine
  6. package blake2b
  7. import "golang.org/x/sys/cpu"
  8. func init() {
  9. useSSE4 = cpu.X86.HasSSE41
  10. }
  11. //go:noescape
  12. func fSSE4(h *[8]uint64, m *[16]uint64, c0, c1 uint64, flag uint64, rounds uint64)
  13. func f(h *[8]uint64, m *[16]uint64, c0, c1 uint64, flag uint64, rounds uint64) {
  14. if useSSE4 {
  15. fSSE4(h, m, c0, c1, flag, rounds)
  16. } else {
  17. fGeneric(h, m, c0, c1, flag, rounds)
  18. }
  19. }