def _K(s, _in):
    """ S-box substitution

    :param s: S-box
    :param _in: 32-bit word
    :returns: substituted 32-bit word
    """
    return (s[0][_in >> 0 & 15] << 0) + (s[1][_in >> 4 & 15] << 4) + (s[2][
        _in >> 8 & 15] << 8) + (s[3][_in >> 12 & 15] << 12) + (s[4][_in >> 
        16 & 15] << 16) + (s[5][_in >> 20 & 15] << 20) + (s[6][_in >> 24 & 
        15] << 24) + (s[7][_in >> 28 & 15] << 28)
