From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBF96C433F5 for ; Mon, 30 May 2022 15:40:47 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5AA8D42B8C; Mon, 30 May 2022 17:39:57 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id E274842B92 for ; Mon, 30 May 2022 17:39:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653925195; x=1685461195; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=WxRoM74fFu7V6dvFLT6D1v3RfIQsRr9oswId6iNs49w=; b=IhXq3vfQdpT+KVhTU7r6qZ9tYX4zx8kEFMwXYTd8pDC5JDAzX+kKq2Fv yFKkrJodRo6LGy3NpOdYg//MrjPeP3EwMaUA4K7XThDYqdkRAjW9/tEUs 5k2Lo/ggOHgimP5cLKlSoDzWmzMvJf1lvuhOv8eN3IsKZyjm6DH60tFiC eemNcBKSiWpaQjYozDHf0ffPYwTlOwbxa3qLkdMXKzJG7av+d6oE1kzXN Py03UzwJxYnFIwFh2IPNBR4fjPpUJV9NOn9PQKekfHdneBjgVXXnveUqy P9uxJrseq+3LgGu2zNqSYC5hfKgrqJPbDgUELkHecwefHVLklfbLmK0yr w==; X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="338069488" X-IronPort-AV: E=Sophos;i="5.91,263,1647327600"; d="scan'208";a="338069488" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2022 08:39:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,263,1647327600"; d="scan'208";a="751678786" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by orsmga005.jf.intel.com with ESMTP; 30 May 2022 08:39:52 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH v3 09/12] cryptodev: clarify usage of rsa padding hash Date: Mon, 30 May 2022 15:31:56 +0100 Message-Id: <20220530143159.13672-10-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220530143159.13672-1-arkadiuszx.kusztal@intel.com> References: <20220530143159.13672-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