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 15A18A0C46; Tue, 7 Sep 2021 11:14:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4276C4114B; Tue, 7 Sep 2021 11:13:54 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id D5858410EB for ; Tue, 7 Sep 2021 11:13:50 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10099"; a="207259286" X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="207259286" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 02:13:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="692370516" Received: from silpixa00400884.ir.intel.com ([10.243.22.82]) by fmsmga006.fm.intel.com with ESMTP; 07 Sep 2021 02:13:48 -0700 From: Radu Nicolau To: Declan Doherty , Pablo de Lara Cc: dev@dpdk.org, Radu Nicolau Date: Tue, 7 Sep 2021 10:07:14 +0100 Message-Id: <20210907090715.460856-3-radu.nicolau@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210907090715.460856-1-radu.nicolau@intel.com> References: <20210907090715.460856-1-radu.nicolau@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 3/3] crypto/aesni_gcm: add AES CCM support 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 Sender: "dev" Add support for AES CCM. Signed-off-by: Declan Doherty Signed-off-by: Radu Nicolau --- drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 8 +++--- drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c | 30 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index 886e2a5aaa..ee36b36f42 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -73,13 +73,13 @@ aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *gcm_ops, key = auth_xform->auth.key.data; sess->req_digest_length = auth_xform->auth.digest_length; - /* AES-GCM */ + /* AES-GCM - AES-CCM */ } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AEAD) { aead_xform = xform; - - if (aead_xform->aead.algo != RTE_CRYPTO_AEAD_AES_GCM) { + if ((aead_xform->aead.algo != RTE_CRYPTO_AEAD_AES_GCM) && + (aead_xform->aead.algo != RTE_CRYPTO_AEAD_AES_CCM)) { AESNI_GCM_LOG(ERR, "The only combined operation " - "supported is AES GCM"); + "supported is AES GCM/CCM"); return -ENOTSUP; } diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c index 18dbc4c18c..989d42b4b7 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c @@ -66,6 +66,36 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = { }, } }, } }, + { /* AES CCM */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AEAD, + {.aead = { + .algo = RTE_CRYPTO_AEAD_AES_CCM, + .block_size = 16, + .key_size = { + .min = 16, + .max = 32, + .increment = 8 + }, + .digest_size = { + .min = 1, + .max = 16, + .increment = 1 + }, + .aad_size = { + .min = 0, + .max = 65535, + .increment = 1 + }, + .iv_size = { + .min = 12, + .max = 12, + .increment = 0 + } + }, } + }, } + }, RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() }; -- 2.25.1