diff --git a/src/crypto/sha1/sha1block_arm64.go b/src/crypto/sha1/sha1block_arm64.go index 173c40fec81..08d3df0000e 100644 --- a/src/crypto/sha1/sha1block_arm64.go +++ b/src/crypto/sha1/sha1block_arm64.go @@ -13,13 +13,11 @@ var k = []uint32{ 0xCA62C1D6, } -var hasSHA1 = cpu.ARM64.HasSHA1 - //go:noescape func sha1block(h []uint32, p []byte, k []uint32) func block(dig *digest, p []byte) { - if !hasSHA1 { + if !cpu.ARM64.HasSHA1 { blockGeneric(dig, p) } else { h := dig.h[:] diff --git a/src/crypto/sha256/sha256block_arm64.go b/src/crypto/sha256/sha256block_arm64.go index 75bbcbe0eb7..e5da5663631 100644 --- a/src/crypto/sha256/sha256block_arm64.go +++ b/src/crypto/sha256/sha256block_arm64.go @@ -8,13 +8,11 @@ import "internal/cpu" var k = _K -var hasSHA2 = cpu.ARM64.HasSHA2 - //go:noescape func sha256block(h []uint32, p []byte, k []uint32) func block(dig *digest, p []byte) { - if !hasSHA2 { + if !cpu.ARM64.HasSHA2 { blockGeneric(dig, p) } else { h := dig.h[:] diff --git a/src/hash/crc32/crc32_arm64.go b/src/hash/crc32/crc32_arm64.go index 1f8779d506f..0242d1d8a77 100644 --- a/src/hash/crc32/crc32_arm64.go +++ b/src/hash/crc32/crc32_arm64.go @@ -13,20 +13,18 @@ import "internal/cpu" func castagnoliUpdate(crc uint32, p []byte) uint32 func ieeeUpdate(crc uint32, p []byte) uint32 -var hasCRC32 = cpu.ARM64.HasCRC32 - func archAvailableCastagnoli() bool { - return hasCRC32 + return cpu.ARM64.HasCRC32 } func archInitCastagnoli() { - if !hasCRC32 { + if !cpu.ARM64.HasCRC32 { panic("arch-specific crc32 instruction for Catagnoli not available") } } func archUpdateCastagnoli(crc uint32, p []byte) uint32 { - if !hasCRC32 { + if !cpu.ARM64.HasCRC32 { panic("arch-specific crc32 instruction for Castagnoli not available") } @@ -34,17 +32,17 @@ func archUpdateCastagnoli(crc uint32, p []byte) uint32 { } func archAvailableIEEE() bool { - return hasCRC32 + return cpu.ARM64.HasCRC32 } func archInitIEEE() { - if !hasCRC32 { + if !cpu.ARM64.HasCRC32 { panic("arch-specific crc32 instruction for IEEE not available") } } func archUpdateIEEE(crc uint32, p []byte) uint32 { - if !hasCRC32 { + if !cpu.ARM64.HasCRC32 { panic("arch-specific crc32 instruction for IEEE not available") }