Black Lives Matter. Support the Equal Justice Initiative.

Source file src/crypto/sha512/sha512block_amd64.go

Documentation: crypto/sha512

     1  // Copyright 2013 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  //go:build amd64
     6  // +build amd64
     7  
     8  package sha512
     9  
    10  import "internal/cpu"
    11  
    12  //go:noescape
    13  func blockAVX2(dig *digest, p []byte)
    14  
    15  //go:noescape
    16  func blockAMD64(dig *digest, p []byte)
    17  
    18  var useAVX2 = cpu.X86.HasAVX2 && cpu.X86.HasBMI1 && cpu.X86.HasBMI2
    19  
    20  func block(dig *digest, p []byte) {
    21  	if useAVX2 {
    22  		blockAVX2(dig, p)
    23  	} else {
    24  		blockAMD64(dig, p)
    25  	}
    26  }
    27  

View as plain text