From 25a571e0768ddcfbd7f712996d1144a445c68043 Mon Sep 17 00:00:00 2001 From: Mateusz Starzyk Date: Tue, 15 Jun 2021 13:22:42 +0200 Subject: [PATCH] Code style fix Signed-off-by: Mateusz Starzyk --- library/gcm.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/library/gcm.c b/library/gcm.c index be72f99412..a3a3e48102 100644 --- a/library/gcm.c +++ b/library/gcm.c @@ -363,7 +363,7 @@ int mbedtls_gcm_update_ad( mbedtls_gcm_context *ctx, if( use_len > add_len ) use_len = add_len; - for (i = 0; i < use_len; i++) + for ( i = 0; i < use_len; i++ ) ctx->buf[i+offset] ^= p[i]; if( offset + use_len == 16 ) @@ -378,15 +378,13 @@ int mbedtls_gcm_update_ad( mbedtls_gcm_context *ctx, while( add_len >= 16 ) { - use_len = 16; - - for( i = 0; i < use_len; i++ ) + for( i = 0; i < 16; i++ ) ctx->buf[i] ^= p[i]; gcm_mult( ctx, ctx->buf, ctx->buf ); - add_len -= use_len; - p += use_len; + add_len -= 16; + p += 16; } if( add_len > 0 )