Refactor macro-spanning if in sha256.c
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
21b89761f8
commit
687262ca7d
1 changed files with 3 additions and 1 deletions
|
@ -665,9 +665,11 @@ int mbedtls_sha256_finish( mbedtls_sha256_context *ctx,
|
||||||
MBEDTLS_PUT_UINT32_BE( ctx->state[5], output, 20 );
|
MBEDTLS_PUT_UINT32_BE( ctx->state[5], output, 20 );
|
||||||
MBEDTLS_PUT_UINT32_BE( ctx->state[6], output, 24 );
|
MBEDTLS_PUT_UINT32_BE( ctx->state[6], output, 24 );
|
||||||
|
|
||||||
|
int truncated = 0;
|
||||||
#if defined(MBEDTLS_SHA224_C)
|
#if defined(MBEDTLS_SHA224_C)
|
||||||
if( ctx->is224 == 0 )
|
truncated = ctx->is224;
|
||||||
#endif
|
#endif
|
||||||
|
if( !truncated )
|
||||||
MBEDTLS_PUT_UINT32_BE( ctx->state[7], output, 28 );
|
MBEDTLS_PUT_UINT32_BE( ctx->state[7], output, 28 );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue