Function esp_idf_sys::mbedtls_cipher_setkey
source ยท pub unsafe extern "C" fn mbedtls_cipher_setkey(
ctx: *mut mbedtls_cipher_context_t,
key: *const c_uchar,
key_bitlen: c_int,
operation: mbedtls_operation_t,
) -> c_int
Expand description
\brief This function sets the key to use with the given context.
\param ctx The generic cipher context. This must be initialized and bound to a cipher information structure. \param key The key to use. This must be a readable buffer of at least \p key_bitlen Bits. \param key_bitlen The key length to use, in Bits. \param operation The operation that the key will be used for: #MBEDTLS_ENCRYPT or #MBEDTLS_DECRYPT.
\return \c 0 on success. \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on parameter-verification failure. \return A cipher-specific error code on failure.