Function esp_idf_svc::sys::esp_aes_crypt_ctr
source ยท pub unsafe extern "C" fn esp_aes_crypt_ctr(
ctx: *mut esp_aes_context,
length: usize,
nc_off: *mut usize,
nonce_counter: *mut u8,
stream_block: *mut u8,
input: *const u8,
output: *mut u8,
) -> i32
Expand description
\brief AES-CTR buffer encryption/decryption
Warning: You have to keep the maximum use of your counter in mind!
Note: Due to the nature of CTR you should use the same key schedule for both encryption and decryption. So a context initialized with esp_aes_setkey_enc() for both AES_ENCRYPT and AES_DECRYPT.
\param ctx AES context \param length The length of the data \param nc_off The offset in the current stream_block (for resuming within current cipher stream). The offset pointer to should be 0 at the start of a stream. \param nonce_counter The 128-bit nonce and counter. \param stream_block The saved stream-block for resuming. Is overwritten by the function. \param input The input data stream \param output The output data stream
\return 0 if successful