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 3C3F1A0555; Wed, 25 May 2022 19:04:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01A7642B75; Wed, 25 May 2022 19:04:20 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 5F9CD4281B for ; Wed, 25 May 2022 19:04:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653498258; x=1685034258; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=jnBUoqg83LUVjoejJBLBna+SguSLOuLWIeDdo9yGuK0=; b=inKzywviiTtGIP3pYvG6CWO1HgNrpYtIXqiA79iJ8VK9Wktqtz+Br+q1 queIqJcmZ5a7ShLG/bqOUywQu2KxUs8VmGIFg0Xl2Pdbh8jDqvDbvFBao nahV1JL1qMxDkjZOaXD3G5WqiHyCPO7rvbnhu0GJzbpFDd84ZkLFpQOgI 6sVlauz+KCEGrQt7plb0biS0ujhgH0zHsC4kW2UGGVgOv0lEOEHWKDRmA bKVW/oDxJ6VpTkwy7BnmH9e7Rgg/4d7CMdaU/zIk8uXT4nMdWQI/XW11K OrxFASBR1lglj4byl+ns8S0xYdV9IwNPAS3M0tVDhJQg5w7fF3/KX2uBR Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10358"; a="273596433" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="273596433" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2022 10:01:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="664502391" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by FMSMGA003.fm.intel.com with ESMTP; 25 May 2022 10:01:23 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH v2 09/14] cryptodev: add asym op flags Date: Wed, 25 May 2022 16:53:19 +0100 Message-Id: <20220525155324.9288-10-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220525155324.9288-1-arkadiuszx.kusztal@intel.com> References: <20220525155324.9288-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 3eafaecbbe..1a57c0c532 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -75,6 +75,19 @@ struct rte_crypto_ec_point { /**< Y coordinate */ }; +#define RTE_CRYPTO_ASYM_FLAG_PUB_KEY_NO_PADDING RTE_BIT32(0) +/**< + * If set to 1 - public key will be returned + * without leading zero bytes, otherwise it will be + * padded to the left with zero bytes (default) + */ +#define RTE_CRYPTO_ASYM_FLAG_SHARED_KEY_NO_PADDING RTE_BIT32(1) +/**< + * If set to 1 - shared key will be returned + * without leading zero bytes, otherwise it will be + * padded to the left with zero bytes (default) + */ + /** * List of elliptic curves. This enum aligns with * TLS "Supported Groups" registry (previously known as @@ -589,6 +602,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