Add comment on how mbedtls_gcm_context::buf data depends on
values of add_len and len. Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
This commit is contained in:
parent
333f48f407
commit
b45b57eec6
1 changed files with 10 additions and 1 deletions
|
@ -332,7 +332,16 @@ int mbedtls_gcm_starts( mbedtls_gcm_context *ctx,
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mbedtls_gcm_context::buf contains different data type, depending
|
||||||
|
* on the values of mbedtls_gcm_context::::add_len and
|
||||||
|
* mbedtls_gcm_context::len:
|
||||||
|
* * When add_len % 16 == 0 and len == 0: initial state.
|
||||||
|
* * When add_len % 16 != 0 and len == 0: the first `add_len % 16` bytes
|
||||||
|
* of buf have a partial AD block xored in and not yet multiplied in.
|
||||||
|
* * When len != 0: the first `add_len % 16` bytes of buf have partial
|
||||||
|
* ciphertext xored in and not yet multiplied in.
|
||||||
|
*/
|
||||||
int mbedtls_gcm_update_ad( mbedtls_gcm_context *ctx,
|
int mbedtls_gcm_update_ad( mbedtls_gcm_context *ctx,
|
||||||
const unsigned char *add, size_t add_len )
|
const unsigned char *add, size_t add_len )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue