Fix typos and style issues.
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
diff --git a/library/gcm.c b/library/gcm.c
index 02265ce..8fa4ee7 100644
--- a/library/gcm.c
+++ b/library/gcm.c
@@ -281,7 +281,7 @@
GCM_VALIDATE_RET( ctx != NULL );
GCM_VALIDATE_RET( iv != NULL );
- /* IV is are limited to 2^64 bits, so 2^61 bytes */
+ /* IV is limited to 2^64 bits, so 2^61 bytes */
/* IV is not allowed to be zero length */
if( iv_len == 0 || (uint64_t) iv_len >> 61 != 0 )
return( MBEDTLS_ERR_GCM_BAD_INPUT );
@@ -335,8 +335,8 @@
/**
* mbedtls_gcm_context::buf contains the partial state of the computation of
* the authentication tag.
- * mbedtls_gcm_context::::add_len and mbedtls_gcm_context::len indicate
- * differenet stages of the computation:
+ * mbedtls_gcm_context::add_len and mbedtls_gcm_context::len indicate
+ * different stages of the computation:
* * len == 0 && add_len == 0: initial state
* * len == 0 && add_len % 16 != 0: the first `add_len % 16` bytes have
* a partial block of AD that has been
@@ -357,7 +357,7 @@
GCM_VALIDATE_RET( add_len == 0 || add != NULL );
- /* IV is are limited to 2^64 bits, so 2^61 bytes */
+ /* IV is limited to 2^64 bits, so 2^61 bytes */
if( (uint64_t) add_len >> 61 != 0 )
return( MBEDTLS_ERR_GCM_BAD_INPUT );
@@ -370,7 +370,7 @@
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 )
diff --git a/tests/suites/test_suite_gcm.function b/tests/suites/test_suite_gcm.function
index 005c498..49859dd 100644
--- a/tests/suites/test_suite_gcm.function
+++ b/tests/suites/test_suite_gcm.function
@@ -79,7 +79,7 @@
TEST_EQUAL( 0, mbedtls_gcm_starts( ctx, mode,
iv->x, iv->len ) );
- for( n = 0; n < ad_update_count; n += 1 )
+ for( n = 0; n < ad_update_count; n++ )
{
TEST_EQUAL( 0, mbedtls_gcm_update_ad( ctx, NULL, 0 ) );
}
@@ -117,7 +117,7 @@
TEST_EQUAL( 0, mbedtls_gcm_starts( ctx, mode, iv->x, iv->len ) );
TEST_EQUAL( 0, mbedtls_gcm_update_ad( ctx, add->x, add->len ) );
- for( n = 0; n < cipher_update_count; n += 1 )
+ for( n = 0; n < cipher_update_count; n++ )
{
olen = 0xdeadbeef;
TEST_EQUAL( 0, mbedtls_gcm_update( ctx, NULL, 0, NULL, 0, &olen ) );