From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D7B1A0548; Tue, 31 May 2022 07:13:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61EB540A87; Tue, 31 May 2022 07:12:53 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 4970D42B83 for ; Tue, 31 May 2022 07:12:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653973971; x=1685509971; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=th/vJ8gDngpEMOjuADACotTDjVT95tHDUcfFGaUFhsY=; b=g19NaKUKPawJ1LDwlFltml6EpOJCkiDKdHRMe0XGzEvzS6IYrhGAkVNP fS428U0GKqiFWYTTP1eWG0uiuZn2ypxXrReBvNj7gjORBeC55E9sobeaz 1oAGQIPiNtkqtqkKVLd3/9QzkIy61bnHsvJVf4sV6sHha41wwFAmqAhwz ROoriuuK4TYvjv1Qoukrh+0f5BsE+/Rqu2Z+qXXQd0krz/fYNulPJbkCl wLnIwabie+u+60Q8zkRQBchFze7y0yCO7Kc2WQP50RIc/0rpgNUAk8gpR LXuT85uUb53zTRRtTwkcXllQgpyFzfeEngi4dQytnMEw7S6cd96LmfWxH g==; X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="338181312" X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="338181312" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2022 22:12:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="576220548" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by orsmga007.jf.intel.com with ESMTP; 30 May 2022 22:12:49 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH v4 08/12] cryptodev: add asym op flags Date: Tue, 31 May 2022 05:04:35 +0100 Message-Id: <20220531040439.15862-9-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220531040439.15862-1-arkadiuszx.kusztal@intel.com> References: <20220531040439.15862-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