From: "Kovacevic, Marko" <marko.kovacevic@intel.com>
To: dev@dpdk.org
Cc: pablo.de.lara.guarch@intel.com, deepak.k.jain@intel.com,
"Kovacevic, Marko" <marko.kovacevic@intel.com>,
Marko
Subject: [dpdk-dev] [PATCH v1] crypto/openssl: add support for 8 byte 3DES
Date: Tue, 12 Jun 2018 11:39:25 +0100 [thread overview]
Message-ID: <20180612103925.34342-1-marko.kovacevic@intel.com> (raw)
Added extra case to support 8 byte key size
for 3DES CBC. Also changed capabilities to reflect
the change.
Signed-off-by: Marko, Kovacevic <marko.kovacevic@intel.com>
---
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(-)
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 93c6d7e..a1b4ca4 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 1cb87d5..e7c5a57 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 4217b72..7479e70 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",
--
2.9.5
next reply other threads:[~2018-06-12 10:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 10:39 Kovacevic, Marko [this message]
2018-07-23 8:50 ` De Lara Guarch, Pablo
2018-07-23 8:56 ` De Lara Guarch, Pablo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180612103925.34342-1-marko.kovacevic@intel.com \
--to=marko.kovacevic@intel.com \
--cc=deepak.k.jain@intel.com \
--cc=dev@dpdk.org \
--cc=pablo.de.lara.guarch@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).