From patchwork Wed Apr 13 14:03:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 109702 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 DF561A050C; Wed, 13 Apr 2022 16:26:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B361942801; Wed, 13 Apr 2022 16:26:01 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id A19C34068B for ; Wed, 13 Apr 2022 16:25:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649859959; x=1681395959; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=PBPyTfjNKtgfKLxnby1jnNJA4tnD6ySlZab8CILX0m8=; b=ZvZF28VoAtBzwCFhyeWrlRX8wELeenz13K5kwjW//rO6f5QrmUwzpTkh /Pl9k3Hqw8MBI7bCQOb1A7CvUXwy0LIoCVh2rf33YmF7Tt3WKNGSjLsoZ 5jRKEznDa6LLO2mDHZBLkKSTDUNEzivl1RvW0uO1JFwB9x2Csn31mAq5e qF68dqt9ofoF4iqWw52m06i+JLn3tHfekWBDuu66p7hpIecqhOJKtiHRx NBG758JQZ/tMFLKIK7/DWRKTnnNM+o68EDQ21Ub8jj1fq3tK4kgNwL5D0 ddCIVP5s/aYE9vMvf3MeYorsjYRoS7YYh7v27cNAS9fFlm7qtqpPkG16p A==; X-IronPort-AV: E=McAfee;i="6400,9594,10315"; a="262857175" X-IronPort-AV: E=Sophos;i="5.90,257,1643702400"; d="scan'208";a="262857175" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 07:03:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,257,1643702400"; d="scan'208";a="526950936" Received: from silpixa00400308.ir.intel.com ([10.237.214.95]) by orsmga006.jf.intel.com with ESMTP; 13 Apr 2022 07:03:33 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH v2 2/2] cryptodev: add dh padding options Date: Wed, 13 Apr 2022 15:03:27 +0100 Message-Id: <20220413140327.12915-3-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220413140327.12915-1-arkadiuszx.kusztal@intel.com> References: <20220413140327.12915-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 Diffie-Hellman padding is used in certain protocols, in others, leading zero bytes need to be stripped. Even same protocol may use a different approach - most glaring example is TLS1.2 - TLS1.3. To make the user life easier, and to avoid additional copy on certain occasions, driver should be able to return both. Signed-off-by: Arek Kusztal --- lib/cryptodev/rte_crypto_asym.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h index c4f4afa07f..e757663e8e 100644 --- a/lib/cryptodev/rte_crypto_asym.h +++ b/lib/cryptodev/rte_crypto_asym.h @@ -440,7 +440,15 @@ struct rte_crypto_dh_op_param { * Full verification | 0 | steps of point verification (full validation), * | | otherwise three (partial validation - default). *-------------------------------------------------------------------------------- - * Reserved | 1-15 | Reserved + * | | If set to 1 - public key will be returned + * Public key padding | 1 | without leading zero bytes, otherwise it will be + * | | padded to the left with zero bytes (default) + *-------------------------------------------------------------------------------- + * | | If set to 1 - shared key will be returned + * Shared key padding | 2 | without leading zero bytes, otherwise it will be + * | | padded to the left with zero bytes (default) + *-------------------------------------------------------------------------------- + * Reserved | 3-15 | Reserved */ };