From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF923A00C5; Thu, 7 May 2020 12:59:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 577ED1DC0A; Thu, 7 May 2020 12:59:16 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 0E4241DC04 for ; Thu, 7 May 2020 12:59:13 +0200 (CEST) IronPort-SDR: 6JuFO4SaNFI7zNmg+ssjZW2ronWOBseMdz5o/Hiz+hOjKHClyMFg8+mjLerGlFpm1vvecBDuuK haG7ZzWLr/Wg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2020 03:59:12 -0700 IronPort-SDR: r5J+JAR2Vxyz/oCnK5QWZKCB51kwDcJIW7vj7TlOl9KnC9Es00YAM4HvGeuH7+/UMH0dO5WYyG GOCpbNquuXIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,363,1583222400"; d="scan'208";a="278562367" Received: from akusztax-mobl.ger.corp.intel.com ([10.104.121.88]) by orsmga002.jf.intel.com with ESMTP; 07 May 2020 03:59:11 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: fiona.trahe@intel.com, ray.kinsella@intel.com, akhil.goyal@nxp.com, bruce.richardson@intel.com, Arek Kusztal Date: Thu, 7 May 2020 12:57:02 +0200 Message-Id: <20200507105703.11804-1-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.19.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v5 1/2] cryptodev: add chacha20-poly1305 aead algorithm X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds Chacha20-Poly1305 AEAD algorithm to Cryptodev. Signed-off-by: Arek Kusztal Acked-by: Fiona Trahe Acked-by: Anoob Joseph Acked-by: Akhil Goyal --- v3: - rebased against 20.05 v4: - rebased again against 20.05 v5: - resent with versioning patch which needed v5 doc/guides/cryptodevs/features/default.ini | 13 +++++++------ doc/guides/rel_notes/release_20_05.rst | 4 ++++ lib/librte_cryptodev/rte_crypto_sym.h | 9 +++++++++ lib/librte_cryptodev/rte_cryptodev.c | 1 + 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini index 118479d..800bcf8 100644 --- a/doc/guides/cryptodevs/features/default.ini +++ b/doc/guides/cryptodevs/features/default.ini @@ -95,12 +95,13 @@ SHA3_512 HMAC = ; Supported AEAD algorithms of a default crypto driver. ; [AEAD] -AES GCM (128) = -AES GCM (192) = -AES GCM (256) = -AES CCM (128) = -AES CCM (192) = -AES CCM (256) = +AES GCM (128) = +AES GCM (192) = +AES GCM (256) = +AES CCM (128) = +AES CCM (192) = +AES CCM (256) = +CHACHA20-POLY1305 = ; ; Supported Asymmetric algorithms of a default crypto driver. ; diff --git a/doc/guides/rel_notes/release_20_05.rst b/doc/guides/rel_notes/release_20_05.rst index b124c3f..88396e8 100644 --- a/doc/guides/rel_notes/release_20_05.rst +++ b/doc/guides/rel_notes/release_20_05.rst @@ -212,6 +212,10 @@ New Features * Added IPsec inbound load-distribution support for ipsec-secgw application using NIC load distribution feature(Flow Director). +* **Added Chacha20-Poly1305 algorithm to Cryptodev API.** + + Chacha20-Poly1305 AEAD algorithm can now be supported in Cryptodev. + Removed Items ------------- diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h index 9e887c1..d9585ec 100644 --- a/lib/librte_cryptodev/rte_crypto_sym.h +++ b/lib/librte_cryptodev/rte_crypto_sym.h @@ -409,6 +409,8 @@ enum rte_crypto_aead_algorithm { /**< AES algorithm in CCM mode. */ RTE_CRYPTO_AEAD_AES_GCM, /**< AES algorithm in GCM mode. */ + RTE_CRYPTO_AEAD_CHACHA20_POLY1305, + /**< Chacha20 cipher with poly1305 authenticator */ RTE_CRYPTO_AEAD_LIST_END }; @@ -452,6 +454,11 @@ struct rte_crypto_aead_xform { * be allocated, even though the length field will * have a value less than this. * + * - For Chacha20-Poly1305 it is 96-bit nonce. + * PMD sets initial counter for Poly1305 key generation + * part to 0 and for Chacha20 encryption to 1 as per + * rfc8439 2.8. AEAD construction. + * * For optimum performance, the data pointed to SHOULD * be 8-byte aligned. */ @@ -468,6 +475,8 @@ struct rte_crypto_aead_xform { * * - For CCM mode, this is the length of the nonce, * which can be in the range 7 to 13 inclusive. + * + * - For Chacha20-Poly1305 this field is always 12. */ } iv; /**< Initialisation vector parameters */ diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 7693eb6..a499c47 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -152,6 +152,7 @@ const char * rte_crypto_aead_algorithm_strings[] = { [RTE_CRYPTO_AEAD_AES_CCM] = "aes-ccm", [RTE_CRYPTO_AEAD_AES_GCM] = "aes-gcm", + [RTE_CRYPTO_AEAD_CHACHA20_POLY1305] = "chacha20-poly1305" }; /** -- 2.1.0