internal/chacha20: use x/sys/cpu for s390x feature detection
Use the recently added CPU feature detection API rather than custom
assembly. This will need to be updated to use 'internal/cpu' when
the package is revendored into std.
Run-TryBot: Brad Fitzpatrick
TryBot-Result: Gobot Gobot
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.
