From patchwork Fri Apr 8 14:05:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 109523 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 CFDECA050B; Fri, 8 Apr 2022 16:05:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BC2B4067E; Fri, 8 Apr 2022 16:05:26 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id E5E6E4003F for ; Fri, 8 Apr 2022 16:05:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649426725; x=1680962725; h=from:to:cc:subject:date:message-id; bh=EzsHW1r/gyXcuFvUUCfVW9eIlJho6yPwwnhYuAG3QDE=; b=SqaHMnFu+2ohAEowc8cQZVPldtUAJuYilFZkwyKUrAQ4ZuOil4GI7HV2 FtRF0EyuY1Lz+wMO2/zoUch1LIfcDKR1myjC6OClL/nUF6jHeW6JnBWEx P1UhgRlHBoxi/U2mRbfr93pjeLwy6zndAbaZqoCxqI5woSr7Tt6LXSNS+ jKFncysH/AEE0UhwRjxRD3kx/0Ca0eV7/8JfyIuAS9UFBF7fKeKOev2YU q+PXszU4s5c8vvemKm+o00hA7z44B4zzX5v/2GlhauD0SsAtXYylmsHuy s8Agh2ODBchWNtb+BDwS/kz/G8W+PcKnXkJlg9SSPIreDd5KlG2Ghjasi Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="249127963" X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="249127963" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 07:05:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="525385016" Received: from silpixa00400308.ir.intel.com ([10.237.214.95]) by orsmga006.jf.intel.com with ESMTP; 08 Apr 2022 07:05:19 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [RFC PATCH] cryptodev: add basic asymmetric crypto capability structs Date: Fri, 8 Apr 2022 15:05:18 +0100 Message-Id: <20220408140518.24634-1-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.17.1 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 This commit adds basic structs to handle asymmetric crypto capability. Signed-off-by: Arek Kusztal --- lib/cryptodev/rte_crypto_asym.h | 47 +++++++++++++++++++++++++++++++++ lib/cryptodev/rte_cryptodev.h | 8 ++++++ 2 files changed, 55 insertions(+) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index cd24d4b07b..2d58fffee5 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -386,6 +386,26 @@ struct rte_crypto_rsa_op_param { */ }; +struct rte_crypto_rsa_capability { + uint64_t padding_type; + /* Supported padding */ + union { + uint64_t hash; + /* Supported hash functions, at least one + * shall be supported */ + uint64_t mgf; + /* Supported masdk generation functions, + * at least one shall be supported */ + } padding; + uint32_t max_key_len; + /* Maximum supported key length */ + uint8_t sign_message; + /* If zero input should contain message digest, + * otherwise it should be plain message */ + uint8_t pkcs_plain_padding; + /* PKCS1_5 padding without algorithm identifier */ +}; + /** * Diffie-Hellman Operations params. * @note: @@ -416,6 +436,19 @@ struct rte_crypto_dh_op_param { */ }; +struct rte_crypto_dh_capability { + union { + uint32_t group_size; + /**< Maximum size of underliying mod group */ + uint64_t curves; + /**< Supported elliptic curve ids */ + /* uint64_t fixed_groups; ? */ + /**< Supported fixed groups */ + /* uint8_t custom_curves; ? */ + /**< Supported custom curves */ + }; +}; + /** * DSA Operations params * @@ -484,6 +517,13 @@ struct rte_crypto_ecdsa_op_param { */ }; +struct rte_crypto_ecdsa_capability { + uint64_t curves; + /**< Supported elliptic curve ids */ + /* uint8_t custom_curves; ? */ + /**< Supported custom curves */ +}; + /** * Structure for EC point multiplication operation param */ @@ -498,6 +538,13 @@ struct rte_crypto_ecpm_op_param { /**< Scalar to multiply the input point */ }; +struct rte_crypto_ecpm_capability { + uint64_t curves; + /**< Supported elliptic curve ids */ + /* uint8_t custom_curves; ? */ + /**< Supported custom curves */ +}; + /** * Asymmetric crypto transform data * diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index 45d33f4a50..79026dbb80 100644 --- a/lib/cryptodev/rte_cryptodev.h +++ b/lib/cryptodev/rte_cryptodev.h @@ -176,6 +176,14 @@ struct rte_cryptodev_asymmetric_xform_capability { /**< Range of modulus length supported by modulus based xform. * Value 0 mean implementation default */ + struct rte_crypto_ecdsa_capability ecdsa; + /**< ECDSA capability */ + struct rte_crypto_ecpm_capability ecpm; + /**< ECPM capability */ + struct rte_crypto_rsa_capability rsa; + /**< RSA capability */ + struct rte_crypto_dh_capability dh; + /**< DH capability */ }; };