DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <gakhil@marvell.com>
To: Shaokai Zhang <felix.zhang@jaguarmicro.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "kai.ji@intel.com" <kai.ji@intel.com>,
	Joey Xing <joey.xing@jaguarmicro.com>
Subject: RE: [EXTERNAL] [PATCH] crypto/openssl: support AES-XTS operations
Date: Mon, 17 Nov 2025 18:38:45 +0000	[thread overview]
Message-ID: <CO6PR18MB448463107AEDC7323E799F53D8C9A@CO6PR18MB4484.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20251117124414.1839-1-felix.zhang@jaguarmicro.com>

> Extend openssl crypto PMD to support AES XTS operations.
> 
> Signed-off-by: Shaokai Zhang <felix.zhang@jaguarmicro.com>
> Reviewed-by: Joey Xing <joey.xing@jaguarmicro.com>
> ---
>  drivers/crypto/openssl/openssl_pmd_private.h |  2 +-
>  drivers/crypto/openssl/rte_openssl_pmd.c     | 13 +++++++++++++
>  drivers/crypto/openssl/rte_openssl_pmd_ops.c | 20 ++++++++++++++++++++
>  3 files changed, 34 insertions(+), 1 deletion(-)

Documentation update missing.
This patch is late for current release. Will be deferred to next release.

> 
> diff --git a/drivers/crypto/openssl/openssl_pmd_private.h
> b/drivers/crypto/openssl/openssl_pmd_private.h
> index fe89e522e1..d5a751600a 100644
> --- a/drivers/crypto/openssl/openssl_pmd_private.h
> +++ b/drivers/crypto/openssl/openssl_pmd_private.h
> @@ -118,7 +118,7 @@ struct __rte_cache_aligned openssl_session {
>  		/**< cipher algorithm */
> 
>  		struct {
> -			uint8_t data[32];
> +			uint8_t data[64];
>  			/**< key data */
>  			size_t length;
>  			/**< key length in bytes */
> diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c
> b/drivers/crypto/openssl/rte_openssl_pmd.c
> index 4f171f48cc..2d803912d4 100644
> --- a/drivers/crypto/openssl/rte_openssl_pmd.c
> +++ b/drivers/crypto/openssl/rte_openssl_pmd.c
> @@ -211,6 +211,18 @@ get_cipher_algo(enum rte_crypto_cipher_algorithm
> sess_algo, size_t keylen,
>  				res = -EINVAL;
>  			}
>  			break;
> +		case RTE_CRYPTO_CIPHER_AES_XTS:
> +			switch (keylen) {
> +			case 32:
> +				*algo = EVP_aes_128_xts();
> +				break;
> +			case 64:
> +				*algo = EVP_aes_256_xts();
> +				break;
> +			default:
> +				res = -EINVAL;
> +			}
> +			break;
>  		case RTE_CRYPTO_CIPHER_AES_CTR:
>  			switch (keylen) {
>  			case 16:
> @@ -493,6 +505,7 @@ openssl_set_session_cipher_parameters(struct
> openssl_session *sess,
>  	case RTE_CRYPTO_CIPHER_3DES_CBC:
>  	case RTE_CRYPTO_CIPHER_AES_CBC:
>  	case RTE_CRYPTO_CIPHER_AES_CTR:
> +	case RTE_CRYPTO_CIPHER_AES_XTS:
>  		sess->cipher.mode = OPENSSL_CIPHER_LIB;
>  		sess->cipher.algo = xform->cipher.algo;
>  		sess->cipher.ctx = EVP_CIPHER_CTX_new();
> diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
> b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
> index 5095e6cbea..df5c12626d 100644
> --- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
> +++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
> @@ -269,6 +269,26 @@ static const struct rte_cryptodev_capabilities
> openssl_pmd_capabilities[] = {
>  			}, }
>  		}, }
>  	},
> +	{	/* AES XTS */
> +		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> +		{.sym = {
> +			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
> +			{.cipher = {
> +				.algo = RTE_CRYPTO_CIPHER_AES_XTS,
> +				.block_size = 16,
> +				.key_size = {
> +					.min = 32,
> +					.max = 64,
> +					.increment = 32
> +				},
> +				.iv_size = {
> +					.min = 16,
> +					.max = 16,
> +					.increment = 0
> +				}
> +			}, }
> +		}, }
> +	},
>  	{	/* AES CBC */
>  		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
>  		{.sym = {
> --
> 2.47.1.windows.2


      reply	other threads:[~2025-11-17 18:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17 12:44 Shaokai Zhang
2025-11-17 18:38 ` Akhil Goyal [this message]

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=CO6PR18MB448463107AEDC7323E799F53D8C9A@CO6PR18MB4484.namprd18.prod.outlook.com \
    --to=gakhil@marvell.com \
    --cc=dev@dpdk.org \
    --cc=felix.zhang@jaguarmicro.com \
    --cc=joey.xing@jaguarmicro.com \
    --cc=kai.ji@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).