Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/65584/?format=api
http://patches.dpdk.org/api/patches/65584/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1580908578-3384-4-git-send-email-anoobj@marvell.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1580908578-3384-4-git-send-email-anoobj@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1580908578-3384-4-git-send-email-anoobj@marvell.com", "date": "2020-02-05T13:16:15", "name": "[3/6] common/cpt: support variable key size for HMAC", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "83f7225192bfce7f8feb3d7af5365c606ea5586a", "submitter": { "id": 1205, "url": "http://patches.dpdk.org/api/people/1205/?format=api", "name": "Anoob Joseph", "email": "anoobj@marvell.com" }, "delegate": { "id": 6690, "url": "http://patches.dpdk.org/api/users/6690/?format=api", "username": "akhil", "first_name": "akhil", "last_name": "goyal", "email": "gakhil@marvell.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1580908578-3384-4-git-send-email-anoobj@marvell.com/mbox/", "series": [ { "id": 8429, "url": "http://patches.dpdk.org/api/series/8429/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8429", "date": "2020-02-05T13:16:12", "name": "code improvements for OCTEON TX crypto PMDs", "version": 1, "mbox": "http://patches.dpdk.org/series/8429/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/65584/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/65584/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 32DD6A04FA;\n\tWed, 5 Feb 2020 14:17:08 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id AAF441C1B3;\n\tWed, 5 Feb 2020 14:16:51 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 5AB651C195\n for <dev@dpdk.org>; Wed, 5 Feb 2020 14:16:50 +0100 (CET)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 015DFFcF004759; Wed, 5 Feb 2020 05:16:48 -0800", "from sc-exch03.marvell.com ([199.233.58.183])\n by mx0a-0016f401.pphosted.com with ESMTP id 2xyhmtauv7-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 05 Feb 2020 05:16:48 -0800", "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 5 Feb\n 2020 05:16:46 -0800", "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Wed, 5 Feb 2020 05:16:47 -0800", "from ajoseph83.caveonetworks.com (unknown [10.29.45.60])\n by maili.marvell.com (Postfix) with ESMTP id 451BE3F72F1;\n Wed, 5 Feb 2020 05:16:45 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0818;\n bh=87K9L70uRN51rb5eBIUUisdJdzlD/PKoldY6Df6JLL4=;\n b=iMvpAf8L8yOzurJ0R1KYd7zSD6VUcRaF2mf/WT+Xbl4F7ByzSWoo9u+QgPVugVsgI7Ce\n Ic4ZebFl3YU6+dutgWH0toPE+lCF8R3FxFbodoiezbLtN2PGtfX6gXseyBKZteI6pOwA\n KF0I5cX9vF+Tpb3Jw94Ek4AVSeuPPC1lfNwt88C4JWe6K3qUwe6VpNfYa1P9uZGukySM\n vNHyPtX+O8At88TXX/ajhellnxyfHiX41oCSVOx9Pax145rYHYXPEst+IjnoUna2lSGP\n MIv60RoOT4Ao4fbMCFPUsl+ESgahBTytcZms6GPpINch1YpxXD3E5p8lhvG3Djehqk6Z WA==", "From": "Anoob Joseph <anoobj@marvell.com>", "To": "Akhil Goyal <akhil.goyal@nxp.com>", "CC": "Sucharitha Sarananaga <ssarananaga@marvell.com>, <dev@dpdk.org>, \"Archana\n Muniganti\" <marchana@marvell.com>, Anoob Joseph <anoobj@marvell.com>", "Date": "Wed, 5 Feb 2020 18:46:15 +0530", "Message-ID": "<1580908578-3384-4-git-send-email-anoobj@marvell.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1580908578-3384-1-git-send-email-anoobj@marvell.com>", "References": "<1580908578-3384-1-git-send-email-anoobj@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572\n definitions=2020-02-05_04:2020-02-04,\n 2020-02-05 signatures=0", "Subject": "[dpdk-dev] [PATCH 3/6] common/cpt: support variable key size for\n\tHMAC", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Sucharitha Sarananaga <ssarananaga@marvell.com>\n\nHMAC algorithms supports key lengths from 1 to 1024 bytes.\n\nSigned-off-by: Archana Muniganti <marchana@marvell.com>\nSigned-off-by: Sucharitha Sarananaga <ssarananaga@marvell.com>\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\n---\n drivers/common/cpt/cpt_mcode_defines.h | 2 +-\n drivers/common/cpt/cpt_ucode.h | 15 ++++++-----\n .../crypto/octeontx/otx_cryptodev_capabilities.c | 30 +++++++++++-----------\n .../crypto/octeontx2/otx2_cryptodev_capabilities.c | 30 +++++++++++-----------\n 4 files changed, 40 insertions(+), 37 deletions(-)", "diff": "diff --git a/drivers/common/cpt/cpt_mcode_defines.h b/drivers/common/cpt/cpt_mcode_defines.h\nindex 8bb09e6..69d831b 100644\n--- a/drivers/common/cpt/cpt_mcode_defines.h\n+++ b/drivers/common/cpt/cpt_mcode_defines.h\n@@ -320,7 +320,7 @@ struct cpt_ctx {\n \t\tmc_zuc_snow3g_ctx_t zs_ctx;\n \t\tmc_kasumi_ctx_t k_ctx;\n \t};\n-\tuint8_t auth_key[64];\n+\tuint8_t auth_key[1024];\n };\n \n /* Prime and order fields of built-in elliptic curves */\ndiff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h\nindex 24b53a1..4ef87c2 100644\n--- a/drivers/common/cpt/cpt_ucode.h\n+++ b/drivers/common/cpt/cpt_ucode.h\n@@ -230,6 +230,9 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key,\n \t\t * sometimes iverride IV per operation.\n \t\t */\n \t\tfctx->enc.iv_source = CPT_FROM_DPTR;\n+\n+\t\tif (cpt_ctx->auth_key_len > 64)\n+\t\t\treturn -1;\n \t}\n \n \tswitch (type) {\n@@ -2537,6 +2540,9 @@ cpt_fc_auth_set_key(void *ctx, auth_type_t type, const uint8_t *key,\n \t\t\tcpt_ctx->fc_type = HASH_HMAC;\n \t}\n \n+\tif (cpt_ctx->fc_type == FC_GEN && key_len > 64)\n+\t\treturn -1;\n+\n \t/* For GMAC auth, cipher must be NULL */\n \tif (type == GMAC_TYPE)\n \t\tfctx->enc.enc_cipher = 0;\n@@ -2551,7 +2557,9 @@ cpt_fc_auth_set_key(void *ctx, auth_type_t type, const uint8_t *key,\n \t\tcpt_ctx->auth_key_len = key_len;\n \t\tmemset(fctx->hmac.ipad, 0, sizeof(fctx->hmac.ipad));\n \t\tmemset(fctx->hmac.opad, 0, sizeof(fctx->hmac.opad));\n-\t\tmemcpy(fctx->hmac.opad, key, key_len);\n+\n+\t\tif (key_len <= 64)\n+\t\t\tmemcpy(fctx->hmac.opad, key, key_len);\n \t\tfctx->enc.auth_input_type = 1;\n \t}\n \treturn 0;\n@@ -2736,11 +2744,6 @@ fill_sess_auth(struct rte_crypto_sym_xform *xform,\n \t\treturn -1;\n \t}\n \n-\tif (a_form->key.length > 64) {\n-\t\tCPT_LOG_DP_ERR(\"Auth key length is big\");\n-\t\treturn -1;\n-\t}\n-\n \tswitch (a_form->algo) {\n \tcase RTE_CRYPTO_AUTH_SHA1_HMAC:\n \t\t/* Fall through */\ndiff --git a/drivers/crypto/octeontx/otx_cryptodev_capabilities.c b/drivers/crypto/octeontx/otx_cryptodev_capabilities.c\nindex 1174ee4..3f734b2 100644\n--- a/drivers/crypto/octeontx/otx_cryptodev_capabilities.c\n+++ b/drivers/crypto/octeontx/otx_cryptodev_capabilities.c\n@@ -141,9 +141,9 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {\n \t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,\n \t\t\t\t.block_size = 64,\n \t\t\t\t.key_size = {\n-\t\t\t\t\t.min = 64,\n-\t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.min = 1,\n+\t\t\t\t\t.max = 1024,\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n \t\t\t\t\t.min = 20,\n@@ -181,9 +181,9 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {\n \t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,\n \t\t\t\t.block_size = 64,\n \t\t\t\t\t.key_size = {\n-\t\t\t\t\t.min = 64,\n-\t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.min = 1,\n+\t\t\t\t\t.max = 1024,\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n \t\t\t\t\t.min = 28,\n@@ -221,9 +221,9 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {\n \t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,\n \t\t\t\t.block_size = 64,\n \t\t\t\t.key_size = {\n-\t\t\t\t\t.min = 64,\n-\t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.min = 1,\n+\t\t\t\t\t.max = 1024,\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n \t\t\t\t\t.min = 32,\n@@ -261,9 +261,9 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {\n \t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,\n \t\t\t\t.block_size = 64,\n \t\t\t\t.key_size = {\n-\t\t\t\t\t.min = 64,\n-\t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.min = 1,\n+\t\t\t\t\t.max = 1024,\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n \t\t\t\t\t.min = 48,\n@@ -301,9 +301,9 @@ static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {\n \t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,\n \t\t\t\t.block_size = 128,\n \t\t\t\t.key_size = {\n-\t\t\t\t\t.min = 64,\n-\t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.min = 1,\n+\t\t\t\t\t.max = 1024,\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n \t\t\t\t\t.min = 64,\ndiff --git a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c\nindex 2ddf628..3eb3d85 100644\n--- a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c\n+++ b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c\n@@ -142,9 +142,9 @@ rte_cryptodev_capabilities otx2_cpt_capabilities[] = {\n \t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,\n \t\t\t\t.block_size = 64,\n \t\t\t\t.key_size = {\n-\t\t\t\t\t.min = 64,\n-\t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.min = 1,\n+\t\t\t\t\t.max = 1024,\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n \t\t\t\t\t.min = 20,\n@@ -182,9 +182,9 @@ rte_cryptodev_capabilities otx2_cpt_capabilities[] = {\n \t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,\n \t\t\t\t.block_size = 64,\n \t\t\t\t\t.key_size = {\n-\t\t\t\t\t.min = 64,\n-\t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.min = 1,\n+\t\t\t\t\t.max = 1024,\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n \t\t\t\t\t.min = 28,\n@@ -222,9 +222,9 @@ rte_cryptodev_capabilities otx2_cpt_capabilities[] = {\n \t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,\n \t\t\t\t.block_size = 64,\n \t\t\t\t.key_size = {\n-\t\t\t\t\t.min = 64,\n-\t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.min = 1,\n+\t\t\t\t\t.max = 1024,\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n \t\t\t\t\t.min = 32,\n@@ -262,9 +262,9 @@ rte_cryptodev_capabilities otx2_cpt_capabilities[] = {\n \t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,\n \t\t\t\t.block_size = 64,\n \t\t\t\t.key_size = {\n-\t\t\t\t\t.min = 64,\n-\t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.min = 1,\n+\t\t\t\t\t.max = 1024,\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n \t\t\t\t\t.min = 48,\n@@ -302,9 +302,9 @@ rte_cryptodev_capabilities otx2_cpt_capabilities[] = {\n \t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,\n \t\t\t\t.block_size = 128,\n \t\t\t\t.key_size = {\n-\t\t\t\t\t.min = 64,\n-\t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.min = 1,\n+\t\t\t\t\t.max = 1024,\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n \t\t\t\t\t.min = 64,\n", "prefixes": [ "3/6" ] }{ "id": 65584, "url": "