mirror of https://github.com/ARMmbed/mbed-os.git
Correct typos and code alignment
parent
9d5d60b62e
commit
6370a3500d
|
@ -153,8 +153,7 @@ MBEDTLS_DEPRECATED void mbedtls_sha512_finish( mbedtls_sha512_context *ctx,
|
||||||
* \param ctx The SHA-512 context.
|
* \param ctx The SHA-512 context.
|
||||||
* \param data The buffer holding one block of data.
|
* \param data The buffer holding one block of data.
|
||||||
*/
|
*/
|
||||||
MBEDTLS_DEPRECATED void mbedtls_sha512_process(
|
MBEDTLS_DEPRECATED void mbedtls_sha512_process( mbedtls_sha512_context *ctx,
|
||||||
mbedtls_sha512_context *ctx,
|
|
||||||
const unsigned char data[128] );
|
const unsigned char data[128] );
|
||||||
|
|
||||||
#undef MBEDTLS_DEPRECATED
|
#undef MBEDTLS_DEPRECATED
|
||||||
|
|
|
@ -105,7 +105,7 @@ int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx )
|
||||||
return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED;
|
return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
if (st_md5_save_hw_context(ctx) != 1) {
|
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 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] )
|
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) {
|
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;
|
return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
if (HAL_HASH_MD5_Accumulate(&ctx->hhash_md5, (uint8_t *)data, ST_MD5_BLOCK_SIZE) != 0) {
|
if (HAL_HASH_MD5_Accumulate(&ctx->hhash_md5, (uint8_t *)data, ST_MD5_BLOCK_SIZE) != 0) {
|
||||||
return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED;
|
return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
if (st_md5_save_hw_context(ctx) != 1) {
|
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 MBEDTLS_ERR_MD5_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
return 0;
|
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 ilen = 0 : do nothing */
|
||||||
if (currentlen != 0) {
|
if (currentlen != 0) {
|
||||||
if (st_md5_restore_hw_context(ctx) != 1) {
|
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;
|
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) {
|
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 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] )
|
int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx, unsigned char output[16] )
|
||||||
{
|
{
|
||||||
if (st_md5_restore_hw_context(ctx) != 1) {
|
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;
|
return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
/* Last accumulation for extra bytes in sbuf_len */
|
/* 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;
|
return MBEDTLS_ERR_MD5_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
if (st_md5_save_hw_context(ctx) != 1) {
|
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 MBEDTLS_ERR_MD5_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -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] )
|
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) {
|
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;
|
return MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
if (ctx->is224 == 0) {
|
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) {
|
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 MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -139,7 +139,7 @@ int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx, const unsigned char
|
||||||
int err;
|
int err;
|
||||||
size_t currentlen = ilen;
|
size_t currentlen = ilen;
|
||||||
if (st_sha256_restore_hw_context(ctx) != 1) {
|
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;
|
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) {
|
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 MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
return 0;
|
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] )
|
int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx, unsigned char output[32] )
|
||||||
{
|
{
|
||||||
if (st_sha256_restore_hw_context(ctx) != 1) {
|
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;
|
return MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
/* Last accumulation for extra bytes in sbuf_len */
|
/* 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) {
|
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 MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue