Add test case for AES-CBC CTS mode, CS1/2/3, for both uadk v1 and uadk v2 in uadk_tool benchmark tool.
Use param such as '--alg aes-128-cbc-cs1' to enable cs1 mode test.
Use 'uadk_tool benchmark --alglist' to find the name of other modes.
Signed-off-by: Zhiqi Song songzhiqi1@huawei.com --- uadk_tool/benchmark/sec_uadk_benchmark.c | 54 ++++++++++++++++++++++++ uadk_tool/benchmark/sec_wd_benchmark.c | 54 ++++++++++++++++++++++++ uadk_tool/benchmark/uadk_benchmark.c | 18 ++++++++ uadk_tool/benchmark/uadk_benchmark.h | 9 ++++ 4 files changed, 135 insertions(+)
diff --git a/uadk_tool/benchmark/sec_uadk_benchmark.c b/uadk_tool/benchmark/sec_uadk_benchmark.c index 7828eab..f3fee4f 100644 --- a/uadk_tool/benchmark/sec_uadk_benchmark.c +++ b/uadk_tool/benchmark/sec_uadk_benchmark.c @@ -112,6 +112,60 @@ static int sec_uadk_param_parse(thread_data *tddata, struct acc_option *options) mode = WD_CIPHER_CBC; alg = WD_CIPHER_AES; break; + case AES_128_CBC_CS1: + keysize = 16; + ivsize = 16; + mode = WD_CIPHER_CBC_CS1; + alg = WD_CIPHER_AES; + break; + case AES_128_CBC_CS2: + keysize = 16; + ivsize = 16; + mode = WD_CIPHER_CBC_CS2; + alg = WD_CIPHER_AES; + break; + case AES_128_CBC_CS3: + keysize = 16; + ivsize = 16; + mode = WD_CIPHER_CBC_CS3; + alg = WD_CIPHER_AES; + break; + case AES_192_CBC_CS1: + keysize = 24; + ivsize = 16; + mode = WD_CIPHER_CBC_CS1; + alg = WD_CIPHER_AES; + break; + case AES_192_CBC_CS2: + keysize = 24; + ivsize = 16; + mode = WD_CIPHER_CBC_CS2; + alg = WD_CIPHER_AES; + break; + case AES_192_CBC_CS3: + keysize = 24; + ivsize = 16; + mode = WD_CIPHER_CBC_CS3; + alg = WD_CIPHER_AES; + break; + case AES_256_CBC_CS1: + keysize = 32; + ivsize = 16; + mode = WD_CIPHER_CBC_CS1; + alg = WD_CIPHER_AES; + break; + case AES_256_CBC_CS2: + keysize = 32; + ivsize = 16; + mode = WD_CIPHER_CBC_CS2; + alg = WD_CIPHER_AES; + break; + case AES_256_CBC_CS3: + keysize = 32; + ivsize = 16; + mode = WD_CIPHER_CBC_CS3; + alg = WD_CIPHER_AES; + break; case AES_128_CTR: keysize = 16; ivsize = 16; diff --git a/uadk_tool/benchmark/sec_wd_benchmark.c b/uadk_tool/benchmark/sec_wd_benchmark.c index 50c966c..b6efccf 100644 --- a/uadk_tool/benchmark/sec_wd_benchmark.c +++ b/uadk_tool/benchmark/sec_wd_benchmark.c @@ -116,6 +116,60 @@ static int sec_wd_param_parse(thread_data *tddata, struct acc_option *options) mode = WCRYPTO_CIPHER_CBC; alg = WCRYPTO_CIPHER_AES; break; + case AES_128_CBC_CS1: + keysize = 16; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC_CS1; + alg = WCRYPTO_CIPHER_AES; + break; + case AES_128_CBC_CS2: + keysize = 16; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC_CS2; + alg = WCRYPTO_CIPHER_AES; + break; + case AES_128_CBC_CS3: + keysize = 16; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC_CS3; + alg = WCRYPTO_CIPHER_AES; + break; + case AES_192_CBC_CS1: + keysize = 24; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC_CS1; + alg = WCRYPTO_CIPHER_AES; + break; + case AES_192_CBC_CS2: + keysize = 24; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC_CS2; + alg = WCRYPTO_CIPHER_AES; + break; + case AES_192_CBC_CS3: + keysize = 24; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC_CS3; + alg = WCRYPTO_CIPHER_AES; + break; + case AES_256_CBC_CS1: + keysize = 32; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC_CS1; + alg = WCRYPTO_CIPHER_AES; + break; + case AES_256_CBC_CS2: + keysize = 32; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC_CS2; + alg = WCRYPTO_CIPHER_AES; + break; + case AES_256_CBC_CS3: + keysize = 32; + ivsize = 16; + mode = WCRYPTO_CIPHER_CBC_CS3; + alg = WCRYPTO_CIPHER_AES; + break; case AES_128_CTR: keysize = 16; ivsize = 16; diff --git a/uadk_tool/benchmark/uadk_benchmark.c b/uadk_tool/benchmark/uadk_benchmark.c index 1524291..1078327 100644 --- a/uadk_tool/benchmark/uadk_benchmark.c +++ b/uadk_tool/benchmark/uadk_benchmark.c @@ -90,6 +90,15 @@ static struct acc_alg_item alg_options[] = { {"aes-128-cbc", AES_128_CBC}, {"aes-192-cbc", AES_192_CBC}, {"aes-256-cbc", AES_256_CBC}, + {"aes-128-cbc-cs1", AES_128_CBC_CS1}, + {"aes-128-cbc-cs2", AES_128_CBC_CS2}, + {"aes-128-cbc-cs3", AES_128_CBC_CS3}, + {"aes-192-cbc-cs1", AES_192_CBC_CS1}, + {"aes-192-cbc-cs2", AES_192_CBC_CS2}, + {"aes-192-cbc-cs3", AES_192_CBC_CS3}, + {"aes-256-cbc-cs1", AES_256_CBC_CS1}, + {"aes-256-cbc-cs2", AES_256_CBC_CS2}, + {"aes-256-cbc-cs3", AES_256_CBC_CS3}, {"aes-128-ctr", AES_128_CTR}, {"aes-192-ctr", AES_192_CTR}, {"aes-256-ctr", AES_256_CTR}, @@ -169,6 +178,15 @@ static struct acc_alg_item alg_name_options[] = { {"cbc(aes)", AES_128_CBC}, {"cbc(aes)", AES_192_CBC}, {"cbc(aes)", AES_256_CBC}, + {"cbc-cs1(aes)", AES_128_CBC_CS1}, + {"cbc-cs2(aes)", AES_128_CBC_CS2}, + {"cbc-cs3(aes)", AES_128_CBC_CS3}, + {"cbc-cs1(aes)", AES_192_CBC_CS1}, + {"cbc-cs2(aes)", AES_192_CBC_CS2}, + {"cbc-cs3(aes)", AES_192_CBC_CS3}, + {"cbc-cs1(aes)", AES_256_CBC_CS1}, + {"cbc-cs2(aes)", AES_256_CBC_CS2}, + {"cbc-cs3(aes)", AES_256_CBC_CS3}, {"ctr(aes)", AES_128_CTR}, {"ctr(aes)", AES_192_CTR}, {"ctr(aes)", AES_256_CTR}, diff --git a/uadk_tool/benchmark/uadk_benchmark.h b/uadk_tool/benchmark/uadk_benchmark.h index e75a99d..4ec6778 100644 --- a/uadk_tool/benchmark/uadk_benchmark.h +++ b/uadk_tool/benchmark/uadk_benchmark.h @@ -138,6 +138,15 @@ enum test_alg { AES_128_CBC, AES_192_CBC, AES_256_CBC, + AES_128_CBC_CS1, + AES_128_CBC_CS2, + AES_128_CBC_CS3, + AES_192_CBC_CS1, + AES_192_CBC_CS2, + AES_192_CBC_CS3, + AES_256_CBC_CS1, + AES_256_CBC_CS2, + AES_256_CBC_CS3, AES_128_CTR, AES_192_CTR, AES_256_CTR,