X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilccore%2Fsilcchannel.h;h=6d97e1a251a7ae483550910a70bc928ba8ac4268;hb=33fde1853daddd7f34565507cb96652f0cec4ee2;hp=3b734fba9d79b5500a6bc13aa3fbf34f0c366505;hpb=77599da05bae9b355f600d63f9be8c285ff0ea4d;p=silc.git diff --git a/lib/silccore/silcchannel.h b/lib/silccore/silcchannel.h index 3b734fba..6d97e1a2 100644 --- a/lib/silccore/silcchannel.h +++ b/lib/silccore/silcchannel.h @@ -316,6 +316,40 @@ silc_channel_message_payload_parse(unsigned char *payload, SilcCipher cipher, SilcHmac hmac); +/****f* silccore/SilcChannelAPI/silc_channel_message_payload_encrypt + * + * SYNOPSIS + * + * bool silc_channel_message_payload_encrypt(unsigned char *data, + * SilcUInt32 data_len, + * SilcUInt32 true_len, + * unsigned char *iv, + * SilcUInt32 iv_len, + * SilcCipher cipher, + * SilcHmac hmac); + * + * DESCRIPTION + * + * This function is used to encrypt the Channel Messsage Payload which is + * the `data' and `data_len'. The `data_len' is the data length which is + * used to create MAC out of. The `true_len' is the true length of `data' + * message payload and is used assemble rest of the packet after MAC + * creation. The `true_len' length packet will then be encrypted. + * + * This is usually used by the Channel Message interface itself but can + * be called by the appliation if separate encryption process is required. + * For example server might need to call this directly in some + * circumstances. The `cipher' is used to encrypt the payload. + * + ***/ +bool silc_channel_message_payload_encrypt(unsigned char *data, + SilcUInt32 data_len, + SilcUInt32 true_len, + unsigned char *iv, + SilcUInt32 iv_len, + SilcCipher cipher, + SilcHmac hmac); + /****f* silccore/SilcChannelAPI/silc_channel_message_payload_encode * * SYNOPSIS