
uadk_tool benchmark supports AES_256_GCM, AES_256_CBC_SHA256_HMAC, AES_128_CBC_SHA1_HMAC and SM4_CBC_SM3_HMAC algorithms. Signed-off-by: Qi Tao <taoqi10@huawei.com> --- uadk_tool/benchmark/sec_uadk_benchmark.c | 34 ++++++++++++++++++++++++ uadk_tool/benchmark/sec_wd_benchmark.c | 34 ++++++++++++++++++++++++ uadk_tool/benchmark/uadk_benchmark.c | 2 ++ uadk_tool/benchmark/uadk_benchmark.h | 2 ++ 4 files changed, 72 insertions(+) diff --git a/uadk_tool/benchmark/sec_uadk_benchmark.c b/uadk_tool/benchmark/sec_uadk_benchmark.c index 7cc3f4a4..acfd833e 100644 --- a/uadk_tool/benchmark/sec_uadk_benchmark.c +++ b/uadk_tool/benchmark/sec_uadk_benchmark.c @@ -82,10 +82,26 @@ struct aead_alg_info aead_info[] = { .index = AES_128_GCM, .name = "AES_128_GCM", .mac_len = 16, + }, { + .index = AES_256_GCM, + .name = "AES_256_GCM", + .mac_len = 16, }, { .index = AES_128_CBC_SHA256_HMAC, .name = "AES_128_CBC_SHA256_HMAC", .mac_len = 32, + }, { + .index = AES_256_CBC_SHA256_HMAC, + .name = "AES_256_CBC_SHA256_HMAC", + .mac_len = 32, + }, { + .index = AES_128_CBC_SHA1_HMAC, + .name = "AES_128_CBC_SHA1_HMAC", + .mac_len = 20, + }, { + .index = SM4_CBC_SM3_HMAC, + .name = "SM4_CBC_SM3_HMAC", + .mac_len = 32, }, { .index = SM4_128_GCM, .name = "SM4_128_GCM", @@ -459,6 +475,24 @@ static int sec_uadk_param_parse(thread_data *tddata, struct acc_option *options) dalg = WD_DIGEST_SHA256; dmode = WD_DIGEST_HMAC; break; + case AES_128_CBC_SHA1_HMAC: + keysize = 16; + ivsize = 16; + mode = WD_CIPHER_CBC; + alg = WD_CIPHER_AES; + is_union = true; + dalg = WD_DIGEST_SHA1; + dmode = WD_DIGEST_HMAC; + break; + case SM4_CBC_SM3_HMAC: + keysize = 16; + ivsize = 16; + mode = WD_CIPHER_CBC; + alg = WD_CIPHER_SM4; + is_union = true; + dalg = WD_DIGEST_SM3; + dmode = WD_DIGEST_HMAC; + break; case SM4_128_CCM: keysize = 16; ivsize = 16; diff --git a/uadk_tool/benchmark/sec_wd_benchmark.c b/uadk_tool/benchmark/sec_wd_benchmark.c index f066a5b9..a3d62cd3 100644 --- a/uadk_tool/benchmark/sec_wd_benchmark.c +++ b/uadk_tool/benchmark/sec_wd_benchmark.c @@ -79,10 +79,26 @@ static struct aead_alg_info wd_aead_info[] = { .index = AES_128_GCM, .name = "AES_128_GCM", .mac_len = 16, + }, { + .index = AES_256_GCM, + .name = "AES_256_GCM", + .mac_len = 16, }, { .index = AES_128_CBC_SHA256_HMAC, .name = "AES_128_CBC_SHA256_HMAC", .mac_len = 32, + }, { + .index = AES_256_CBC_SHA256_HMAC, + .name = "AES_256_CBC_SHA256_HMAC", + .mac_len = 32, + }, { + .index = AES_128_CBC_SHA1_HMAC, + .name = "AES_128_CBC_SHA1_HMAC", + .mac_len = 20, + }, { + .index = SM4_CBC_SM3_HMAC, + .name = "SM4_CBC_SM3_HMAC", + .mac_len = 32, }, { .index = SM4_128_GCM, .name = "SM4_128_GCM", @@ -523,6 +539,24 @@ static int sec_wd_param_parse(thread_data *tddata, struct acc_option *options) dalg = WCRYPTO_SHA256; dmode = WCRYPTO_DIGEST_HMAC; break; + case AES_128_CBC_SHA1_HMAC: + keysize = 16; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC; + alg = WCRYPTO_CIPHER_AES; + is_union = true; + dalg = WCRYPTO_SHA1; + dmode = WCRYPTO_DIGEST_HMAC; + break; + case SM4_CBC_SM3_HMAC: + keysize = 16; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC; + alg = WCRYPTO_CIPHER_SM4; + is_union = true; + dalg = WCRYPTO_SM3; + dmode = WCRYPTO_DIGEST_HMAC; + break; case SM4_128_CCM: keysize = 16; ivsize = 16; diff --git a/uadk_tool/benchmark/uadk_benchmark.c b/uadk_tool/benchmark/uadk_benchmark.c index ce9a1f2d..ffcf176a 100644 --- a/uadk_tool/benchmark/uadk_benchmark.c +++ b/uadk_tool/benchmark/uadk_benchmark.c @@ -144,6 +144,8 @@ static struct acc_alg_item alg_options[] = { {"authenc(generic,cbc(aes))", "aes-128-cbc-sha256-hmac", AES_128_CBC_SHA256_HMAC}, {"authenc(generic,cbc(aes))", "aes-192-cbc-sha256-hmac", AES_192_CBC_SHA256_HMAC}, {"authenc(generic,cbc(aes))", "aes-256-cbc-sha256-hmac", AES_256_CBC_SHA256_HMAC}, + {"authenc(generic,cbc(aes))", "aes-128-cbc-sha1-hmac", AES_128_CBC_SHA1_HMAC}, + {"authenc(generic,cbc(sm4))", "sm4-cbc-sm3-hmac", SM4_CBC_SM3_HMAC}, {"ccm(sm4)", "sm4-128-ccm", SM4_128_CCM}, {"gcm(sm4)", "sm4-128-gcm", SM4_128_GCM}, {"sm3", "sm3", SM3_ALG}, diff --git a/uadk_tool/benchmark/uadk_benchmark.h b/uadk_tool/benchmark/uadk_benchmark.h index 90df2ead..145bed67 100644 --- a/uadk_tool/benchmark/uadk_benchmark.h +++ b/uadk_tool/benchmark/uadk_benchmark.h @@ -195,6 +195,8 @@ enum test_alg { AES_128_CBC_SHA256_HMAC, AES_192_CBC_SHA256_HMAC, AES_256_CBC_SHA256_HMAC, + AES_128_CBC_SHA1_HMAC, + SM4_CBC_SM3_HMAC, SM4_128_CCM, SM4_128_GCM, SM3_ALG, // digest -- 2.33.0