From 77ac61c0f47c2dd06d1c8f530713529517481d08 Mon Sep 17 00:00:00 2001 From: jrblixt Date: Thu, 18 May 2017 10:32:37 -0600 Subject: [PATCH] Prepare for PR Add Sha224 and RipeMd to unit test. --- wolfcrypt/benchmark/benchmark.c | 16 ++++++++-------- wolfcrypt/test/test.c | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 80018c149..2c7372dad 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -1018,7 +1018,7 @@ int benchmark_test(void *args) bench_stats_free(); - if (wolfCrypt_Cleanup() != 0) { + if (wolfCrypt_Cleanup() != 0) { printf("error with wolfCrypt_Cleanup\n"); } @@ -2080,20 +2080,20 @@ int bench_ripemd(void) do { for (i = 0; i < numBlocks; i++) { ret = wc_RipeMdUpdate(&hash, bench_plain, BENCH_SIZE); - if (ret != 0) { - return ret; - } + if (ret != 0) { + return ret; + } } ret = wc_RipeMdFinal(&hash, digest); - if (ret != 0) { - return ret; - } + if (ret != 0) { + return ret; + } count += i; } while (bench_stats_sym_check(start)); bench_stats_sym_finish("RIPEMD", 0, count, start); - return 0; + return 0; } #endif diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index fd4c68948..b91e8874d 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -1427,24 +1427,24 @@ int ripemd_test(void) test_ripemd[3] = d; ret = wc_InitRipeMd(&ripemd); - if (ret) { - return ret; + if (ret != 0) { + return -1800; } for (i = 0; i < times; ++i) { ret = wc_RipeMdUpdate(&ripemd, (byte*)test_ripemd[i].input, (word32)test_ripemd[i].inLen); - if (ret) { - return ret; + if (ret != 0) { + return -1810 - i; } ret = wc_RipeMdFinal(&ripemd, hash); - if (ret) { - return ret; + if (ret != 0) { + return -1820 - i; } if (XMEMCMP(hash, test_ripemd[i].output, RIPEMD_DIGEST_SIZE) != 0) - return -1800 - i; + return -1830 - i; } return 0;