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

mbedtls_gcm_update() function

This function feeds an input buffer into an ongoing GCM encryption or decryption operation. ` The function expects input to be a multiple of 16 Bytes. Only the last call before calling mbedtls_gcm_finish() can be less than 16 Bytes.

Syntax

int mbedtls_gcm_update( mbedtls_gcm_context *ctx,     size_t length,     const unsigned char *input,     unsigned char *output );
Implemented in gcm.c:363

Arguments

ctx

The GCM context. This must be initialized.

length

The length of the input data. This must be a multiple of 16 except in the last call before mbedtls_gcm_finish().

input

The buffer holding the input data. If \p length is greater than zero, this must be a readable buffer of at least that size in Bytes.

output

The buffer for holding the output data. If \p length is greater than zero, this must be a writable buffer of at least that size in Bytes.

Return value

\c 0 on success. #MBEDTLS_ERR_GCM_BAD_INPUT on failure.

Notes

For decryption, the output buffer cannot be the same as input buffer. If the buffers overlap, the output buffer must trail at least 8 Bytes behind the input buffer.

References

LocationReferrerText
gcm.c:363
int mbedtls_gcm_update( mbedtls_gcm_context *ctx,
gcm.h:275
int mbedtls_gcm_update( mbedtls_gcm_context *ctx,
cipher.c:385mbedtls_cipher_update()
return( mbedtls_gcm_update( (mbedtls_gcm_context *) ctx->cipher_ctx, ilen, input,
gcm.c:491mbedtls_gcm_crypt_and_tag()
if( ( ret = mbedtls_gcm_update( ctx, length, input, output ) ) != 0 )

Call Tree

Functions calling mbedtls_gcm_update()
Functions called by mbedtls_gcm_update()
mbedtls_gcm_update()
all items filtered out
Data read by mbedtls_gcm_update()
Data written by mbedtls_gcm_update()
mbedtls_gcm_update()::ret
mbedtls_gcm_update()::ectr
mbedtls_gcm_update()::i
mbedtls_gcm_update()::p
mbedtls_gcm_update()::out_p
mbedtls_gcm_update()::use_len
all items filtered out
mbedtls_gcm_update()
mbedtls_gcm_update()::ret
mbedtls_gcm_update()::i
mbedtls_gcm_update()::p
mbedtls_gcm_update()::out_p
mbedtls_gcm_update()::use_len
all items filtered out
Type of mbedtls_gcm_update()
mbedtls_gcm_update()
size_t
all items filtered out