- /* Generate IV */
- iv_len = silc_cipher_get_block_len(cipher);
- if (channel->iv[0] == '\0')
- for (i = 0; i < iv_len; i++) channel->iv[i] =
- silc_rng_get_byte(client->rng);
- else
- silc_hash_make(client->internal->md5hash, channel->iv, iv_len,
- channel->iv);
-
- /* Encode the channel payload. This also encrypts the message payload. */
- payload = silc_channel_message_payload_encode(flags, data_len, data, iv_len,
- channel->iv, cipher, hmac,
- client->rng);
+ /* Encode the message payload. This also encrypts the message payload. */
+ payload = silc_message_payload_encode(flags, data, data_len, TRUE, FALSE,
+ cipher, hmac, client->rng, NULL,
+ client->private_key, client->sha1hash);