summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/crypto/internal/chacha20
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-05-30 12:20:56 +0200
committerGitHub <noreply@github.com>2019-05-30 12:20:56 +0200
commit3418e8c9afbdf3e94ab26a20d8f12c042ae29fc4 (patch)
treec5358b971a95749bece9469e959041d4f2e54cc3 /vendor/golang.org/x/crypto/internal/chacha20
parent9619dff33417548a50e51a4f75f41b9de4a73327 (diff)
downloadmatterbridge-msglm-3418e8c9afbdf3e94ab26a20d8f12c042ae29fc4.tar.gz
matterbridge-msglm-3418e8c9afbdf3e94ab26a20d8f12c042ae29fc4.tar.bz2
matterbridge-msglm-3418e8c9afbdf3e94ab26a20d8f12c042ae29fc4.zip
Use upstream whatsapp again (#809)
Diffstat (limited to 'vendor/golang.org/x/crypto/internal/chacha20')
-rw-r--r--vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go11
-rw-r--r--vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s23
2 files changed, 5 insertions, 29 deletions
diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go
index 0c1c671c..aad645b4 100644
--- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go
+++ b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go
@@ -6,14 +6,13 @@
package chacha20
-var haveAsm = hasVectorFacility()
+import (
+ "golang.org/x/sys/cpu"
+)
-const bufSize = 256
+var haveAsm = cpu.S390X.HasVX
-// hasVectorFacility reports whether the machine supports the vector
-// facility (vx).
-// Implementation in asm_s390x.s.
-func hasVectorFacility() bool
+const bufSize = 256
// xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only
// be called when the vector facility is available.
diff --git a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s
index 98427c5e..57df4044 100644
--- a/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s
+++ b/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s
@@ -258,26 +258,3 @@ tail:
MOVD R8, R3
MOVD $0, R4
JMP continue
-
-// func hasVectorFacility() bool
-TEXT ·hasVectorFacility(SB), NOSPLIT, $24-1
- MOVD $x-24(SP), R1
- XC $24, 0(R1), 0(R1) // clear the storage
- MOVD $2, R0 // R0 is the number of double words stored -1
- WORD $0xB2B01000 // STFLE 0(R1)
- XOR R0, R0 // reset the value of R0
- MOVBZ z-8(SP), R1
- AND $0x40, R1
- BEQ novector
-
-vectorinstalled:
- // check if the vector instruction has been enabled
- VLEIB $0, $0xF, V16
- VLGVB $0, V16, R1
- CMPBNE R1, $0xF, novector
- MOVB $1, ret+0(FP) // have vx
- RET
-
-novector:
- MOVB $0, ret+0(FP) // no vx
- RET