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 32A2CA0503; Fri, 20 May 2022 09:04:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B774242B81; Fri, 20 May 2022 09:03:27 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id A8DFC42BDE for ; Fri, 20 May 2022 09:03:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653030205; x=1684566205; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=QhDO2OOmfanrGiBba8r0ubMIqG1Ng3bfyYjpXvzCK3Q=; b=LkQO3WAbxk4q6ZJ7UqMWxP9SwXZxLwTgJU26p5brUAgyQW8JGZULrD7F AU8JTrLpseSAFLIWubeF4zOHHpjwUiT55/IGnXKVRIq5Wm+J/tV2Vg8j9 p463vAHkddxaQ4/RrX/yE4uqRzpvFucbP8prTT9ueRqmqNcOclcYJdnf4 XfEikoZZJNlC/2SQxfJYdbTt5MVvl4GuIy0xPC+/B81Fp+GXtdvi7R9pX Q/SKQRule9BwR8ylp/t9DHLEESa3oiPf1Yp41xk3heo8xjOfG2acjpxXm b8Icq5PqkpHnapfO6NbYMvF+eFuX2UNzxbVcVD7K0cRlO9y9EVCYVYQMc Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10352"; a="333140397" X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="333140397" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2022 00:03:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="599058410" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by orsmga008.jf.intel.com with ESMTP; 20 May 2022 00:03:23 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, anoobj@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH 22/40] cryptodev: move RSA padding into separate struct Date: Fri, 20 May 2022 06:54:27 +0100 Message-Id: <20220520055445.40063-23-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220520055445.40063-1-arkadiuszx.kusztal@intel.com> References: <20220520055445.40063-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 - move RSA padding into separate struct. More padding members should be added into padding, therefore having separate struct for padding parameters will make this more readable. Signed-off-by: Arek Kusztal --- lib/cryptodev/rte_crypto_asym.h | 42 +++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index 73ff9ff815..97c3fbee38 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -201,6 +201,28 @@ struct rte_crypto_rsa_priv_key_qt { }; /** + * RSA padding type + */ +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; + /**< Hash algorithm to be used for data hash if padding + * scheme is either OAEP or PSS. Valid hash algorithms + * are: + * MD5, SHA1, SHA224, SHA256, SHA384, SHA512 + */ + enum rte_crypto_auth_algorithm mgf1md; + /**< + * Hash algorithm to be used for mask generation if + * padding scheme is either OAEP or PSS. If padding + * scheme is unspecified data hash algorithm is used + * for mask generation. Valid hash algorithms are: + * MD5, SHA1, SHA224, SHA256, SHA384, SHA512 + */ +}; + +/** * Asymmetric RSA transform data * * Structure describing RSA xform params @@ -355,25 +377,9 @@ struct rte_crypto_rsa_op_param { * * All data is in Octet-string network byte order format. */ + struct rte_crypto_rsa_padding padding; + /**< RSA padding information */ - enum rte_crypto_rsa_padding_type pad; - /**< 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: - * MD5, SHA1, SHA224, SHA256, SHA384, SHA512 - */ - - enum rte_crypto_auth_algorithm mgf1md; - /**< - * Hash algorithm to be used for mask generation if - * padding scheme is either OAEP or PSS. If padding - * scheme is unspecified data hash algorithm is used - * for mask generation. Valid hash algorithms are: - * MD5, SHA1, SHA224, SHA256, SHA384, SHA512 - */ }; /** -- 2.13.6