Source file src/crypto/subtle/xor.go

     1  // Copyright 2022 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  package subtle
     6  
     7  import "crypto/internal/fips140/subtle"
     8  
     9  // XORBytes sets dst[i] = x[i] ^ y[i] for all i < n = min(len(x), len(y)),
    10  // returning n, the number of bytes written to dst.
    11  //
    12  // If dst does not have length at least n,
    13  // XORBytes panics without writing anything to dst.
    14  //
    15  // dst and x or y may overlap exactly or not at all,
    16  // otherwise XORBytes may panic.
    17  func XORBytes(dst, x, y []byte) int {
    18  	return subtle.XORBytes(dst, x, y)
    19  }
    20  

View as plain text