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 641C4A0503; Fri, 20 May 2022 09:02:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64FA442B8C; Fri, 20 May 2022 09:02:46 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 2E2A342B89 for ; Fri, 20 May 2022 09:02:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653030164; x=1684566164; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=F01b3iqMeaMAiM1bZtNJumN6/wjHbECm79nd4WIQV2k=; b=mMiWYq1+OG1dmqynCA51kgtGjknGhiRK8iUR1riJN6N/QZUopn/NXaB6 Q/EgnFSz/6ImhPNvLzzQlFVKdwDBMo4qMXonRdyK91UFSkTHBMpsdOy03 CDJL7Dlh3kE8sIN9bi/ZDmv7f/TU8ZZMaiQpvBAGc/0ssWFjhJKvFmV2y CMeqdHqJPu8LBnbGBQq6sL5gB3/JrqQGORiFNOAqwA2YTOaD6dvDVet2q yDa9DUVaZm01FMxMxrvJ/GgL9qhmmLpqT3KYyQ4gZ/CHIqapyJSU27Y8O xgCJBWwRQtXGFcyrj9mXfTCxZg1bu+otYJRjzVB7ys+D5SqfwDcAr6v4C A==; X-IronPort-AV: E=McAfee;i="6400,9594,10352"; a="333140216" X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="333140216" 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:02:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="599058104" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by orsmga008.jf.intel.com with ESMTP; 20 May 2022 00:02:42 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, anoobj@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH 04/40] cryptodev: reduce number of comments in asym xform Date: Fri, 20 May 2022 06:54:09 +0100 Message-Id: <20220520055445.40063-5-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 - Reduced number of comments in asymmetric xform. Information describing basic functionality of well known algorithms are unnecessary. - Added information about data memory lifetime. It was specified how user should work with private data, and it is user's responsability to clear it. - Removed NONE asymetric xform. Signed-off-by: Arek Kusztal --- lib/cryptodev/rte_crypto_asym.h | 45 +++++++++++++---------------------------- lib/cryptodev/rte_cryptodev.c | 1 - 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index a474b6acd1..0251e8caae 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -55,46 +55,29 @@ enum rte_crypto_curve_id { }; /** - * Asymmetric crypto transformation types. - * Each xform type maps to one asymmetric algorithm - * performing specific operation - * + * Asymmetric crypto algorithm static data. + * Data that may be used more than once (e.g. RSA private key). + * It is the USER responsibility to keep track of private data memory + * lifetime and security of the this data in xform. The same way + * it is the USER responsibility to call cryptodev session_clear() + * function if a session was created. If session-less not used + * xform data should be cleared after successful session creation. */ enum rte_crypto_asym_xform_type { - RTE_CRYPTO_ASYM_XFORM_UNSPECIFIED = 0, + RTE_CRYPTO_ASYM_XFORM_UNSPECIFIED, /**< Invalid xform. */ - RTE_CRYPTO_ASYM_XFORM_NONE, - /**< Xform type None. - * May be supported by PMD to support - * passthrough op for debugging purpose. - * if xform_type none , op_type is disregarded. - */ RTE_CRYPTO_ASYM_XFORM_RSA, - /**< RSA. Performs Encrypt, Decrypt, Sign and Verify. - * Refer to rte_crypto_asym_op_type - */ + /**< RSA */ RTE_CRYPTO_ASYM_XFORM_DH, - /**< Diffie-Hellman. - * Performs Key Generate and Shared Secret Compute. - * Refer to rte_crypto_asym_op_type - */ + /**< Diffie-Hellman */ RTE_CRYPTO_ASYM_XFORM_DSA, - /**< Digital Signature Algorithm - * Performs Signature Generation and Verification. - * Refer to rte_crypto_asym_op_type - */ + /**< Digital Signature Algorithm */ RTE_CRYPTO_ASYM_XFORM_MODINV, - /**< Modular Multiplicative Inverse - * Perform Modular Multiplicative Inverse b^(-1) mod n - */ + /**< Modular Multiplicative Inverse */ RTE_CRYPTO_ASYM_XFORM_MODEX, - /**< Modular Exponentiation - * Perform Modular Exponentiation b^e mod n - */ + /**< Modular Exponentiation */ RTE_CRYPTO_ASYM_XFORM_ECDSA, - /**< Elliptic Curve Digital Signature Algorithm - * Perform Signature Generation and Verification. - */ + /**< Elliptic Curve Digital Signature Algorithm */ RTE_CRYPTO_ASYM_XFORM_ECPM /**< Elliptic Curve Point Multiplication */ }; diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index e16e6802aa..691625bd04 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -160,7 +160,6 @@ rte_crypto_aead_operation_strings[] = { * Asymmetric crypto transform operation strings identifiers. */ const char *rte_crypto_asym_xform_strings[] = { - [RTE_CRYPTO_ASYM_XFORM_NONE] = "none", [RTE_CRYPTO_ASYM_XFORM_RSA] = "rsa", [RTE_CRYPTO_ASYM_XFORM_MODEX] = "modexp", [RTE_CRYPTO_ASYM_XFORM_MODINV] = "modinv", -- 2.13.6