Function esp_idf_svc::sys::esp_aes_xts_setkey_enc
source ยท pub unsafe extern "C" fn esp_aes_xts_setkey_enc(
ctx: *mut esp_aes_xts_context,
key: *const u8,
keybits: u32,
) -> i32
Expand description
\brief This function prepares an XTS context for encryption and sets the encryption key.
\param ctx The AES XTS context to which the key should be bound. \param key The encryption key. This is comprised of the XTS key1 concatenated with the XTS key2. \param keybits The size of \p key passed in bits. Valid options are:
- 256 bits (each of key1 and key2 is a 128-bit key)
- 512 bits (each of key1 and key2 is a 256-bit key)
\return \c 0 on success. \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure.