def compare_to_zero(value: bytearray) -> bool:
    """Compare byte array with zero.

    This function, in contrast to the simple comparison operation '==', is
    performed in constant time to prevent timing attacks.

    Args:
        value: Array to compare.

    Returns:
        Comparison result (boolean).
    """
    value = bytearray(value)
    res_check = 0
    for i in enumerate(value):
        check = value[i[0]] ^ 0x00
        res_check = res_check + check
    return not res_check