Black Lives Matter. Support the Equal Justice Initiative.

Source file src/crypto/cipher/xor_ppc64x.go

Documentation: crypto/cipher

     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  
     5  //go:build ppc64 || ppc64le
     6  // +build ppc64 ppc64le
     7  
     8  package cipher
     9  
    10  // xorBytes xors the bytes in a and b. The destination should have enough
    11  // space, otherwise xorBytes will panic. Returns the number of bytes xor'd.
    12  func xorBytes(dst, a, b []byte) int {
    13  	n := len(a)
    14  	if len(b) < n {
    15  		n = len(b)
    16  	}
    17  	if n == 0 {
    18  		return 0
    19  	}
    20  	_ = dst[n-1]
    21  	xorBytesVSX(&dst[0], &a[0], &b[0], n)
    22  	return n
    23  }
    24  
    25  func xorWords(dst, a, b []byte) {
    26  	xorBytes(dst, a, b)
    27  }
    28  
    29  //go:noescape
    30  func xorBytesVSX(dst, a, b *byte, n int)
    31  

View as plain text