Source file src/crypto/internal/fips/sha256/sha256block_arm64.go

     1  // Copyright 2017 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 !purego
     6  
     7  package sha256
     8  
     9  import (
    10  	"crypto/internal/impl"
    11  	"internal/cpu"
    12  )
    13  
    14  var useSHA2 = cpu.ARM64.HasSHA2
    15  
    16  func init() {
    17  	impl.Register("crypto/sha256", "Armv8.0", &useSHA2)
    18  }
    19  
    20  //go:noescape
    21  func blockSHA2(dig *Digest, p []byte)
    22  
    23  func block(dig *Digest, p []byte) {
    24  	if useSHA2 {
    25  		blockSHA2(dig, p)
    26  	} else {
    27  		blockGeneric(dig, p)
    28  	}
    29  }
    30  

View as plain text