Skip to content

Commit 92eed63

Browse files
Svelarhzhuang1
authored andcommittedJun 27, 2024
uadk_tool/benchmark: skip sm4 benchmark if openssl with 'no-sm4'
When openssl is with 'no-sm4', which cause macro 'OPENSSL_NO_SM4' is defined. So sm4 benchmark should check the macro too, otherwise build would be failed. Signed-off-by: Rongqi Sun <sunrongqi@huawei.com>
1 parent fa2980a commit 92eed63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎uadk_tool/benchmark/sec_soft_benchmark.c

+4
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ static int sec_soft_param_parse(soft_thread *tddata, struct acc_option *options)
280280
mode = WD_CIPHER_CBC;
281281
tddata->evp_cipher = EVP_des_ede3_cbc();
282282
break;
283+
#ifndef OPENSSL_NO_SM4
283284
case SM4_128_ECB:
284285
keysize = 16;
285286
mode = WD_CIPHER_ECB;
@@ -309,6 +310,7 @@ static int sec_soft_param_parse(soft_thread *tddata, struct acc_option *options)
309310
keysize = 16;
310311
mode = WD_CIPHER_XTS;
311312
break;
313+
#endif
312314
case AES_128_CCM:
313315
keysize = 16;
314316
mode = WD_CIPHER_CCM;
@@ -354,6 +356,7 @@ static int sec_soft_param_parse(soft_thread *tddata, struct acc_option *options)
354356
mode = WD_CIPHER_CBC;
355357
tddata->evp_cipher = EVP_aes_256_cbc();
356358
break;
359+
#ifndef OPENSSL_NO_SM4
357360
case SM4_128_CCM:
358361
keysize = 16;
359362
mode = WD_CIPHER_CCM;
@@ -362,6 +365,7 @@ static int sec_soft_param_parse(soft_thread *tddata, struct acc_option *options)
362365
keysize = 16;
363366
mode = WD_CIPHER_GCM;
364367
break;
368+
#endif
365369
case SM3_ALG: // digest mode is optype
366370
keysize = 4;
367371
mode = optype;

0 commit comments

Comments
 (0)