Skip to contentSkip to conversation

crypto/openssl: add support for 8 byte 3DES

PATCH Applied Kovacevic, Marko 2 participants 3 messages Jun 12, 2018 – Jul 23, 2018 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/openssl: add support for 8 byte 3DES

Added extra case to support 8 byte key size for 3DES CBC. Also changed capabilities to reflect the change.

---
 drivers/crypto/openssl/rte_openssl_pmd.c     | 3 +++
 drivers/crypto/openssl/rte_openssl_pmd_ops.c | 2 +-
 test/test/test_cryptodev_des_test_vectors.h  | 6 ++++--
 3 files changed, 8 insertions(+), 3 deletions(-)
drivers/crypto/openssl/rte_openssl_pmd.c +3 -0
index 93c6d7e..a1b4ca4 100644
@@ -137,6 +137,9 @@ get_cipher_algo(enum rte_crypto_cipher_algorithm sess_algo, size_t keylen,
 		switch (sess_algo) {
 		case RTE_CRYPTO_CIPHER_3DES_CBC:
 			switch (keylen) {
+			case 8:
+				*algo = EVP_des_cbc();
+				break;
 			case 16:
 				*algo = EVP_des_ede_cbc();
 				break;
drivers/crypto/openssl/rte_openssl_pmd_ops.c +1 -1
index 1cb87d5..e7c5a57 100644
@@ -397,7 +397,7 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,
 				.block_size = 8,
 				.key_size = {
-					.min = 16,
+					.min = 8,
 					.max = 24,
 					.increment = 8
 				},
test/test/test_cryptodev_des_test_vectors.h +4 -2
index 4217b72..7479e70 100644
@@ -1232,13 +1232,15 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
 		.test_descr = "3DES-64-CBC Encryption",
 		.test_data = &triple_des64cbc_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MB
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MB |
+			BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
 	},
 	{
 		.test_descr = "3DES-64-CBC Decryption",
 		.test_data = &triple_des64cbc_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MB
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MB |
+			BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
 	},
 	{
 		.test_descr = "3DES-128-CBC Encryption",
Signature · 1 line
2.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines

-----Original Message-----
From: Kovacevic, Marko
Sent: Tuesday, June 12, 2018 11:39 AM
To: [email protected]
Cc: De Lara Guarch, Pablo <[email protected]>; Jain, Deepak K <[email protected]>; Kovacevic, Marko <[email protected]>; Marko
Subject: [PATCH v1] crypto/openssl: add support for 8 byte 3DES

Quoted 4 lines

Added extra case to support 8 byte key size for 3DES CBC. Also changed capabilities to reflect the change.

#2 lore raw
Quoted 21 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of De Lara Guarch, Pablo
Sent: Monday, July 23, 2018 9:50 AM
To: Kovacevic, Marko <[email protected]>; [email protected]
Cc: Jain, Deepak K <[email protected]>; Kovacevic, Marko <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v1] crypto/openssl: add support for 8 byte 3DES

Quoted 9 lines

-----Original Message-----
From: Kovacevic, Marko
Sent: Tuesday, June 12, 2018 11:39 AM
To: [email protected]
Cc: De Lara Guarch, Pablo <[email protected]>; Jain, Deepak K <[email protected]>; Kovacevic, Marko <[email protected]>; Marko
Subject: [PATCH v1] crypto/openssl: add support for 8 byte 3DES

Quoted 6 lines
Quoted 4 lines

Added extra case to support 8 byte key size for 3DES CBC. Also changed capabilities to reflect the change.

Applied to dpdk-next-crypto.
Thanks,

Pablo