Function internally used in set_flags. No multi-line lambdas in python :/
        :param x:
        :return:

def set_flag_bit(self, x):
        """
        Function internally used in set_flags. No multi-line lambdas in python :/
        :param x:
        :return:
        """
        x = bytes_to_byte(x)
        if KeyTypes.COMM_ENC in self.keys:
            x &= ~0x8
        if KeyTypes.APP_KEY in self.keys:
            x &= ~0x10
        return byte_to_bytes(x)