def Ch(x, y, z):
    """Choose function

    x chooses if value comes from y or z 1 means the bit comes from y
    and 0 means the bit comes from z

    Ch(x, y, z) = (x ∧ y) ⊕ (¬x ∧ z)
    """
    return (x & y) ^ ((x ^ 0xffffffff) & z)