sha512block_arm64.mx raw
1 // Copyright 2022 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 sha512
8
9 import (
10 "crypto/internal/fips140deps/cpu"
11 "crypto/internal/impl"
12 )
13
14 var useSHA512 = cpu.ARM64HasSHA512
15
16 func init() {
17 impl.Register("sha512", "Armv8.2", &useSHA512)
18 }
19
20 //go:noescape
21 func blockSHA512(dig *Digest, p []byte)
22
23 func block(dig *Digest, p []byte) {
24 if useSHA512 {
25 blockSHA512(dig, p)
26 } else {
27 blockGeneric(dig, p)
28 }
29 }
30