public static final byte[] xor(
      final byte[] x, int offsetX, final byte[] y, int offsetY, int len) {
    if (len < 0 || x.length - len < offsetX || y.length - len < offsetY) {
      throw new IllegalArgumentException(
          "That combination of buffers, offsets and length to xor result in out-of-bond accesses.");
    }
    byte[] res = new byte[len];
    for (int i = 0; i < len; i++) {
      res[i] = (byte) (x[i + offsetX] ^ y[i + offsetY]);
    }
    return res;
  }
Computes the xor of two byte arrays, specifying offsets and the length to xor.

@return a new byte[] of length len.
java_src/src/main/java/com/google/crypto/tink/subtle/Bytes.java