def ct_neq_u32(val_a, val_b):
    """
    Return 1 if val_a != val_b, 0 otherwise. Constant time.

    :type val_a: int
    :type val_b: int
    :param val_a: an unsigned integer representable as a 32 bit value
    :param val_b: an unsigned integer representable as a 32 bit value
    :rtype: int
    """
    val_a &= 0xffffffff
    val_b &= 0xffffffff

    return (((val_a-val_b)&0xffffffff) | ((val_b-val_a)&0xffffffff)) >> 31