Skip to content

Commit 3de3c55

Browse files
authored
Merge pull request #141 from billphipps/fix_wextra
2 parents e0b2019 + 19c9f7c commit 3de3c55

34 files changed

+494
-7
lines changed

benchmark/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ARCHFLAGS ?=
3232

3333
# Compiler and linker flags
3434
ASFLAGS ?= $(ARCHFLAGS)
35-
CFLAGS_EXTRA ?= -Wmissing-field-initializers -Wmissing-braces
35+
CFLAGS_EXTRA ?= -Wmissing-field-initializers -Wmissing-braces -Wextra
3636
CFLAGS ?= $(ARCHFLAGS) -std=$(CSTD) -D_GNU_SOURCE -Wall -Werror -Wno-cpp $(CFLAGS_EXTRA)
3737
LDFLAGS ?= $(ARCHFLAGS)
3838

benchmark/bench_modules/wh_bench_mod_aes.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,40 @@ enum { DECRYPT = 0, ENCRYPT = 1 };
4444
int wh_Bench_Mod_Aes128ECBEncrypt(whClientContext* client,
4545
whBenchOpContext* ctx, int id, void* params)
4646
{
47+
(void)client;
48+
(void)ctx;
49+
(void)id;
50+
(void)params;
4751
return WH_ERROR_NOTIMPL;
4852
}
4953

5054
int wh_Bench_Mod_Aes128ECBDecrypt(whClientContext* client,
5155
whBenchOpContext* ctx, int id, void* params)
5256
{
57+
(void)client;
58+
(void)ctx;
59+
(void)id;
60+
(void)params;
5361
return WH_ERROR_NOTIMPL;
5462
}
5563

5664
int wh_Bench_Mod_Aes256ECBEncrypt(whClientContext* client,
5765
whBenchOpContext* ctx, int id, void* params)
5866
{
67+
(void)client;
68+
(void)ctx;
69+
(void)id;
70+
(void)params;
5971
return WH_ERROR_NOTIMPL;
6072
}
6173

6274
int wh_Bench_Mod_Aes256ECBDecrypt(whClientContext* client,
6375
whBenchOpContext* ctx, int id, void* params)
6476
{
77+
(void)client;
78+
(void)ctx;
79+
(void)id;
80+
(void)params;
6581
return WH_ERROR_NOTIMPL;
6682
}
6783
#endif /* HAVE_AES_ECB */
@@ -171,27 +187,31 @@ static int _benchAesCbc(whClientContext* client, whBenchOpContext* ctx, int id,
171187
int wh_Bench_Mod_Aes128CBCEncrypt(whClientContext* client,
172188
whBenchOpContext* ctx, int id, void* params)
173189
{
190+
(void)params;
174191
return _benchAesCbc(client, ctx, id, (uint8_t*)key128, sizeof(key128),
175192
ENCRYPT);
176193
}
177194

178195
int wh_Bench_Mod_Aes128CBCDecrypt(whClientContext* client,
179196
whBenchOpContext* ctx, int id, void* params)
180197
{
198+
(void)params;
181199
return _benchAesCbc(client, ctx, id, (uint8_t*)key128, sizeof(key128),
182200
DECRYPT);
183201
}
184202

185203
int wh_Bench_Mod_Aes256CBCEncrypt(whClientContext* client,
186204
whBenchOpContext* ctx, int id, void* params)
187205
{
206+
(void)params;
188207
return _benchAesCbc(client, ctx, id, (uint8_t*)key256, sizeof(key256),
189208
ENCRYPT);
190209
}
191210

192211
int wh_Bench_Mod_Aes256CBCDecrypt(whClientContext* client,
193212
whBenchOpContext* ctx, int id, void* params)
194213
{
214+
(void)params;
195215
return _benchAesCbc(client, ctx, id, (uint8_t*)key256, sizeof(key256),
196216
DECRYPT);
197217
}
@@ -328,27 +348,31 @@ static int _benchAesGcm(whClientContext* client, whBenchOpContext* ctx, int id,
328348
int wh_Bench_Mod_Aes128GCMEncrypt(whClientContext* client,
329349
whBenchOpContext* ctx, int id, void* params)
330350
{
351+
(void)params;
331352
return _benchAesGcm(client, ctx, id, (uint8_t*)key128, sizeof(key128),
332353
ENCRYPT);
333354
}
334355

335356
int wh_Bench_Mod_Aes128GCMDecrypt(whClientContext* client,
336357
whBenchOpContext* ctx, int id, void* params)
337358
{
359+
(void)params;
338360
return _benchAesGcm(client, ctx, id, (uint8_t*)key128, sizeof(key128),
339361
DECRYPT);
340362
}
341363

342364
int wh_Bench_Mod_Aes256GCMEncrypt(whClientContext* client,
343365
whBenchOpContext* ctx, int id, void* params)
344366
{
367+
(void)params;
345368
return _benchAesGcm(client, ctx, id, (uint8_t*)key256, sizeof(key256),
346369
ENCRYPT);
347370
}
348371

349372
int wh_Bench_Mod_Aes256GCMDecrypt(whClientContext* client,
350373
whBenchOpContext* ctx, int id, void* params)
351374
{
375+
(void)params;
352376
return _benchAesGcm(client, ctx, id, (uint8_t*)key256, sizeof(key256),
353377
DECRYPT);
354378
}

benchmark/bench_modules/wh_bench_mod_cmac.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,33 +139,45 @@ int _benchCmacAes(whClientContext* client, whBenchOpContext* ctx, int id,
139139
int wh_Bench_Mod_CmacAes128(whClientContext* client, whBenchOpContext* ctx,
140140
int id, void* params)
141141
{
142+
(void)params;
142143
return _benchCmacAes(client, ctx, id, key128, sizeof(key128), WH_DEV_ID);
143144
}
144145

145146
int wh_Bench_Mod_CmacAes128Dma(whClientContext* client, whBenchOpContext* ctx,
146147
int id, void* params)
147148
{
148149
#if defined(WOLFHSM_CFG_DMA)
150+
(void)params;
149151
return _benchCmacAes(client, ctx, id, key128, sizeof(key128),
150152
WH_DEV_ID_DMA);
151153
#else
154+
(void)client;
155+
(void)ctx;
156+
(void)id;
157+
(void)params;
152158
return WH_ERROR_NOTIMPL;
153159
#endif
154160
}
155161

156162
int wh_Bench_Mod_CmacAes256(whClientContext* client, whBenchOpContext* ctx,
157163
int id, void* params)
158164
{
165+
(void)params;
159166
return _benchCmacAes(client, ctx, id, key256, sizeof(key256), WH_DEV_ID);
160167
}
161168

162169
int wh_Bench_Mod_CmacAes256Dma(whClientContext* client, whBenchOpContext* ctx,
163170
int id, void* params)
164171
{
165172
#if defined(WOLFHSM_CFG_DMA)
173+
(void)params;
166174
return _benchCmacAes(client, ctx, id, key256, sizeof(key256),
167175
WH_DEV_ID_DMA);
168176
#else
177+
(void)client;
178+
(void)ctx;
179+
(void)id;
180+
(void)params;
169181
return WH_ERROR_NOTIMPL;
170182
#endif
171183
}

benchmark/bench_modules/wh_bench_mod_curve25519.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ uint8_t key2_der[] = {
5252
int wh_Bench_Mod_Curve25519KeyGen(whClientContext* client,
5353
whBenchOpContext* ctx, int id, void* params)
5454
{
55+
(void)client;
56+
(void)params;
57+
5558
int ret = 0;
5659
curve25519_key key[1] = {0};
5760
WC_RNG rng[1] = {0};
@@ -123,6 +126,8 @@ int wh_Bench_Mod_Curve25519SharedSecret(whClientContext* client,
123126
whBenchOpContext* ctx, int id,
124127
void* params)
125128
{
129+
(void)params;
130+
126131
int ret = 0;
127132
word32 outLen;
128133
curve25519_key keyAlice[1] = {0};

benchmark/bench_modules/wh_bench_mod_ecc.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ int _benchEccVerify(whClientContext* client, whBenchOpContext* ctx, int id,
292292
int _benchEccKeyGen(whClientContext* client, whBenchOpContext* ctx, int id,
293293
int curveSize, int devId)
294294
{
295+
(void)client;
296+
295297
int ret = 0;
296298
ecc_key key[1] = {0};
297299
WC_RNG rng[1] = {0};
@@ -514,38 +516,50 @@ int _benchEccEcdh(whClientContext* client, whBenchOpContext* ctx, int id,
514516
int wh_Bench_Mod_EccP256Sign(whClientContext* client, whBenchOpContext* ctx,
515517
int id, void* params)
516518
{
519+
(void)params;
517520
return _benchEccSign(client, ctx, id, aliceKeyDer, sizeof(aliceKeyDer), 32,
518521
WH_DEV_ID);
519522
}
520523

521524
int wh_Bench_Mod_EccP256SignDma(whClientContext* client, whBenchOpContext* ctx,
522525
int id, void* params)
523526
{
527+
(void)client;
528+
(void)ctx;
529+
(void)id;
530+
(void)params;
524531
return WH_ERROR_NOTIMPL;
525532
}
526533

527534
int wh_Bench_Mod_EccP256Verify(whClientContext* client, whBenchOpContext* ctx,
528535
int id, void* params)
529536
{
537+
(void)params;
530538
return _benchEccVerify(client, ctx, id, aliceKeyDer, sizeof(aliceKeyDer),
531539
32, WH_DEV_ID);
532540
}
533541

534542
int wh_Bench_Mod_EccP256VerifyDma(whClientContext* client,
535543
whBenchOpContext* ctx, int id, void* params)
536544
{
545+
(void)client;
546+
(void)ctx;
547+
(void)id;
548+
(void)params;
537549
return WH_ERROR_NOTIMPL;
538550
}
539551

540552
int wh_Bench_Mod_EccP256KeyGen(whClientContext* client, whBenchOpContext* ctx,
541553
int id, void* params)
542554
{
555+
(void)params;
543556
return _benchEccKeyGen(client, ctx, id, 32, WH_DEV_ID);
544557
}
545558

546559
int wh_Bench_Mod_EccP256Ecdh(whClientContext* client, whBenchOpContext* ctx,
547560
int id, void* params)
548561
{
562+
(void)params;
549563
return _benchEccEcdh(client, ctx, id, aliceKeyDer, sizeof(aliceKeyDer),
550564
bobKeyDer, sizeof(bobKeyDer), 32, WH_DEV_ID);
551565
}

benchmark/bench_modules/wh_bench_mod_echo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
int wh_Bench_Mod_Echo(whClientContext* client, whBenchOpContext* benchCtx,
2626
int id, void* params)
2727
{
28+
(void)params;
29+
2830
int i;
2931
int ret;
3032
uint16_t send_len;

benchmark/bench_modules/wh_bench_mod_hmac.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ static const size_t keyLen = sizeof(key) - 1; /* -1 for null terminator */
3535
int _benchHmacSha256(whClientContext* client, whBenchOpContext* ctx, int id,
3636
int devId)
3737
{
38+
(void)client;
39+
3840
int ret = 0;
3941
Hmac hmac[1];
4042
uint8_t out[WC_SHA256_DIGEST_SIZE];
@@ -127,15 +129,21 @@ int _benchHmacSha256(whClientContext* client, whBenchOpContext* ctx, int id,
127129
int wh_Bench_Mod_HmacSha256(whClientContext* client, whBenchOpContext* ctx,
128130
int id, void* params)
129131
{
132+
(void)params;
130133
return _benchHmacSha256(client, ctx, id, WH_DEV_ID);
131134
}
132135

133136
int wh_Bench_Mod_HmacSha256Dma(whClientContext* client, whBenchOpContext* ctx,
134137
int id, void* params)
135138
{
136139
#if defined(WOLFHSM_CFG_DMA)
140+
(void)params;
137141
return _benchHmacSha256(client, ctx, id, WH_DEV_ID_DMA);
138142
#else
143+
(void)client;
144+
(void)ctx;
145+
(void)id;
146+
(void)params;
139147
return WH_ERROR_NOTIMPL;
140148
#endif
141149
}
@@ -147,12 +155,20 @@ int wh_Bench_Mod_HmacSha256Dma(whClientContext* client, whBenchOpContext* ctx,
147155
int wh_Bench_Mod_HmacSha3256(whClientContext* client, whBenchOpContext* ctx,
148156
int id, void* params)
149157
{
158+
(void)client;
159+
(void)ctx;
160+
(void)id;
161+
(void)params;
150162
return WH_ERROR_NOTIMPL;
151163
}
152164

153165
int wh_Bench_Mod_HmacSha3256Dma(whClientContext* client, whBenchOpContext* ctx,
154166
int id, void* params)
155167
{
168+
(void)client;
169+
(void)ctx;
170+
(void)id;
171+
(void)params;
156172
return WH_ERROR_NOTIMPL;
157173
}
158174

0 commit comments

Comments
 (0)