mbedtls_cipher_set_iv() is only used within mbedTLS.
 
Symbols
loading...
Files
loading...

mbedtls_cipher_set_iv() function

This function sets the initialization vector (IV) or nonce.

Syntax

int mbedtls_cipher_set_iv( mbedtls_cipher_context_t *ctx,     const unsigned char *iv,     size_t iv_len );
Implemented in cipher.c:249

Arguments

ctx

The generic cipher context. This must be initialized and bound to a cipher information structure.

iv

The IV to use, or NONCE_COUNTER for CTR-mode ciphers. This must be a readable buffer of at least \p iv_len Bytes.

iv_len

The IV length for ciphers with variable-size IV. This parameter is discarded by ciphers with fixed-size IV.

Return value

\c 0 on success. #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on parameter-verification failure.

Notes

Some ciphers do not use IVs nor nonce. For these ciphers, this function has no effect.

References

LocationReferrerText
cipher.c:249
int mbedtls_cipher_set_iv( mbedtls_cipher_context_t *ctx,
cipher.h:616
int mbedtls_cipher_set_iv( mbedtls_cipher_context_t *ctx,
cipher.c:1014mbedtls_cipher_crypt()
if( ( ret = mbedtls_cipher_set_iv( ctx, iv, iv_len ) ) != 0 )

Call Tree

Functions calling mbedtls_cipher_set_iv()
Functions called by mbedtls_cipher_set_iv()
all items filtered out
mbedtls_cipher_set_iv()
memcpy()
all items filtered out
Data read by mbedtls_cipher_set_iv()
Data written by mbedtls_cipher_set_iv()
mbedtls_cipher_set_iv()
mbedtls_cipher_set_iv()::actual_iv_size
all items filtered out
Type of mbedtls_cipher_set_iv()
mbedtls_cipher_set_iv()
size_t
all items filtered out