def ct_lt_u32(val_a, val_b):
    """
    Returns 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 &= 4294967295
    val_b &= 4294967295
    return (val_a ^ (val_a ^ val_b | val_a - val_b & 4294967295 ^ val_b)) >> 31
