1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

test: improved readability in sha self tests

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
Valerio Setti
2022-12-23 14:57:18 +01:00
parent e269750f0d
commit 326cf46764
2 changed files with 6 additions and 12 deletions

View File

@ -781,15 +781,12 @@ static int mbedtls_sha256_common_self_test( int verbose, int is224 )
unsigned char sha256sum[32];
mbedtls_sha256_context ctx;
sha_test_sum_t* sha_test_sum;
sha_test_sum =
#if defined(MBEDTLS_SHA224_C) && defined(MBEDTLS_SHA256_C)
( is224 ) ? sha224_test_sum : sha256_test_sum;
sha_test_sum_t* sha_test_sum = ( is224 ) ? sha224_test_sum : sha256_test_sum;
#elif defined(MBEDTLS_SHA256_C)
sha256_test_sum;
sha_test_sum_t* sha_test_sum = sha256_test_sum;
#else
sha224_test_sum;
sha_test_sum_t* sha_test_sum = sha224_test_sum;
#endif
buf = mbedtls_calloc( 1024, sizeof(unsigned char) );