From 1bd9d58b21b5b19d70fd262f80351a8c48ea941b Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 4 Jun 2018 11:58:44 +0200 Subject: [PATCH] Clarify comment about integer division by a variable --- library/ssl_tls.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 6fdfb6349..e1b8f9c5b 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -2005,9 +2005,10 @@ static int ssl_decrypt_buf( mbedtls_ssl_context *ssl ) * correctly. We round down instead of up, so -56 is the correct * value for our calculations instead of -55. * - * Repeat the formula rather than defining a block_size variable - * so that the code only uses division by a constant, not division - * by a variable. + * Repeat the formula rather than defining a block_size variable. + * This avoids requiring division by a variable at runtime + * (which would be marginally less efficient and would require + * linking an extra division function in some builds). */ size_t j, extra_run = 0; switch( ssl->transform_in->ciphersuite_info->mac )