Function esp_idf_svc::sys::mbedtls_chacha20_setkey

source ยท
pub unsafe extern "C" fn mbedtls_chacha20_setkey(
    ctx: *mut mbedtls_chacha20_context,
    key: *const u8,
) -> i32
Expand description

\brief This function sets the encryption/decryption key.

\note After using this function, you must also call \c mbedtls_chacha20_starts() to set a nonce before you start encrypting/decrypting data with \c mbedtls_chacha_update().

\param ctx The ChaCha20 context to which the key should be bound. It must be initialized. \param key The encryption/decryption key. This must be \c 32 Bytes in length.

\return \c 0 on success. \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA if ctx or key is NULL.