From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B0E0C433FE for ; Mon, 30 May 2022 15:40:41 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C69C42B90; Mon, 30 May 2022 17:39:54 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 78BF142B82 for ; Mon, 30 May 2022 17:39:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653925192; x=1685461192; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=th/vJ8gDngpEMOjuADACotTDjVT95tHDUcfFGaUFhsY=; b=hF+KoKWv4/mj0PbSLI5kfpC9ThDfiZImEIcrmAdV/sMHPdtAI0o+Iern dWaZwQGZZuzENaHrlBPqMwny0nPmMvFKrEycUaA7iEVzPh1BqKwJrr/Ax XWex9yauFJD2ZChNFzANLGgz4FUjhGm2Ujv2ZI1426zZejFVVeBzLKpQr 0JMefOopBr3SuKCPaieEYSeGxo9eVbM4xy/QmqgSESNOpk+n5A6KBXtgg f3YdeoVrJR7Wys35tCjBFY6wvR2zR6DDvnpLF/iwnVpWqjKVryaXJwP2B 98ShMVWQOxtf1x/jmRvOhXvceBzITxRb4YeC9Shw+c25ht3bzCSXyl9Yv w==; X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="338069483" X-IronPort-AV: E=Sophos;i="5.91,263,1647327600"; d="scan'208";a="338069483" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2022 08:39:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,263,1647327600"; d="scan'208";a="751678668" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by orsmga005.jf.intel.com with ESMTP; 30 May 2022 08:39:50 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH v3 08/12] cryptodev: add asym op flags Date: Mon, 30 May 2022 15:31:55 +0100 Message-Id: <20220530143159.13672-9-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220530143159.13672-1-arkadiuszx.kusztal@intel.com> References: <20220530143159.13672-1-arkadiuszx.kusztal@intel.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org - Added flags to rte_crypto_asym_op struct. It may be shared between different algorithms. - Added Diffie-Hellman padding flags. Diffie-Hellman padding is used in certain protocols, in others, leading zero bytes need to be stripped. Even same protocol may use a different approach - most glaring example is TLS1.2 - TLS1.3. For ease of use, and to avoid additional copy on certain occasions, driver should be able to return both. Signed-off-by: Arek Kusztal --- lib/cryptodev/rte_crypto_asym.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index ae3ca31a89..a215f4499d 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -41,6 +41,19 @@ rte_crypto_asym_ke_strings[]; extern const char * rte_crypto_asym_op_strings[]; +#define RTE_CRYPTO_ASYM_FLAG_PUB_KEY_NO_PADDING RTE_BIT32(0) +/**< + * Flag to denote public key will be returned without leading zero bytes + * and if the flag is not set, public key will be padded to the left with + * zeros to the size of the underlying algorithm (default) + */ +#define RTE_CRYPTO_ASYM_FLAG_SHARED_KEY_NO_PADDING RTE_BIT32(1) +/**< + * Flag to denote shared secret will be returned without leading zero bytes + * and if the flag is not set, shared secret will be padded to the left with + * zeros to the size of the underlying algorithm (default) + */ + /** * List of elliptic curves. This enum aligns with * TLS "Supported Groups" registry (previously known as @@ -613,6 +626,8 @@ struct rte_crypto_asym_op { struct rte_crypto_ecdsa_op_param ecdsa; struct rte_crypto_ecpm_op_param ecpm; }; + uint16_t flags; + /**< Asymmetric crypto operation flags */ }; #ifdef __cplusplus -- 2.13.6