From patchwork Mon Jul 26 04:48:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiran Kumar Kokkilagadda X-Patchwork-Id: 96269 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 CEAE8A0C47; Mon, 26 Jul 2021 06:49:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5593940F35; Mon, 26 Jul 2021 06:49:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5136340DDA for ; Mon, 26 Jul 2021 06:49:03 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16Q4kiEM020806 for ; Sun, 25 Jul 2021 21:49:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=u8huC68KzJy0g3XNg/rl30YL7YSg3W8/1B7KlvNoilg=; b=GCBeS3duJtBNIYRGXT+8jT0qZS6mjdAB6owEPjKAy/5U02ND0QdfrbhSuQSoZWeTi8Uk QRQvgbVqsE2f9j5RjiGwLdTlmKzDHmEpg7GiOqUNJ5PdepYCPEM0DVqtiUHccn5+atAS PoiqHdEj7AU0vPVrYDmv3+IoTmg2VNbwCqtPQyfifUTjujauhyCYjHCV26V28UsugxMc IS2bU7vVv5zn2Oi2U1k6wPqpXhKZHht0YaezheAaCtGHZnrwk4SbJHjc5g2w4gGu8vWn 8rlssvgR0fdUz3fW91/aih46b0l/n6h780t5J1+8iqq7fpWE2tTfWfvrDZIJAX0WEdNL ng== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 3a1m9609sd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 25 Jul 2021 21:49:02 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 25 Jul 2021 21:49:00 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Sun, 25 Jul 2021 21:49:00 -0700 Received: from localhost.localdomain (unknown [10.28.34.15]) by maili.marvell.com (Postfix) with ESMTP id 164A13F7040; Sun, 25 Jul 2021 21:48:56 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: Date: Mon, 26 Jul 2021 10:18:51 +0530 Message-ID: <20210726044853.2232433-1-kirankumark@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 3wRcEwmn5C_Jxn2E3VeCMoLOj_cAdyHF X-Proofpoint-GUID: 3wRcEwmn5C_Jxn2E3VeCMoLOj_cAdyHF X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-26_01:2021-07-23, 2021-07-26 signatures=0 Subject: [dpdk-dev] [PATCH 1/3] common/cnxk: add const values to ec groups 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" From: Kiran Kumar K New ucode expects const values A and B for asymmetric ECDSA messages. Adding roc support for this. Signed-off-by: Kiran Kumar K --- drivers/common/cnxk/roc_ae.c | 70 ++++++++++++++++++++++++++++++++++-- drivers/common/cnxk/roc_ae.h | 17 ++++++++- 2 files changed, 84 insertions(+), 3 deletions(-) diff --git a/drivers/common/cnxk/roc_ae.c b/drivers/common/cnxk/roc_ae.c index cf3f7fc5f2..929da05983 100644 --- a/drivers/common/cnxk/roc_ae.c +++ b/drivers/common/cnxk/roc_ae.c @@ -23,6 +23,16 @@ const struct roc_ae_ec_group ae_ec_grp[ROC_AE_EC_ID_PMAX] = { 0x99, 0xDE, 0xF8, 0x36, 0x14, 0x6B, 0xC9, 0xB1, 0xB4, 0xD2, 0x28, 0x31}, .length = 24}, + .consta = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC}, + .length = 24}, + .constb = {.data = {0x64, 0x21, 0x05, 0x19, 0xE5, 0x9C, + 0x80, 0xE7, 0x0F, 0xA7, 0xE9, 0xAB, + 0x72, 0x24, 0x30, 0x49, 0xFE, 0xB8, + 0xDE, 0xEC, 0xC1, 0x46, 0xB9, 0xB1}, + .length = 24}, }, { .prime = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, @@ -35,6 +45,16 @@ const struct roc_ae_ec_group ae_ec_grp[ROC_AE_EC_ID_PMAX] = { 0X16, 0XA2, 0XE0, 0XB8, 0XF0, 0X3E, 0X13, 0XDD, 0X29, 0X45, 0X5C, 0X5C, 0X2A, 0X3D}, .length = 28}, + .consta = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE}, + .length = 28}, + .constb = {.data = {0xB4, 0x05, 0x0A, 0x85, 0x0C, 0x04, 0xB3, + 0xAB, 0xF5, 0x41, 0x32, 0x56, 0x50, 0x44, + 0xB0, 0xB7, 0xD7, 0xBF, 0xD8, 0xBA, 0x27, + 0x0B, 0x39, 0x43, 0x23, 0x55, 0xFF, 0xB4}, + .length = 28}, }, { .prime = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, @@ -49,6 +69,18 @@ const struct roc_ae_ec_group ae_ec_grp[ROC_AE_EC_ID_PMAX] = { 0x17, 0x9E, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51}, .length = 32}, + .consta = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFC}, + .length = 32}, + .constb = {.data = {0x5A, 0xC6, 0x35, 0xD8, 0xAA, 0x3A, 0x93, + 0xE7, 0xB3, 0xEB, 0xBD, 0x55, 0x76, 0x98, + 0x86, 0xBC, 0x65, 0x1D, 0x06, 0xB0, 0xCC, + 0x53, 0xB0, 0xF6, 0x3B, 0xCE, 0x3C, 0x3E, + 0x27, 0xD2, 0x60, 0x4B}, + .length = 32}, }, {.prime = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, @@ -63,7 +95,21 @@ const struct roc_ae_ec_group ae_ec_grp[ROC_AE_EC_ID_PMAX] = { 0xC7, 0x63, 0x4D, 0x81, 0xF4, 0x37, 0x2D, 0xDF, 0x58, 0x1A, 0x0D, 0xB2, 0x48, 0xB0, 0xA7, 0x7A, 0xEC, 0xEC, 0x19, 0x6A, 0xCC, 0xC5, 0x29, 0x73}, - .length = 48}}, + .length = 48}, + .consta = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFC}, + .length = 48}, + .constb = {.data = {0xB3, 0x31, 0x2F, 0xA7, 0xE2, 0x3E, 0xE7, 0xE4, + 0x98, 0x8E, 0x05, 0x6B, 0xE3, 0xF8, 0x2D, 0x19, + 0x18, 0x1D, 0x9C, 0x6E, 0xFE, 0x81, 0x41, 0x12, + 0x03, 0x14, 0x08, 0x8F, 0x50, 0x13, 0x87, 0x5A, + 0xC6, 0x56, 0x39, 0x8D, 0x8A, 0x2E, 0xD1, 0x9D, + 0x2A, 0x85, 0xC8, 0xED, 0xD3, 0xEC, 0x2A, 0xEF}, + .length = 48}}, {.prime = {.data = {0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, @@ -83,7 +129,27 @@ const struct roc_ae_ec_group ae_ec_grp[ROC_AE_EC_ID_PMAX] = { 0xA5, 0xD0, 0x3B, 0xB5, 0xC9, 0xB8, 0x89, 0x9C, 0x47, 0xAE, 0xBB, 0x6F, 0xB7, 0x1E, 0x91, 0x38, 0x64, 0x09}, - .length = 66}}}; + .length = 66}, + .consta = {.data = {0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFC}, + .length = 66}, + .constb = {.data = {0x00, 0x51, 0x95, 0x3E, 0xB9, 0x61, 0x8E, 0x1C, + 0x9A, 0x1F, 0x92, 0x9A, 0x21, 0xA0, 0xB6, 0x85, + 0x40, 0xEE, 0xA2, 0xDA, 0x72, 0x5B, 0x99, 0xB3, + 0x15, 0xF3, 0xB8, 0xB4, 0x89, 0x91, 0x8E, 0xF1, + 0x09, 0xE1, 0x56, 0x19, 0x39, 0x51, 0xEC, 0x7E, + 0x93, 0x7B, 0x16, 0x52, 0xC0, 0xBD, 0x3B, 0xB1, + 0xBF, 0x07, 0x35, 0x73, 0xDF, 0x88, 0x3D, 0x2C, + 0x34, 0xF1, 0xEF, 0x45, 0x1F, 0xD4, 0x6B, 0x50, + 0x3F, 0x00}, + .length = 66}}}; int roc_ae_ec_grp_get(struct roc_ae_ec_group **tbl) diff --git a/drivers/common/cnxk/roc_ae.h b/drivers/common/cnxk/roc_ae.h index 5072cc5a5e..9c637d67ef 100644 --- a/drivers/common/cnxk/roc_ae.h +++ b/drivers/common/cnxk/roc_ae.h @@ -30,7 +30,10 @@ typedef enum { ROC_AE_EC_ID_P256 = 2, ROC_AE_EC_ID_P384 = 3, ROC_AE_EC_ID_P521 = 4, - ROC_AE_EC_ID_PMAX = 5 + ROC_AE_EC_ID_P160 = 5, + ROC_AE_EC_ID_P320 = 6, + ROC_AE_EC_ID_P512 = 7, + ROC_AE_EC_ID_PMAX = 8 } roc_ae_ec_id; /* Prime and order fields of built-in elliptic curves */ @@ -46,6 +49,18 @@ struct roc_ae_ec_group { uint8_t data[66]; unsigned int length; } order; + + struct { + /* P521 maximum length */ + uint8_t data[66]; + unsigned int length; + } consta; + + struct { + /* P521 maximum length */ + uint8_t data[66]; + unsigned int length; + } constb; }; struct roc_ae_ec_ctx { From patchwork Mon Jul 26 04:48:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiran Kumar Kokkilagadda X-Patchwork-Id: 96271 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 42854A0C47; Mon, 26 Jul 2021 06:49:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B5F7410F5; Mon, 26 Jul 2021 06:49:07 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D3784410EA for ; Mon, 26 Jul 2021 06:49:04 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16Q4k836020649 for ; Sun, 25 Jul 2021 21:49:04 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=2EPmNbX+ImfzFSlCon3PqbwXTO8GUEGiwLsJbJt/0+M=; b=RL7ctzwKEvzIRATsLnHxQ1Lo6DU1emfsJLWiq3t5DlaW83tz+Zx4zLps53HhTmLvcSwN RCbDX1cDE4m1EzsA6Y5yjl3oKmqBOHgm0UtMt20Xy6gaBbQUNypLX/xYuv3HJCaE66n8 aobudt5ZEVTEJjIuE2W/C271XOZQ2zUlifPtd6LsP+LbgsGPwjXLAuSjIQglPsJd0VrZ PmQJmLLHM4ICqP84SLbh47Z/9CG5PXzGj/M1Jft3qLu+y3FptzbMU2kDmPmCPt++meK/ IBU1ZF7h4c3c0ygpmnBdXt4pB3oWqxPrbE2w9Mlz9pQOHtYIptbvltQyCodrmNn+E/Ud Vg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 3a1m9609sf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 25 Jul 2021 21:49:04 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 25 Jul 2021 21:49:02 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Sun, 25 Jul 2021 21:49:02 -0700 Received: from localhost.localdomain (unknown [10.28.34.15]) by maili.marvell.com (Postfix) with ESMTP id 2B81B5E6868; Sun, 25 Jul 2021 21:48:58 -0700 (PDT) From: To: Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj CC: , Kiran Kumar K Date: Mon, 26 Jul 2021 10:18:52 +0530 Message-ID: <20210726044853.2232433-2-kirankumark@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210726044853.2232433-1-kirankumark@marvell.com> References: <20210726044853.2232433-1-kirankumark@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: oBvyTvn8BTnl918YDM7Ld4YfB_X6PCMm X-Proofpoint-GUID: oBvyTvn8BTnl918YDM7Ld4YfB_X6PCMm X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-26_01:2021-07-23, 2021-07-26 signatures=0 Subject: [dpdk-dev] [PATCH 2/3] crypto/cnxk: update asym ECDSA messages in sync with ucode 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" From: Kiran Kumar K Adding changes to asymmetric ECDSA messages to align with the new ucode for cnxk device. Signed-off-by: Kiran Kumar K --- drivers/crypto/cnxk/cnxk_ae.h | 24 ++++++++++++++++++++---- drivers/crypto/cnxk/cnxk_cryptodev.h | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/cnxk/cnxk_ae.h b/drivers/crypto/cnxk/cnxk_ae.h index c752e62ea5..174a940ab8 100644 --- a/drivers/crypto/cnxk/cnxk_ae.h +++ b/drivers/crypto/cnxk/cnxk_ae.h @@ -439,7 +439,7 @@ cnxk_ae_ecdsa_sign_prep(struct rte_crypto_ecdsa_op_param *ecdsa, * Please note, private key, order cannot exceed prime * length i.e 3 * p_align. */ - dlen = sizeof(fpm_table_iova) + k_align + m_align + p_align * 3; + dlen = sizeof(fpm_table_iova) + k_align + m_align + p_align * 5; memset(dptr, 0, dlen); @@ -461,12 +461,18 @@ cnxk_ae_ecdsa_sign_prep(struct rte_crypto_ecdsa_op_param *ecdsa, memcpy(dptr, ecdsa->message.data, message_len); dptr += m_align; + memcpy(dptr, ec_grp->consta.data, prime_len); + dptr += p_align; + + memcpy(dptr, ec_grp->constb.data, prime_len); + dptr += p_align; + /* Setup opcodes */ w4.s.opcode_major = ROC_AE_MAJOR_OP_ECDSA; w4.s.opcode_minor = ROC_AE_MINOR_OP_ECDSA_SIGN; w4.s.param1 = curveid | (message_len << 8); - w4.s.param2 = k_len; + w4.s.param2 = (pkey_len << 8) | k_len; w4.s.dlen = dlen; inst->w4.u64 = w4.u64; @@ -521,7 +527,7 @@ cnxk_ae_ecdsa_verify_prep(struct rte_crypto_ecdsa_op_param *ecdsa, * Please note sign, public key and order can not exceed prime length * i.e. 6 * p_align */ - dlen = sizeof(fpm_table_iova) + m_align + (6 * p_align); + dlen = sizeof(fpm_table_iova) + m_align + (8 * p_align); memset(dptr, 0, dlen); @@ -549,6 +555,12 @@ cnxk_ae_ecdsa_verify_prep(struct rte_crypto_ecdsa_op_param *ecdsa, memcpy(dptr + qy_offset, ecdsa->q.y.data, qy_len); dptr += p_align; + memcpy(dptr, ec_grp->consta.data, prime_len); + dptr += p_align; + + memcpy(dptr, ec_grp->constb.data, prime_len); + dptr += p_align; + /* Setup opcodes */ w4.s.opcode_major = ROC_AE_MAJOR_OP_ECDSA; w4.s.opcode_minor = ROC_AE_MINOR_OP_ECDSA_VERIFY; @@ -612,7 +624,7 @@ cnxk_ae_ecpm_prep(struct rte_crypto_ecpm_op_param *ecpm, * scalar length), * Please note point length is equivalent to prime of the curve */ - dlen = 3 * p_align + scalar_align; + dlen = 5 * p_align + scalar_align; x1_offset = prime_len - x1_len; y1_offset = prime_len - y1_len; @@ -628,6 +640,10 @@ cnxk_ae_ecpm_prep(struct rte_crypto_ecpm_op_param *ecpm, dptr += scalar_align; memcpy(dptr, ec_grp->prime.data, ec_grp->prime.length); dptr += p_align; + memcpy(dptr, ec_grp->consta.data, ec_grp->consta.length); + dptr += p_align; + memcpy(dptr, ec_grp->constb.data, ec_grp->constb.length); + dptr += p_align; /* Setup opcodes */ w4.s.opcode_major = ROC_AE_MAJOR_OP_ECC; diff --git a/drivers/crypto/cnxk/cnxk_cryptodev.h b/drivers/crypto/cnxk/cnxk_cryptodev.h index ff46d16e58..b3856f7eaa 100644 --- a/drivers/crypto/cnxk/cnxk_cryptodev.h +++ b/drivers/crypto/cnxk/cnxk_cryptodev.h @@ -13,7 +13,7 @@ #define CNXK_CPT_MAX_CAPS 34 #define CNXK_SEC_CRYPTO_MAX_CAPS 4 #define CNXK_SEC_MAX_CAPS 3 -#define CNXK_AE_EC_ID_MAX 5 +#define CNXK_AE_EC_ID_MAX 8 /** * Device private data */ From patchwork Mon Jul 26 04:48:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiran Kumar Kokkilagadda X-Patchwork-Id: 96270 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 36C98A0C47; Mon, 26 Jul 2021 06:49:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59098410EA; Mon, 26 Jul 2021 06:49:06 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id B4731410E6 for ; Mon, 26 Jul 2021 06:49:04 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16Q4jsKD013334 for ; Sun, 25 Jul 2021 21:49:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=X8KqQ6zk7vqEamcEPI48Fjal3eX1C2z3q9/eZGghWds=; b=GyLZ1FgLwNDqzxwGf2ks8OEdXx2SSyjGBg1yHRwwTzcOfHj14E5KfcjwQjvLWBmell57 1sm8Ib3eCX1odNuCfRCZgfxJxq4v6zIzgSWNNBuokw3aQ7qjFhhJpGLljVZt6UzEsar8 oihEFQ8cZNkWfmPIIEN4bdwzIXUYH4lkNl1l1Wbpubp7ltsW8NENB0EPsTOipkwSkTns QsbRB3TbKNpsLnkGDik20DLRCf2D+y+XaZCmgUL2DOFTA6juyJNfws1+5H1igyyZAKUj rcSWy19VPqEBbIxl6cWDCetneO04RtyMYHth+MbtlVxz+91HSEAt2JEpFBI2t5YaFM6i OA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3a1avp9akm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 25 Jul 2021 21:49:03 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 25 Jul 2021 21:49:02 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Sun, 25 Jul 2021 21:49:02 -0700 Received: from localhost.localdomain (unknown [10.28.34.15]) by maili.marvell.com (Postfix) with ESMTP id 3DC5C3F7051; Sun, 25 Jul 2021 21:49:01 -0700 (PDT) From: To: Anoob Joseph CC: , Kiran Kumar K Date: Mon, 26 Jul 2021 10:18:53 +0530 Message-ID: <20210726044853.2232433-3-kirankumark@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210726044853.2232433-1-kirankumark@marvell.com> References: <20210726044853.2232433-1-kirankumark@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: QYwDJr0ODzOey8f9nrgzrCI3pu0v1ViH X-Proofpoint-ORIG-GUID: QYwDJr0ODzOey8f9nrgzrCI3pu0v1ViH X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-26_01:2021-07-23, 2021-07-26 signatures=0 Subject: [dpdk-dev] [PATCH 3/3] common/cpt: update asym ECDSA messages in sync with ucode 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" From: Kiran Kumar K Adding changes to asymmetric ECDSA messages to align with the new ucode for octeontx2 device. Signed-off-by: Kiran Kumar K --- drivers/common/cpt/cpt_mcode_defines.h | 17 +- drivers/common/cpt/cpt_ucode_asym.h | 267 +++++++++++++++---------- 2 files changed, 176 insertions(+), 108 deletions(-) diff --git a/drivers/common/cpt/cpt_mcode_defines.h b/drivers/common/cpt/cpt_mcode_defines.h index f63fae6b59..f16ee44297 100644 --- a/drivers/common/cpt/cpt_mcode_defines.h +++ b/drivers/common/cpt/cpt_mcode_defines.h @@ -220,7 +220,10 @@ typedef enum { CPT_EC_ID_P256 = 2, CPT_EC_ID_P384 = 3, CPT_EC_ID_P521 = 4, - CPT_EC_ID_PMAX = 5 + CPT_EC_ID_P160 = 5, + CPT_EC_ID_P320 = 6, + CPT_EC_ID_P512 = 7, + CPT_EC_ID_PMAX = 8 } cpt_ec_id_t; typedef struct sglist_comp { @@ -344,6 +347,18 @@ struct cpt_ec_group { uint8_t data[66]; unsigned int length; } order; + + struct { + /* P521 maximum length */ + uint8_t data[66]; + unsigned int length; + } consta; + + struct { + /* P521 maximum length */ + uint8_t data[66]; + unsigned int length; + } constb; }; struct cpt_asym_ec_ctx { diff --git a/drivers/common/cpt/cpt_ucode_asym.h b/drivers/common/cpt/cpt_ucode_asym.h index 50c6f58d3a..a67ded642a 100644 --- a/drivers/common/cpt/cpt_ucode_asym.h +++ b/drivers/common/cpt/cpt_ucode_asym.h @@ -486,117 +486,150 @@ cpt_enqueue_rsa_op(struct rte_crypto_op *op, static const struct cpt_ec_group ec_grp[CPT_EC_ID_PMAX] = { { .prime = { - .data = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + .data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + .length = 24, }, - .length = 24, - }, - .order = { - .data = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0xDE, 0xF8, 0x36, - 0x14, 0x6B, 0xC9, 0xB1, 0xB4, 0xD2, 0x28, 0x31 - }, - .length = 24 - }, + .order = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x99, 0xDE, 0xF8, 0x36, 0x14, 0x6B, + 0xC9, 0xB1, 0xB4, 0xD2, 0x28, 0x31}, + .length = 24}, + .consta = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC}, + .length = 24}, + .constb = {.data = {0x64, 0x21, 0x05, 0x19, 0xE5, 0x9C, + 0x80, 0xE7, 0x0F, 0xA7, 0xE9, 0xAB, + 0x72, 0x24, 0x30, 0x49, 0xFE, 0xB8, + 0xDE, 0xEC, 0xC1, 0x46, 0xB9, 0xB1}, + .length = 24}, }, { - .prime = { - .data = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01 - }, - .length = 28 - }, - .order = { - .data = { - 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, - 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0X16, 0XA2, - 0XE0, 0XB8, 0XF0, 0X3E, 0X13, 0XDD, 0X29, 0X45, - 0X5C, 0X5C, 0X2A, 0X3D - }, - .length = 28 - }, + .prime = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}, + .length = 28}, + .order = {.data = {0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, + 0X16, 0XA2, 0XE0, 0XB8, 0XF0, 0X3E, 0X13, + 0XDD, 0X29, 0X45, 0X5C, 0X5C, 0X2A, 0X3D}, + .length = 28}, + .consta = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE}, + .length = 28}, + .constb = {.data = {0xB4, 0x05, 0x0A, 0x85, 0x0C, 0x04, 0xB3, + 0xAB, 0xF5, 0x41, 0x32, 0x56, 0x50, 0x44, + 0xB0, 0xB7, 0xD7, 0xBF, 0xD8, 0xBA, 0x27, + 0x0B, 0x39, 0x43, 0x23, 0x55, 0xFF, 0xB4}, + .length = 28}, }, { - .prime = { - .data = { - 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - }, - .length = 32 - }, - .order = { - .data = { - 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84, - 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51 - }, - .length = 32 - }, + .prime = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF}, + .length = 32}, + .order = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, + 0x17, 0x9E, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, + 0xFC, 0x63, 0x25, 0x51}, + .length = 32}, + .consta = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFC}, + .length = 32}, + .constb = {.data = {0x5A, 0xC6, 0x35, 0xD8, 0xAA, 0x3A, 0x93, + 0xE7, 0xB3, 0xEB, 0xBD, 0x55, 0x76, 0x98, + 0x86, 0xBC, 0x65, 0x1D, 0x06, 0xB0, 0xCC, + 0x53, 0xB0, 0xF6, 0x3B, 0xCE, 0x3C, 0x3E, + 0x27, 0xD2, 0x60, 0x4B}, + .length = 32}, }, { - .prime = { - .data = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, - 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF - }, - .length = 48 - }, - .order = { - .data = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xC7, 0x63, 0x4D, 0x81, 0xF4, 0x37, 0x2D, 0xDF, - 0x58, 0x1A, 0x0D, 0xB2, 0x48, 0xB0, 0xA7, 0x7A, - 0xEC, 0xEC, 0x19, 0x6A, 0xCC, 0xC5, 0x29, 0x73 - }, - .length = 48 - } + .prime = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF}, + .length = 48}, + .order = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xC7, 0x63, 0x4D, 0x81, + 0xF4, 0x37, 0x2D, 0xDF, 0x58, 0x1A, 0x0D, + 0xB2, 0x48, 0xB0, 0xA7, 0x7A, 0xEC, 0xEC, + 0x19, 0x6A, 0xCC, 0xC5, 0x29, 0x73}, + .length = 48}, + .consta = {.data = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFC}, + .length = 48}, + .constb = {.data = {0xB3, 0x31, 0x2F, 0xA7, 0xE2, 0x3E, 0xE7, + 0xE4, 0x98, 0x8E, 0x05, 0x6B, 0xE3, 0xF8, + 0x2D, 0x19, 0x18, 0x1D, 0x9C, 0x6E, 0xFE, + 0x81, 0x41, 0x12, 0x03, 0x14, 0x08, 0x8F, + 0x50, 0x13, 0x87, 0x5A, 0xC6, 0x56, 0x39, + 0x8D, 0x8A, 0x2E, 0xD1, 0x9D, 0x2A, 0x85, + 0xC8, 0xED, 0xD3, 0xEC, 0x2A, 0xEF}, + .length = 48}, }, - { - .prime = { - .data = { - 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF - }, - .length = 66 - }, - .order = { - .data = { - 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFA, 0x51, 0x86, 0x87, 0x83, 0xBF, 0x2F, - 0x96, 0x6B, 0x7F, 0xCC, 0x01, 0x48, 0xF7, 0x09, - 0xA5, 0xD0, 0x3B, 0xB5, 0xC9, 0xB8, 0x89, 0x9C, - 0x47, 0xAE, 0xBB, 0x6F, 0xB7, 0x1E, 0x91, 0x38, - 0x64, 0x09 - }, - .length = 66 - } - } -}; + {.prime = {.data = {0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF}, + .length = 66}, + .order = {.data = {0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFA, 0x51, 0x86, 0x87, 0x83, 0xBF, 0x2F, + 0x96, 0x6B, 0x7F, 0xCC, 0x01, 0x48, 0xF7, 0x09, + 0xA5, 0xD0, 0x3B, 0xB5, 0xC9, 0xB8, 0x89, 0x9C, + 0x47, 0xAE, 0xBB, 0x6F, 0xB7, 0x1E, 0x91, 0x38, + 0x64, 0x09}, + .length = 66}, + .consta = {.data = {0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFC}, + .length = 66}, + .constb = {.data = {0x00, 0x51, 0x95, 0x3E, 0xB9, 0x61, 0x8E, 0x1C, + 0x9A, 0x1F, 0x92, 0x9A, 0x21, 0xA0, 0xB6, 0x85, + 0x40, 0xEE, 0xA2, 0xDA, 0x72, 0x5B, 0x99, 0xB3, + 0x15, 0xF3, 0xB8, 0xB4, 0x89, 0x91, 0x8E, 0xF1, + 0x09, 0xE1, 0x56, 0x19, 0x39, 0x51, 0xEC, 0x7E, + 0x93, 0x7B, 0x16, 0x52, 0xC0, 0xBD, 0x3B, 0xB1, + 0xBF, 0x07, 0x35, 0x73, 0xDF, 0x88, 0x3D, 0x2C, + 0x34, 0xF1, 0xEF, 0x45, 0x1F, 0xD4, 0x6B, 0x50, + 0x3F, 0x00}, + .length = 66}}}; static __rte_always_inline void cpt_ecdsa_sign_prep(struct rte_crypto_ecdsa_op_param *ecdsa, @@ -641,7 +674,7 @@ cpt_ecdsa_sign_prep(struct rte_crypto_ecdsa_op_param *ecdsa, * Please note, private key, order cannot exceed prime * length i.e 3 * p_align. */ - dlen = sizeof(fpm_table_iova) + k_align + m_align + p_align * 3; + dlen = sizeof(fpm_table_iova) + k_align + m_align + p_align * 5; memset(dptr, 0, dlen); @@ -663,6 +696,12 @@ cpt_ecdsa_sign_prep(struct rte_crypto_ecdsa_op_param *ecdsa, memcpy(dptr, ecdsa->message.data, message_len); dptr += m_align; + memcpy(dptr, ec_grp[curveid].consta.data, prime_len); + dptr += p_align; + + memcpy(dptr, ec_grp[curveid].constb.data, prime_len); + dptr += p_align; + /* 2 * prime length (for sign r and s ) */ rlen = 2 * p_align; @@ -672,7 +711,7 @@ cpt_ecdsa_sign_prep(struct rte_crypto_ecdsa_op_param *ecdsa, /* GP op header */ vq_cmd_w0.s.param1 = curveid | (message_len << 8); - vq_cmd_w0.s.param2 = k_len; + vq_cmd_w0.s.param2 = (pkey_len << 8) | k_len; vq_cmd_w0.s.dlen = dlen; /* Filling cpt_request_info structure */ @@ -743,7 +782,7 @@ cpt_ecdsa_verify_prep(struct rte_crypto_ecdsa_op_param *ecdsa, * Please note sign, public key and order can not excede prime length * i.e. 6 * p_align */ - dlen = sizeof(fpm_table_iova) + m_align + (6 * p_align); + dlen = sizeof(fpm_table_iova) + m_align + (8 * p_align); memset(dptr, 0, dlen); @@ -771,6 +810,12 @@ cpt_ecdsa_verify_prep(struct rte_crypto_ecdsa_op_param *ecdsa, memcpy(dptr + qy_offset, ecdsa->q.y.data, qy_len); dptr += p_align; + memcpy(dptr, ec_grp[curveid].consta.data, prime_len); + dptr += p_align; + + memcpy(dptr, ec_grp[curveid].constb.data, prime_len); + dptr += p_align; + /* Setup opcodes */ vq_cmd_w0.s.opcode.major = CPT_MAJOR_OP_ECDSA; vq_cmd_w0.s.opcode.minor = CPT_MINOR_OP_ECDSA_VERIFY; @@ -849,7 +894,7 @@ cpt_ecpm_prep(struct rte_crypto_ecpm_op_param *ecpm, * scalar length), * Please note point length is equivalent to prime of the curve */ - dlen = 3 * p_align + scalar_align; + dlen = 5 * p_align + scalar_align; x1_offset = prime_len - x1_len; y1_offset = prime_len - y1_len; @@ -866,6 +911,14 @@ cpt_ecpm_prep(struct rte_crypto_ecpm_op_param *ecpm, memcpy(dptr, ec_grp[curveid].prime.data, ec_grp[curveid].prime.length); dptr += p_align; + memcpy(dptr, ec_grp[curveid].consta.data, + ec_grp[curveid].consta.length); + dptr += p_align; + + memcpy(dptr, ec_grp[curveid].constb.data, + ec_grp[curveid].constb.length); + dptr += p_align; + /* Setup opcodes */ vq_cmd_w0.s.opcode.major = CPT_MAJOR_OP_ECC; vq_cmd_w0.s.opcode.minor = CPT_MINOR_OP_ECC_UMP;