From: Radu Nicolau <radu.nicolau@intel.com>
To: Pablo de Lara <pablo.de.lara.guarch@intel.com>, declan.doherty@intel.com
Cc: dev@dpdk.org
Subject: Re: [PATCH v2 1/3] crypto/aesni_mb: add DES support
Date: Mon, 18 Sep 2017 11:56:04 +0100 [thread overview]
Message-ID: <f0fed1eb-63d4-a2b5-c249-ecc786b13f10@intel.com> (raw)
In-Reply-To: <20170915020937.75688-2-pablo.de.lara.guarch@intel.com>
On 9/15/2017 3:09 AM, Pablo de Lara wrote:
> The Multi-buffer library now supports DES-CBC
> and DES-DOCSISBPI algorithms, so this commit
> extends adds support for them in the PMD.
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---
> doc/guides/cryptodevs/aesni_mb.rst | 2 +
> doc/guides/cryptodevs/features/aesni_mb.ini | 3 ++
> doc/guides/rel_notes/release_17_11.rst | 7 +++
> drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 74 ++++++++++++++++++--------
> drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 42 +++++++++++++++
> test/test/test_cryptodev.c | 42 +++++++++++++++
> test/test/test_cryptodev_des_test_vectors.h | 24 ++++++---
> 7 files changed, 163 insertions(+), 31 deletions(-)
>
> <snip>
>
> +#include <des.h>
> +
> #include <rte_common.h>
> #include <rte_hexdump.h>
> #include <rte_cryptodev.h>
> @@ -188,6 +190,7 @@ aesni_mb_set_session_cipher_parameters(const struct aesni_mb_op_fns *mb_ops,
> struct aesni_mb_session *sess,
> const struct rte_crypto_sym_xform *xform)
> {
> + uint8_t is_aes;
Nitpicking: Maybe initialize with zero and remove is_aes = 0; from the
switch body?
> aes_keyexp_t aes_keyexp_fn;
>
> if (xform == NULL) {
> @@ -217,45 +220,70 @@ aesni_mb_set_session_cipher_parameters(const struct aesni_mb_op_fns *mb_ops,
> switch (xform->cipher.algo) {
> case RTE_CRYPTO_CIPHER_AES_CBC:
> sess->cipher.mode = CBC;
> + is_aes = 1;
> break;
> case RTE_CRYPTO_CIPHER_AES_CTR:
> sess->cipher.mode = CNTR;
> + is_aes = 1;
> break;
> case RTE_CRYPTO_CIPHER_AES_DOCSISBPI:
> sess->cipher.mode = DOCSIS_SEC_BPI;
> + is_aes = 1;
> break;
> - default:
> - MB_LOG_ERR("Unsupported cipher mode parameter");
> - return -ENOTSUP;
> - }
> -
> - /* Check key length and choose key expansion function */
> - switch (xform->cipher.key.length) {
> - case AES_128_BYTES:
> - sess->cipher.key_length_in_bytes = AES_128_BYTES;
> - aes_keyexp_fn = mb_ops->aux.keyexp.aes128;
> + case RTE_CRYPTO_CIPHER_DES_CBC:
> + sess->cipher.mode = DES;
> + is_aes = 0;
> break;
> - case AES_192_BYTES:
> - sess->cipher.key_length_in_bytes = AES_192_BYTES;
> - aes_keyexp_fn = mb_ops->aux.keyexp.aes192;
> - break;
> - case AES_256_BYTES:
> - sess->cipher.key_length_in_bytes = AES_256_BYTES;
> - aes_keyexp_fn = mb_ops->aux.keyexp.aes256;
> + case RTE_CRYPTO_CIPHER_DES_DOCSISBPI:
> + sess->cipher.mode = DOCSIS_DES;
> + is_aes = 0;
> break;
> default:
> - MB_LOG_ERR("Invalid cipher key length");
> - return -EINVAL;
> + MB_LOG_ERR("Unsupported cipher mode parameter");
> + return -ENOTSUP;
> }
> <snip>
Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
next prev parent reply other threads:[~2017-09-18 10:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 6:17 [PATCH] crypto/aesni_mb: add DES support Pablo de Lara
2017-09-04 9:07 ` Zhang, Roy Fan
2017-09-15 2:09 ` [PATCH v2 0/3] Extend " Pablo de Lara
2017-09-15 2:09 ` [PATCH v2 1/3] crypto/aesni_mb: add " Pablo de Lara
2017-09-18 10:56 ` Radu Nicolau [this message]
2017-09-18 14:08 ` De Lara Guarch, Pablo
2017-09-15 2:09 ` [PATCH v2 2/3] crypto/openssl: add support for DES-CBC Pablo de Lara
2017-09-18 11:31 ` Radu Nicolau
2017-09-15 2:09 ` [PATCH v2 3/3] app/crypto-perf: fix packet length check Pablo de Lara
2017-09-18 11:32 ` Radu Nicolau
2017-09-20 1:37 ` [PATCH v3 0/3] Extend DES support Pablo de Lara
2017-09-20 1:37 ` [PATCH v3 1/3] crypto/aesni_mb: add " Pablo de Lara
2017-09-20 1:37 ` [PATCH v3 2/3] crypto/openssl: add support for DES-CBC Pablo de Lara
2017-09-20 1:37 ` [PATCH v3 3/3] app/crypto-perf: fix packet length check Pablo de Lara
2017-10-05 5:27 ` [PATCH v4 0/4] Extend DES support Pablo de Lara
2017-10-05 5:27 ` [PATCH v4 1/4] doc: update IPSec Multi-buffer lib versioning Pablo de Lara
2017-10-05 13:55 ` Mcnamara, John
2017-10-05 5:27 ` [PATCH v4 2/4] crypto/aesni_mb: add DES support Pablo de Lara
2017-10-05 5:27 ` [PATCH v4 3/4] crypto/openssl: add support for DES-CBC Pablo de Lara
2017-10-05 5:28 ` [PATCH v4 4/4] app/crypto-perf: fix packet length check Pablo de Lara
2017-10-05 14:14 ` [PATCH v4 0/4] Extend DES support 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=f0fed1eb-63d4-a2b5-c249-ecc786b13f10@intel.com \
--to=radu.nicolau@intel.com \
--cc=declan.doherty@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.