mirror of
https://github.com/espressif/mbedtls.git
synced 2025-06-26 03:24:35 +08:00
Add comment on impossible overflows
Signed-off-by: Chien Wong <m@xv97.com>
This commit is contained in:
parent
bf4b5ed7a4
commit
858bc65d74
@ -542,6 +542,9 @@ int mbedtls_gcm_finish(mbedtls_gcm_context *ctx,
|
|||||||
(void) output_size;
|
(void) output_size;
|
||||||
*output_length = 0;
|
*output_length = 0;
|
||||||
|
|
||||||
|
/* Total length is restricted to 2^39 - 256 bits, ie 2^36 - 2^5 bytes
|
||||||
|
* and AD length is restricted to 2^64 bits, ie 2^61 bytes so neither of
|
||||||
|
* the two multiplications would overflow. */
|
||||||
orig_len = ctx->len * 8;
|
orig_len = ctx->len * 8;
|
||||||
orig_add_len = ctx->add_len * 8;
|
orig_add_len = ctx->add_len * 8;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user