def sign(self, msg):
        '''
        Sign a message (digest) using the private key

        :param str msg: The message (digest) to sign
        :rtype: str
        :return: The signature, or an empty string if the encryption failed
        '''
        # Allocate a buffer large enough for the signature. Freed by ctypes.
        buf = create_string_buffer(libcrypto.RSA_size(self._rsa))
        msg = salt.utils.to_bytes(msg)
        size = libcrypto.RSA_private_encrypt(len(msg), msg, buf, self._rsa, RSA_X931_PADDING)
        if 0 < size:
            raise ValueError('Unable to encrypt message')
        return buf[0:size]
dataset/ETHPy150Open saltstack/salt/salt/utils/rsax931.py/RSAX931Signer.sign/swapped operands of `<`