Function esp_idf_svc::hal::sys::mbedtls_cipher_setkey
source ยท pub unsafe extern "C" fn mbedtls_cipher_setkey(
ctx: *mut mbedtls_cipher_context_t,
key: *const u8,
key_bitlen: i32,
operation: i32,
) -> i32
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.