dtls_decrypt_params method

int dtls_decrypt_params(
  1. Pointer<dtls_ccm_params_t> params,
  2. Pointer<Uint8> src,
  3. int length,
  4. Pointer<Uint8> buf,
  5. Pointer<Uint8> key,
  6. int keylen,
  7. Pointer<Uint8> aad,
  8. int aad_length,
)

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 buffer to decrypt. \param length The length of the input buffer. \param buf The result buffer. \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.

Implementation

int dtls_decrypt_params(
  ffi.Pointer<dtls_ccm_params_t> params,
  ffi.Pointer<ffi.Uint8> src,
  int length,
  ffi.Pointer<ffi.Uint8> buf,
  ffi.Pointer<ffi.Uint8> key,
  int keylen,
  ffi.Pointer<ffi.Uint8> aad,
  int aad_length,
) {
  return _dtls_decrypt_params(
    params,
    src,
    length,
    buf,
    key,
    keylen,
    aad,
    aad_length,
  );
}