def xor_bytes(a, b):
    """Returns a byte array with the values from XOR'ing each byte of the input arrays."""
    if len(a) != len(b):
        raise ValueError("Both byte arrays must be the same length.")

    return bytes([a[i] ^ b[i] for i in range(len(a))])