Skip to content

Commit 0a53cb3

Browse files
committed
addressed code review
add missing Dma handling
1 parent 63e5225 commit 0a53cb3

File tree

7 files changed

+424
-14
lines changed

7 files changed

+424
-14
lines changed

benchmark/bench_modules/wh_bench_mod_sha2.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ int wh_Bench_Mod_Sha256Dma(whClientContext* client, whBenchOpContext* ctx,
152152
int _benchSha224(whClientContext* client, whBenchOpContext* ctx, int id,
153153
int devId)
154154
{
155+
(void)client;
156+
155157
int ret = 0;
156158
wc_Sha224 sha224[1];
157159
uint8_t out[WC_SHA224_DIGEST_SIZE];
@@ -238,8 +240,13 @@ int wh_Bench_Mod_Sha224(whClientContext* client, whBenchOpContext* ctx, int id,
238240
void* params)
239241
{
240242
#if defined(WOLFHSM_CFG_DMA)
243+
(void)params;
241244
return _benchSha224(client, ctx, id, WH_DEV_ID);
242245
#else
246+
(void)client;
247+
(void)ctx;
248+
(void)id;
249+
(void)params;
243250
return WH_ERROR_NOTIMPL;
244251
#endif
245252
}
@@ -248,8 +255,13 @@ int wh_Bench_Mod_Sha224Dma(whClientContext* client, whBenchOpContext* ctx,
248255
int id, void* params)
249256
{
250257
#if defined(WOLFHSM_CFG_DMA)
258+
(void)params;
251259
return _benchSha224(client, ctx, id, WH_DEV_ID_DMA);
252260
#else
261+
(void)client;
262+
(void)ctx;
263+
(void)id;
264+
(void)params;
253265
return WH_ERROR_NOTIMPL;
254266
#endif
255267
}
@@ -261,6 +273,8 @@ int wh_Bench_Mod_Sha224Dma(whClientContext* client, whBenchOpContext* ctx,
261273
int _benchSha384(whClientContext* client, whBenchOpContext* ctx, int id,
262274
int devId)
263275
{
276+
(void)client;
277+
264278
int ret = 0;
265279
wc_Sha384 sha384[1];
266280
uint8_t out[WC_SHA384_DIGEST_SIZE];
@@ -347,8 +361,13 @@ int wh_Bench_Mod_Sha384(whClientContext* client, whBenchOpContext* ctx, int id,
347361
void* params)
348362
{
349363
#if defined(WOLFHSM_CFG_DMA)
364+
(void)params;
350365
return _benchSha384(client, ctx, id, WH_DEV_ID);
351366
#else
367+
(void)client;
368+
(void)ctx;
369+
(void)id;
370+
(void)params;
352371
return WH_ERROR_NOTIMPL;
353372
#endif
354373
}
@@ -357,8 +376,13 @@ int wh_Bench_Mod_Sha384Dma(whClientContext* client, whBenchOpContext* ctx,
357376
int id, void* params)
358377
{
359378
#if defined(WOLFHSM_CFG_DMA)
379+
(void)params;
360380
return _benchSha384(client, ctx, id, WH_DEV_ID_DMA);
361381
#else
382+
(void)client;
383+
(void)ctx;
384+
(void)id;
385+
(void)params;
362386
return WH_ERROR_NOTIMPL;
363387
#endif
364388
}
@@ -369,6 +393,8 @@ int wh_Bench_Mod_Sha384Dma(whClientContext* client, whBenchOpContext* ctx,
369393
int _benchSha512(whClientContext* client, whBenchOpContext* ctx, int id,
370394
int devId)
371395
{
396+
(void)client;
397+
372398
int ret = 0;
373399
wc_Sha512 sha512[1];
374400
uint8_t out[WC_SHA512_DIGEST_SIZE];
@@ -455,8 +481,13 @@ int wh_Bench_Mod_Sha512(whClientContext* client, whBenchOpContext* ctx, int id,
455481
void* params)
456482
{
457483
#if defined(WOLFHSM_CFG_DMA)
484+
(void)params;
458485
return _benchSha512(client, ctx, id, WH_DEV_ID);
459486
#else
487+
(void)client;
488+
(void)ctx;
489+
(void)id;
490+
(void)params;
460491
return WH_ERROR_NOTIMPL;
461492
#endif
462493
}
@@ -465,8 +496,13 @@ int wh_Bench_Mod_Sha512Dma(whClientContext* client, whBenchOpContext* ctx,
465496
int id, void* params)
466497
{
467498
#if defined(WOLFHSM_CFG_DMA)
499+
(void)params;
468500
return _benchSha512(client, ctx, id, WH_DEV_ID_DMA);
469501
#else
502+
(void)client;
503+
(void)ctx;
504+
(void)id;
505+
(void)params;
470506
return WH_ERROR_NOTIMPL;
471507
#endif
472508
}

benchmark/wh_bench.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ static BenchModule g_benchModules[] = {
277277
#if defined(WOLFSSL_SHA512)
278278
[BENCH_MODULE_IDX_SHA2_512] = {"SHA2-512", wh_Bench_Mod_Sha512, BENCH_THROUGHPUT_XBPS, 0, NULL},
279279
[BENCH_MODULE_IDX_SHA2_512_DMA] = {"SHA2-512-DMA", wh_Bench_Mod_Sha512Dma, BENCH_THROUGHPUT_XBPS, 0, NULL},
280-
#endif /* WOLFSSL_SHA384 */
280+
#endif /* WOLFSSL_SHA512 */
281281
/* SHA3 */
282282
#if defined(WOLFSSL_SHA3)
283283
[BENCH_MODULE_IDX_SHA3_256] = {"SHA3-256", wh_Bench_Mod_Sha3256, BENCH_THROUGHPUT_NONE, 0, NULL},

0 commit comments

Comments
 (0)