github.com/neatlab/neatio@v1.7.3-0.20220425043230-d903e92fcc75/utilities/crypto/blake2b/blake2b_amd64.go (about)

     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  
     5  // +build !go1.7,amd64,!gccgo,!appengine
     6  
     7  package blake2b
     8  
     9  import "golang.org/x/sys/cpu"
    10  
    11  func init() {
    12  	useSSE4 = cpu.X86.HasSSE41
    13  }
    14  
    15  //go:noescape
    16  func fSSE4(h *[8]uint64, m *[16]uint64, c0, c1 uint64, flag uint64, rounds uint64)
    17  
    18  func f(h *[8]uint64, m *[16]uint64, c0, c1 uint64, flag uint64, rounds uint64) {
    19  	if useSSE4 {
    20  		fSSE4(h, m, c0, c1, flag, rounds)
    21  	} else {
    22  		fGeneric(h, m, c0, c1, flag, rounds)
    23  	}
    24  }