From: Marko Kovacevic Date: Tue, 12 Jun 2018 10:39:25 +0000 (+0100) Subject: crypto/openssl: support 8-byte 3DES X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9607e37e8c9a24077de2a60f4c673c49493dae89;p=dpdk.git crypto/openssl: support 8-byte 3DES Added extra case to support 8 byte key size for 3DES CBC. Also changed capabilities to reflect the change. Signed-off-by: Marko Kovacevic Acked-by: Pablo de Lara --- diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index 10a258f3fb..96b0fd2ce5 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -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; diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c index 5335685561..05f452dd7f 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c +++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c @@ -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 }, diff --git a/test/test/test_cryptodev_des_test_vectors.h b/test/test/test_cryptodev_des_test_vectors.h index 4217b72a0a..7479e70f0c 100644 --- a/test/test/test_cryptodev_des_test_vectors.h +++ b/test/test/test_cryptodev_des_test_vectors.h @@ -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",