You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

chacha_s390x.go 789B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build s390x,!gccgo,!appengine
  5. package chacha20
  6. import (
  7. "golang.org/x/sys/cpu"
  8. )
  9. var haveAsm = cpu.S390X.HasVX
  10. const bufSize = 256
  11. // xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only
  12. // be called when the vector facility is available.
  13. // Implementation in asm_s390x.s.
  14. //go:noescape
  15. func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32, buf *[256]byte, len *int)
  16. func (c *Cipher) xorKeyStreamAsm(dst, src []byte) {
  17. xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter, &c.buf, &c.len)
  18. }
  19. // EXRL targets, DO NOT CALL!
  20. func mvcSrcToBuf()
  21. func mvcBufToDst()