25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
909 B

  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. var haveAsm = hasVectorFacility()
  7. const bufSize = 256
  8. // hasVectorFacility reports whether the machine supports the vector
  9. // facility (vx).
  10. // Implementation in asm_s390x.s.
  11. func hasVectorFacility() bool
  12. // xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only
  13. // be called when the vector facility is available.
  14. // Implementation in asm_s390x.s.
  15. //go:noescape
  16. func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32, buf *[256]byte, len *int)
  17. func (c *Cipher) xorKeyStreamAsm(dst, src []byte) {
  18. xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter, &c.buf, &c.len)
  19. }
  20. // EXRL targets, DO NOT CALL!
  21. func mvcSrcToBuf()
  22. func mvcBufToDst()