mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
Prepare for PR Add Sha224 and RipeMd to unit test.
This commit is contained in:
@@ -1018,7 +1018,7 @@ int benchmark_test(void *args)
|
|||||||
|
|
||||||
bench_stats_free();
|
bench_stats_free();
|
||||||
|
|
||||||
if (wolfCrypt_Cleanup() != 0) {
|
if (wolfCrypt_Cleanup() != 0) {
|
||||||
printf("error with wolfCrypt_Cleanup\n");
|
printf("error with wolfCrypt_Cleanup\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2080,20 +2080,20 @@ int bench_ripemd(void)
|
|||||||
do {
|
do {
|
||||||
for (i = 0; i < numBlocks; i++) {
|
for (i = 0; i < numBlocks; i++) {
|
||||||
ret = wc_RipeMdUpdate(&hash, bench_plain, BENCH_SIZE);
|
ret = wc_RipeMdUpdate(&hash, bench_plain, BENCH_SIZE);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = wc_RipeMdFinal(&hash, digest);
|
ret = wc_RipeMdFinal(&hash, digest);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
count += i;
|
count += i;
|
||||||
} while (bench_stats_sym_check(start));
|
} while (bench_stats_sym_check(start));
|
||||||
bench_stats_sym_finish("RIPEMD", 0, count, start);
|
bench_stats_sym_finish("RIPEMD", 0, count, start);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -1427,24 +1427,24 @@ int ripemd_test(void)
|
|||||||
test_ripemd[3] = d;
|
test_ripemd[3] = d;
|
||||||
|
|
||||||
ret = wc_InitRipeMd(&ripemd);
|
ret = wc_InitRipeMd(&ripemd);
|
||||||
if (ret) {
|
if (ret != 0) {
|
||||||
return ret;
|
return -1800;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < times; ++i) {
|
for (i = 0; i < times; ++i) {
|
||||||
ret = wc_RipeMdUpdate(&ripemd, (byte*)test_ripemd[i].input,
|
ret = wc_RipeMdUpdate(&ripemd, (byte*)test_ripemd[i].input,
|
||||||
(word32)test_ripemd[i].inLen);
|
(word32)test_ripemd[i].inLen);
|
||||||
if (ret) {
|
if (ret != 0) {
|
||||||
return ret;
|
return -1810 - i;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = wc_RipeMdFinal(&ripemd, hash);
|
ret = wc_RipeMdFinal(&ripemd, hash);
|
||||||
if (ret) {
|
if (ret != 0) {
|
||||||
return ret;
|
return -1820 - i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XMEMCMP(hash, test_ripemd[i].output, RIPEMD_DIGEST_SIZE) != 0)
|
if (XMEMCMP(hash, test_ripemd[i].output, RIPEMD_DIGEST_SIZE) != 0)
|
||||||
return -1800 - i;
|
return -1830 - i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user