From 6370a3500d5fa09245ce1c823a236b7acce4ead3 Mon Sep 17 00:00:00 2001 From: Krzysztof Stachowiak Date: Wed, 28 Feb 2018 17:03:47 +0100 Subject: [PATCH] Correct typos and code alignment --- .../TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h | 5 ++--- features/mbedtls/targets/TARGET_STM/md5_alt.c | 14 +++++++------- features/mbedtls/targets/TARGET_STM/sha256_alt.c | 12 ++++++------ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h index 46d566f05a..4a8c2c7c21 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha512_alt.h @@ -153,9 +153,8 @@ MBEDTLS_DEPRECATED void mbedtls_sha512_finish( mbedtls_sha512_context *ctx, * \param ctx The SHA-512 context. * \param data The buffer holding one block of data. */ -MBEDTLS_DEPRECATED void mbedtls_sha512_process( - mbedtls_sha512_context *ctx, - const unsigned char data[128] ); +MBEDTLS_DEPRECATED void mbedtls_sha512_process( mbedtls_sha512_context *ctx, + const unsigned char data[128] ); #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ diff --git a/features/mbedtls/targets/TARGET_STM/md5_alt.c b/features/mbedtls/targets/TARGET_STM/md5_alt.c index 7cb3ce6455..853d1db24e 100644 --- a/features/mbedtls/targets/TARGET_STM/md5_alt.c +++ b/features/mbedtls/targets/TARGET_STM/md5_alt.c @@ -105,7 +105,7 @@ int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx ) return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED; } if (st_md5_save_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED; } @@ -115,14 +115,14 @@ int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx ) int mbedtls_internal_md5_process( mbedtls_md5_context *ctx, const unsigned char data[ST_MD5_BLOCK_SIZE] ) { if (st_md5_restore_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED; } if (HAL_HASH_MD5_Accumulate(&ctx->hhash_md5, (uint8_t *)data, ST_MD5_BLOCK_SIZE) != 0) { return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED; } if (st_md5_save_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED; } return 0; @@ -135,7 +135,7 @@ int mbedtls_md5_update_ret( mbedtls_md5_context *ctx, const unsigned char *input /* If ilen = 0 : do nothing */ if (currentlen != 0) { if (st_md5_restore_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED; } @@ -167,7 +167,7 @@ int mbedtls_md5_update_ret( mbedtls_md5_context *ctx, const unsigned char *input } if (st_md5_save_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED; } } @@ -177,7 +177,7 @@ int mbedtls_md5_update_ret( mbedtls_md5_context *ctx, const unsigned char *input int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx, unsigned char output[16] ) { if (st_md5_restore_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED; } /* Last accumulation for extra bytes in sbuf_len */ @@ -194,7 +194,7 @@ int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx, unsigned char output[16] ) return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED; } if (st_md5_save_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED; } return 0; diff --git a/features/mbedtls/targets/TARGET_STM/sha256_alt.c b/features/mbedtls/targets/TARGET_STM/sha256_alt.c index 4e8c78b14a..620de52e29 100644 --- a/features/mbedtls/targets/TARGET_STM/sha256_alt.c +++ b/features/mbedtls/targets/TARGET_STM/sha256_alt.c @@ -114,7 +114,7 @@ int mbedtls_sha256_starts_ret( mbedtls_sha256_context *ctx, int is224 ) int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx, const unsigned char data[ST_SHA256_BLOCK_SIZE] ) { if (st_sha256_restore_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED; } if (ctx->is224 == 0) { @@ -128,7 +128,7 @@ int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx, const unsigned } if (st_sha256_save_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED; } return 0; @@ -139,7 +139,7 @@ int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx, const unsigned char int err; size_t currentlen = ilen; if (st_sha256_restore_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED; } @@ -187,7 +187,7 @@ int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx, const unsigned char } } if (st_sha256_save_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED; } return 0; @@ -196,7 +196,7 @@ int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx, const unsigned char int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx, unsigned char output[32] ) { if (st_sha256_restore_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED; } /* Last accumulation for extra bytes in sbuf_len */ @@ -225,7 +225,7 @@ int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx, unsigned char output } } if (st_sha256_save_hw_context(ctx) != 1) { - // Return HASH_BUSY timout error here + // Return HASH_BUSY timeout error here return MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED; } return 0;