]> git.droids-corp.org - dpdk.git/commitdiff
crypto/nitrox: support 3DES-CBC
authorNagadheeraj Rottela <rnagadheeraj@marvell.com>
Fri, 13 Mar 2020 11:43:37 +0000 (17:13 +0530)
committerAkhil Goyal <akhil.goyal@oss.nxp.com>
Sun, 5 Apr 2020 16:40:34 +0000 (18:40 +0200)
This patch adds 3DES CBC mode cipher algorithm.

Signed-off-by: Nagadheeraj Rottela <rnagadheeraj@marvell.com>
app/test/test_cryptodev.c
app/test/test_cryptodev_des_test_vectors.h
doc/guides/cryptodevs/features/nitrox.ini
doc/guides/cryptodevs/nitrox.rst
drivers/crypto/nitrox/nitrox_sym.c
drivers/crypto/nitrox/nitrox_sym_capabilities.c

index 927c3b750103bdc2005a0de1318a3aed64d146e2..3df63eb71abcc7826ce7d0c900c1dc52cfccbf5c 100644 (file)
@@ -13139,6 +13139,7 @@ static struct unit_test_suite cryptodev_nitrox_testsuite  = {
                TEST_CASE_ST(ut_setup, ut_teardown,
                                test_device_configure_invalid_queue_pair_ids),
                TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
+               TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
 
                TEST_CASES_END() /**< NULL terminate unit test array */
        }
index 0a362d9808da899ffcbd877668070a6ab3539c30..d8a62d2b5215659ceb25ada60067b9b29e58ac13 100644 (file)
@@ -1115,7 +1115,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX |
-                       BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2
+                       BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2 |
+                       BLOCKCIPHER_TEST_TARGET_PMD_NITROX
        },
        {
                .test_descr = "3DES-192-CBC HMAC-SHA1 Decryption Digest Verify",
@@ -1129,7 +1130,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX |
-                       BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2
+                       BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2 |
+                       BLOCKCIPHER_TEST_TARGET_PMD_NITROX
        },
        {
                .test_descr = "3DES-192-CBC SHA1 Encryption Digest",
index ddc3c05f46004d67c5263f57d7c007d123d2313d..183494731e8cf3e8a9c9c052038297131d0ede12 100644 (file)
@@ -20,6 +20,7 @@ OOP LB  In LB  Out     = Y
 AES CBC (128)  = Y
 AES CBC (192)  = Y
 AES CBC (256)  = Y
+3DES CBC       = Y
 
 ;
 ; Supported authentication algorithms of the 'nitrox' crypto driver.
index f8a527c058b486689ea263e5293e7ff5d6da48b3..85f5212b6472bee4e916460bbc39b5f04f36af20 100644 (file)
@@ -18,6 +18,7 @@ Nitrox crypto PMD has support for:
 Cipher algorithms:
 
 * ``RTE_CRYPTO_CIPHER_AES_CBC``
+* ``RTE_CRYPTO_CIPHER_3DES_CBC``
 
 Hash algorithms:
 
@@ -29,6 +30,7 @@ Limitations
 -----------
 
 * AES_CBC Cipher Only combination is not supported.
+* 3DES Cipher Only combination is not supported.
 * Session-less APIs are not supported.
 
 Installation
index d1b32fec928f76bf18c1008df74eedddfaa92cbc..fad4a7a487590270d17ad229f59ce26eedd1b9cb 100644 (file)
@@ -314,6 +314,10 @@ get_flexi_cipher_type(enum rte_crypto_cipher_algorithm algo, bool *is_aes)
                type = CIPHER_AES_CBC;
                *is_aes = true;
                break;
+       case RTE_CRYPTO_CIPHER_3DES_CBC:
+               type = CIPHER_3DES_CBC;
+               *is_aes = false;
+               break;
        default:
                type = CIPHER_INVALID;
                NITROX_LOG(ERR, "Algorithm not supported %d\n", algo);
index 47ceead734f478d3acdafbb0cb681efb0c99afad..dc4df9185f0c35cfb586029620fee99f093d9629 100644 (file)
@@ -88,7 +88,26 @@ static const struct rte_cryptodev_capabilities nitrox_capabilities[] = {
                        }, }
                }, }
        },
-
+       {       /* 3DES CBC */
+               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+               {.sym = {
+                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+                       {.cipher = {
+                               .algo = RTE_CRYPTO_CIPHER_3DES_CBC,
+                               .block_size = 8,
+                               .key_size = {
+                                       .min = 24,
+                                       .max = 24,
+                                       .increment = 0
+                               },
+                               .iv_size = {
+                                       .min = 8,
+                                       .max = 8,
+                                       .increment = 0
+                               }
+                       }, }
+               }, }
+       },
        RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
 };