]> Cypherpunks repositories - gostls13.git/commit
crypto, internal/cpu: fix s390x AES feature detection and update SHA implementations
authorMichael Munday <mike.munday@ibm.com>
Thu, 24 May 2018 12:20:21 +0000 (13:20 +0100)
committerMichael Munday <mike.munday@ibm.com>
Mon, 11 Jun 2018 11:41:31 +0000 (11:41 +0000)
commit7ba0c6235f9968eb453e759105366bcaa0903326
treef61ab2249327d5302bca361e1f58ec4d61e1ecf1
parent40fc4bbfb86ea82ecb16794cd093a36a87d38197
crypto, internal/cpu: fix s390x AES feature detection and update SHA implementations

Hardware AES support in Go on s390x currently requires ECB, CBC
and CTR modes be available. It also requires that either the
GHASH or GCM facilities are available. The existing checks missed
some of these constraints.

While we're here simplify the cpu package on s390x, moving masking
code out of assembly and into Go code. Also, update SHA-{1,256,512}
implementations to use the cpu package since that is now trivial.

Finally I also added a test for internal/cpu on s390x which loads
/proc/cpuinfo and checks it against the flags set by internal/cpu.

Updates #25822 for changes to vet whitelist.

Change-Id: Iac4183f571643209e027f730989c60a811c928eb
Reviewed-on: https://go-review.googlesource.com/114397
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
15 files changed:
src/cmd/vet/all/whitelist/s390x.txt
src/crypto/aes/cipher_s390x.go
src/crypto/aes/gcm_s390x.go
src/crypto/sha1/sha1block_s390x.go
src/crypto/sha1/sha1block_s390x.s
src/crypto/sha256/sha256block_s390x.go
src/crypto/sha256/sha256block_s390x.s
src/crypto/sha512/sha512block_s390x.go
src/crypto/sha512/sha512block_s390x.s
src/crypto/tls/common.go
src/internal/cpu/cpu.go
src/internal/cpu/cpu_no_init.go
src/internal/cpu/cpu_s390x.go
src/internal/cpu/cpu_s390x.s
src/internal/cpu/cpu_s390x_test.go [new file with mode: 0644]