From: Zhiqi Song songzhiqi1@huawei.com
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 88806ca..1994ad0 100644 --- a/uadk_tool/benchmark/sec_uadk_benchmark.c +++ b/uadk_tool/benchmark/sec_uadk_benchmark.c @@ -190,6 +190,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 3791792..aa36c22 100644 --- a/uadk_tool/benchmark/sec_wd_benchmark.c +++ b/uadk_tool/benchmark/sec_wd_benchmark.c @@ -256,6 +256,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 26b381e..ff95bea 100644 --- a/uadk_tool/benchmark/uadk_benchmark.c +++ b/uadk_tool/benchmark/uadk_benchmark.c @@ -92,6 +92,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}, @@ -171,6 +180,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 3a33fd8..c2ba9bc 100644 --- a/uadk_tool/benchmark/uadk_benchmark.h +++ b/uadk_tool/benchmark/uadk_benchmark.h @@ -143,6 +143,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,