diff --git a/sha3/hashes.go b/sha3/hashes.go index 0d8043fd2a..1e815c9c7a 100644 --- a/sha3/hashes.go +++ b/sha3/hashes.go @@ -16,9 +16,6 @@ import ( // Its generic security strength is 224 bits against preimage attacks, // and 112 bits against collision attacks. func New224() hash.Hash { - if h := new224Asm(); h != nil { - return h - } return &state{rate: 144, outputLen: 28, dsbyte: 0x06} } @@ -26,9 +23,6 @@ func New224() hash.Hash { // Its generic security strength is 256 bits against preimage attacks, // and 128 bits against collision attacks. func New256() hash.Hash { - if h := new256Asm(); h != nil { - return h - } return &state{rate: 136, outputLen: 32, dsbyte: 0x06} } @@ -36,9 +30,6 @@ func New256() hash.Hash { // Its generic security strength is 384 bits against preimage attacks, // and 192 bits against collision attacks. func New384() hash.Hash { - if h := new384Asm(); h != nil { - return h - } return &state{rate: 104, outputLen: 48, dsbyte: 0x06} } @@ -46,9 +37,6 @@ func New384() hash.Hash { // Its generic security strength is 512 bits against preimage attacks, // and 256 bits against collision attacks. func New512() hash.Hash { - if h := new512Asm(); h != nil { - return h - } return &state{rate: 72, outputLen: 64, dsbyte: 0x06} } diff --git a/sha3/hashes_generic.go b/sha3/hashes_generic.go deleted file mode 100644 index fe8c84793c..0000000000 --- a/sha3/hashes_generic.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !gc || purego || !s390x - -package sha3 - -import ( - "hash" -) - -// new224Asm returns an assembly implementation of SHA3-224 if available, -// otherwise it returns nil. -func new224Asm() hash.Hash { return nil } - -// new256Asm returns an assembly implementation of SHA3-256 if available, -// otherwise it returns nil. -func new256Asm() hash.Hash { return nil } - -// new384Asm returns an assembly implementation of SHA3-384 if available, -// otherwise it returns nil. -func new384Asm() hash.Hash { return nil } - -// new512Asm returns an assembly implementation of SHA3-512 if available, -// otherwise it returns nil. -func new512Asm() hash.Hash { return nil } diff --git a/sha3/sha3_s390x.go b/sha3/sha3_s390x.go index b4fbbf8695..26b728b836 100644 --- a/sha3/sha3_s390x.go +++ b/sha3/sha3_s390x.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gc && !purego +//go:build gc && !purego && ignore package sha3 diff --git a/sha3/sha3_s390x.s b/sha3/sha3_s390x.s index 826b862c77..df51683097 100644 --- a/sha3/sha3_s390x.s +++ b/sha3/sha3_s390x.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gc && !purego +//go:build gc && !purego && ignore #include "textflag.h" diff --git a/sha3/shake.go b/sha3/shake.go index bb69984027..a31bcf898c 100644 --- a/sha3/shake.go +++ b/sha3/shake.go @@ -115,9 +115,6 @@ func (c *state) Clone() ShakeHash { // Its generic security strength is 128 bits against all attacks if at // least 32 bytes of its output are used. func NewShake128() ShakeHash { - if h := newShake128Asm(); h != nil { - return h - } return &state{rate: rate128, outputLen: 32, dsbyte: dsbyteShake} } @@ -125,9 +122,6 @@ func NewShake128() ShakeHash { // Its generic security strength is 256 bits against all attacks if // at least 64 bytes of its output are used. func NewShake256() ShakeHash { - if h := newShake256Asm(); h != nil { - return h - } return &state{rate: rate256, outputLen: 64, dsbyte: dsbyteShake} } diff --git a/sha3/shake_generic.go b/sha3/shake_generic.go deleted file mode 100644 index 8d31cf5be2..0000000000 --- a/sha3/shake_generic.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !gc || purego || !s390x - -package sha3 - -// newShake128Asm returns an assembly implementation of SHAKE-128 if available, -// otherwise it returns nil. -func newShake128Asm() ShakeHash { - return nil -} - -// newShake256Asm returns an assembly implementation of SHAKE-256 if available, -// otherwise it returns nil. -func newShake256Asm() ShakeHash { - return nil -}