From patchwork Wed May 25 15:53:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 111837 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 09F76A0555; Wed, 25 May 2022 19:05:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 12A0B4280B; Wed, 25 May 2022 19:04:58 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 745144280B for ; Wed, 25 May 2022 19:04:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653498296; x=1685034296; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=mL1Oh0jDs4vDv1D69q6C2dUJ5DxdW/E/+JLhebzTdrc=; b=MMiZ0rvigvTfep2JO3R33S9iLr8P3Kygsj4WpmW7N62DHTNZcdNPdM5f zSpz0ie6xvHDPB4WMg3KlUf6Wjc4KUgQea+QbbbjBEvGcxOR5eT2AZEDT KXdORk4xsKgtbbh3Z3hFs8sKEDkID7yfm9RRCZL2WPnaonssUdMbJ9BmH lCi9tHcMfTJiXztAw3ssa6N5lTewkBxUnhGROMdRBlg1MCpL/rpFlS/Fi 6VB+gCcntL/3Aeu4vbrHPtID+U0IS6MrXc0fxEs+VqRebXkzYsMbiGKrH lcxYzF9+HwQqw12jqAK76VhOUvjgj/+i/Y7JU1Rr1WoUiPIPJjyOMvQgi A==; X-IronPort-AV: E=McAfee;i="6400,9594,10358"; a="273596648" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="273596648" 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:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="664502442" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by FMSMGA003.fm.intel.com with ESMTP; 25 May 2022 10:01:31 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH v2 13/14] cryptodev: add salt length and optional label Date: Wed, 25 May 2022 16:53:23 +0100 Message-Id: <20220525155324.9288-14-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 salt length and optional label. Common parameters to PSS and OAEP padding for RSA. - Fixed hash API in RSA padding. Now it is specified how hash should be used with particular RSA padding modes. Signed-off-by: Arek Kusztal Acked-by: Akhil Goyal --- lib/cryptodev/rte_crypto_asym.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index 9f7fba3758..d90a7a1957 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -217,7 +217,7 @@ struct rte_crypto_rsa_priv_key_qt { struct rte_crypto_rsa_padding { enum rte_crypto_rsa_padding_type type; /**< RSA padding scheme to be used for transform */ - enum rte_crypto_auth_algorithm md; + enum rte_crypto_auth_algorithm hash; /**< * RSA padding hash function * @@ -240,7 +240,7 @@ struct rte_crypto_rsa_padding { * This field shall be set with the hash algorithm used * in the padding scheme (and to create the input message digest) */ - enum rte_crypto_auth_algorithm mgf1md; + enum rte_crypto_auth_algorithm mgf1hash; /**< * Hash algorithm to be used for mask generation if * padding scheme is either OAEP or PSS. If padding @@ -248,6 +248,21 @@ struct rte_crypto_rsa_padding { * for mask generation. Valid hash algorithms are: * MD5, SHA1, SHA224, SHA256, SHA384, SHA512 */ + uint16_t pss_saltlen; + /**< + * RSA PSS padding salt length + * + * Used only when RTE_CRYPTO_RSA_PADDING_PSS padding is selected, + * otherwise ignored. + */ + rte_crypto_param oaep_label; + /**< + * RSA OAEP padding optional label + * + * Used only when RTE_CRYPTO_RSA_PADDING_OAEP padding is selected, + * otherwise ignored. If label.data == NULL, a default + * label (empty string) is used. + */ }; /**