Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 2 additions & 33 deletions benchmark/bench_modules/wh_bench_mod_sha2.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int _benchSha256(whClientContext* client, whBenchOpContext* ctx, int id,
ret = wh_Bench_SetDataSize(ctx, id, inLen);
if (ret != 0) {
WH_BENCH_PRINTF("Failed to wh_Bench_SetDataSize %d\n", ret);
return ret;
goto exit;
}

for (i = 0; i < WOLFHSM_CFG_BENCH_CRYPT_ITERS; i++) {
Expand Down Expand Up @@ -136,6 +136,7 @@ int _benchSha256(whClientContext* client, whBenchOpContext* ctx, int id,
}
}

exit:
/* Only free SHA256 if it was initialized */
if (sha256Initialized) {
(void)wc_Sha256Free(sha256);
Expand All @@ -156,16 +157,8 @@ int _benchSha256(whClientContext* client, whBenchOpContext* ctx, int id,
int wh_Bench_Mod_Sha256(whClientContext* client, whBenchOpContext* ctx, int id,
void* params)
{
#if defined(WOLFHSM_CFG_DMA)
(void)params;
return _benchSha256(client, ctx, id, 0);
#else
(void)client;
(void)ctx;
(void)id;
(void)params;
return WH_ERROR_NOTIMPL;
#endif
}

int wh_Bench_Mod_Sha256Dma(whClientContext* client, whBenchOpContext* ctx,
Expand Down Expand Up @@ -278,16 +271,8 @@ int _benchSha224(whClientContext* client, whBenchOpContext* ctx, int id,
int wh_Bench_Mod_Sha224(whClientContext* client, whBenchOpContext* ctx, int id,
void* params)
{
#if defined(WOLFHSM_CFG_DMA)
(void)params;
return _benchSha224(client, ctx, id, 0);
#else
(void)client;
(void)ctx;
(void)id;
(void)params;
return WH_ERROR_NOTIMPL;
#endif
}

int wh_Bench_Mod_Sha224Dma(whClientContext* client, whBenchOpContext* ctx,
Expand Down Expand Up @@ -399,16 +384,8 @@ int _benchSha384(whClientContext* client, whBenchOpContext* ctx, int id,
int wh_Bench_Mod_Sha384(whClientContext* client, whBenchOpContext* ctx, int id,
void* params)
{
#if defined(WOLFHSM_CFG_DMA)
(void)params;
return _benchSha384(client, ctx, id, 0);
#else
(void)client;
(void)ctx;
(void)id;
(void)params;
return WH_ERROR_NOTIMPL;
#endif
}

int wh_Bench_Mod_Sha384Dma(whClientContext* client, whBenchOpContext* ctx,
Expand Down Expand Up @@ -519,16 +496,8 @@ int _benchSha512(whClientContext* client, whBenchOpContext* ctx, int id,
int wh_Bench_Mod_Sha512(whClientContext* client, whBenchOpContext* ctx, int id,
void* params)
{
#if defined(WOLFHSM_CFG_DMA)
(void)params;
return _benchSha512(client, ctx, id, 0);
#else
(void)client;
(void)ctx;
(void)id;
(void)params;
return WH_ERROR_NOTIMPL;
#endif
}

int wh_Bench_Mod_Sha512Dma(whClientContext* client, whBenchOpContext* ctx,
Expand Down
Loading