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 9AC69A0548; Tue, 31 May 2022 07:13:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D35F942B94; Tue, 31 May 2022 07:12:55 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 73FC642B8A for ; Tue, 31 May 2022 07:12:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653973973; x=1685509973; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=WxRoM74fFu7V6dvFLT6D1v3RfIQsRr9oswId6iNs49w=; b=Y97pLT27wCiMGyw1DoyBolbklO2KwnpL+r6DqIOa6OlW9pG1XAYUErmy VoqGjYizepafWF5IvCNDKveDbh8NEdK7rcO4H7KUZ05ErfvK/dKfQqdEu OmNZGizAy69hFy20VsYSrnxySOxOu1sU7ypYnMWLIa3g6jK7Ftc37h3hk WA7UmmIuoQ6h4/Rwu4d/yEl56BplugddjQayTIGy7AI6YWk+o2hROZbxv rCcbrNmJpXGvKbNxxqyr/x5JKq7eDwp2SP8R37IJNVtxM+U164l24FsBF KsTTeu8Gq7ABFRadDL3Lmg5X3Ec72hBU5pXK74WpjPr5ZAu09vC7zk1yI A==; X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="338181317" X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="338181317" 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:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="576220568" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by orsmga007.jf.intel.com with ESMTP; 30 May 2022 22:12:51 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH v4 09/12] cryptodev: clarify usage of rsa padding hash Date: Tue, 31 May 2022 05:04:36 +0100 Message-Id: <20220531040439.15862-10-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 - Clarified usage of RSA padding hash. It was not specified how to use hash for PKCS1_5 padding. This could lead to incorrect implementation. Signed-off-by: Arek Kusztal --- lib/cryptodev/rte_crypto_asym.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index a215f4499d..363fbf87c7 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -395,10 +395,29 @@ struct rte_crypto_rsa_op_param { /**< RSA padding scheme to be used for transform */ enum rte_crypto_auth_algorithm md; - /**< Hash algorithm to be used for data hash if padding - * scheme is either OAEP or PSS. Valid hash algorithms - * are: + /**< + * RSA padding hash algorithm + * Valid hash algorithms are: * MD5, SHA1, SHA224, SHA256, SHA384, SHA512 + * + * When a specific padding type is selected, the following rule apply: + * - RTE_CRYPTO_RSA_PADDING_NONE: + * This field is ignored by the PMD + * + * - RTE_CRYPTO_RSA_PADDING_PKCS1_5: + * For sign operation, this field is used to determine value + * of the DigestInfo structure, therefore specifying which algorithm + * was used to create the message digest. + * For encryption/decryption, this field is ignored for this + * padding type. + * + * - RTE_CRYPTO_RSA_PADDING_OAEP + * This field shall be set with the hash algorithm used + * in the padding scheme + * + * - RTE_CRYPTO_RSA_PADDING_PSS + * 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; -- 2.13.6