Function silc_channel_message_payload_encode
SYNOPSIS
SilcBuffer silc_channel_message_payload_encode(SilcUInt16 flags,
SilcUInt16 data_len,
const unsigned char *data,
SilcUInt16 iv_len,
unsigned char *iv,
SilcCipher cipher,
SilcHmac hmac.
SilcRng rng);
DESCRIPTION
Encodes channel message payload into a buffer and returns it. This
is used to add channel message payload into a packet. As the channel
payload is encrypted separately from other parts of the packet padding
must be applied to the payload. The function generates the padding
automatically from random data. The `cipher' is the cipher used
encrypt the payload and `hmac' is used to compute the MAC for the
payload. If `rng' is NULL then global RNG is used, if non-NULL then
the `rng' is used.
|