gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/sm3/sm3block_amd64.go (about)

     1  //go:build amd64
     2  // +build amd64
     3  
     4  package sm3
     5  
     6  /*
     7  sm3/sm3block_amd64.go 平台CPU是amd64架构时SM3的块处理。
     8  具体实现 : sm3/sm3block_amd64.s
     9  */
    10  
    11  import (
    12  	"fmt"
    13  	"runtime"
    14  
    15  	"golang.org/x/sys/cpu"
    16  )
    17  
    18  var useAVX2 = cpu.X86.HasAVX2 && cpu.X86.HasBMI2
    19  
    20  func init() {
    21  	cpuType = runtime.GOARCH
    22  	if false {
    23  		fmt.Printf("该平台CPU架构为amd64, 对AVX2和BMI2指令集的支持: %v\n", useAVX2)
    24  	}
    25  }
    26  
    27  //go:noescape
    28  //goland:noinspection GoUnusedParameter
    29  func block(dig *digest, p []byte)