Skip to main content

dtls_decrypt_params

Function dtls_decrypt_params 

Source
pub unsafe extern "C" fn dtls_decrypt_params(
    params: *const dtls_ccm_params_t,
    src: *const c_uchar,
    length: usize,
    buf: *mut c_uchar,
    key: *const c_uchar,
    keylen: usize,
    aad: *const c_uchar,
    aad_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 params AEAD parameters: Nonce, M and L. \param src The input buffer to decrypt. \param length The length of the input buffer. \param buf The result buffer. \param key The key to use \param keylen The length of the key \param aad additional authentication data for AEAD ciphers \param aad_length actual size of @p aad

\return Less than zero on error, the number of decrypted bytes otherwise.