From patchwork Wed Jun 1 09:02:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 112222 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 E0B3FA0548; Wed, 1 Jun 2022 12:12:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A31E042BB0; Wed, 1 Jun 2022 12:11:02 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 6BB3542BA5 for ; Wed, 1 Jun 2022 12:10:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654078259; x=1685614259; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=uhJ6r51gPJakv0kNATyyRoYqX6FaucklZ66ZmxRNlyQ=; b=MLYUH64mLG+HehZZGoVWSsux9yS7vU0YaFPAc+w8dIp6jI1TNNTZqzaG TkKRUmt0hHQgtreMMtDzR53m0IKnwpyTnh/Og1DrtsqL+k4f0rxdomdBl rS7TO8VwVNgSwcKYvLf08a7cbX8DelX6HveDGVvmsTqF7I7xk5U0embwO vIhj5RHj1JlBBMvl4KuOUcAaCFmCMEa2UpZhG94cwNluQdh2pDG6BydVb MNxZ99kqSLgjoWtdJeVlhKxQJbq4HHgtkozHvSHsB7BdbB8aMEXlKxizl Qxhw1F+6/hYTpbSzocR+XdrtEHOfUYH+MJUXXYD3kZPqmcRjDUnqyySuT Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="275616531" X-IronPort-AV: E=Sophos;i="5.91,266,1647327600"; d="scan'208";a="275616531" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 03:10:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,266,1647327600"; d="scan'208";a="606186102" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by orsmga008.jf.intel.com with ESMTP; 01 Jun 2022 03:10:53 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH v5 12/12] cryptodev: add salt length and optional label Date: Wed, 1 Jun 2022 10:02:49 +0100 Message-Id: <20220601090249.86865-13-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220601090249.86865-1-arkadiuszx.kusztal@intel.com> References: <20220601090249.86865-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. - Changed RSA hash padding fields names. Now it corresponds to the RSA documents. Signed-off-by: Arek Kusztal --- 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 aaa4bf9952..251c338797 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -241,7 +241,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 algorithm * Valid hash algorithms are: @@ -266,7 +266,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 the * padding scheme is either OAEP or PSS. If the padding @@ -274,6 +274,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. + */ }; /**