| 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 |
//go:build !purego |
| 6 |
|
| 7 |
package sha1 |
| 8 |
|
| 9 |
import ( |
| 10 |
"crypto/internal/impl" |
| 11 |
"internal/cpu" |
| 12 |
) |
| 13 |
|
| 14 |
var useSHA1 = cpu.S390X.HasSHA1 |
| 15 |
|
| 16 |
func init() { |
| 17 |
// CP Assist for Cryptographic Functions (CPACF) |
| 18 |
// https://www.ibm.com/docs/en/zos/3.1.0?topic=icsf-cp-assist-cryptographic-functions-cpacf |
| 19 |
impl.Register("sha1", "CPACF", &useSHA1) |
| 20 |
} |
| 21 |
|
| 22 |
//go:noescape |
| 23 |
func blockS390X(dig *digest, p []byte) |
| 24 |
|
| 25 |
func block(dig *digest, p []byte) { |
| 26 |
if useSHA1 { |
| 27 |
blockS390X(dig, p) |
| 28 |
} else { |
| 29 |
blockGeneric(dig, p) |
| 30 |
} |
| 31 |
} |