dtls_decrypt

Function dtls_decrypt 

Source
pub unsafe extern "C" fn dtls_decrypt(
    src: *const c_uchar,
    length: usize,
    buf: *mut c_uchar,
    nonce: *const c_uchar,
    key: *const c_uchar,
    keylen: usize,
    a_data: *const c_uchar,
    a_data_length: usize,
) -> c_int
Expand description

Decrypts the given buffer \p src of given \p length, writing the result to \p buf. The function returns \c -1 in case of an error, or the number of bytes written. Note that for block ciphers, \p length must be a multiple of the cipher’s block size. A return value between \c 0 and the actual length indicates that only \c n-1 block have been processed. The provided \p src and \p buf may overlap.

\param src The buffer to decrypt. \param length The length of the input buffer. \param buf The result buffer. \param nonce The nonce used for encryption. Must be exactly 13 bytes, because L is set to 2. \param key The key to use \param keylen The key to use \param a_data additional authentication data for AEAD ciphers \param a_data_length actual size of @p aad \return Less than zero on error, the number of decrypted bytes otherwise.

\deprecated dtls_decrypt() always sets M=8, L=2. Use dtls_decrypt_params() instead.