From patchwork Wed Jun 26 08:47:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 141750 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 61549454FF; Wed, 26 Jun 2024 10:48:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9893842E6E; Wed, 26 Jun 2024 10:48:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C7BC740649 for ; Wed, 26 Jun 2024 10:48:00 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45Q4BjmD013873; Wed, 26 Jun 2024 01:47:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=h KvGQ7T3xM81dc0usTORMsYwmvf/aaEOvXSi4auxxyA=; b=LLJVJNAJcS+qHNEDu SIjwwPRYBsve829TLcBuE1MvQklwDRxdHeYNNBMCzSrBvb5Az1CAcStSiyqg2JvC 4D4wYlO9EIi/72pZGjCh8HPJeio/7Vwh5olbeqsumKRJ8s20wFDfoQ9+PnYDNQex ker9O13OeepUDsecS+TktIcn4xEvbckReZrUJwOnvjxGRW5yColDGWNN1z2qfcKF bk1clZKTglzvAgnyJzvKtrDi337GZI+nEXqG0ZAbV+4srOoNnuoaiuwhcHlvtkIP /Z+30RhSt38cQyJxxe6nBn7ux+ziw0xwrL4v7sPGQIqc4E5nlNyXHZZBRYwbBFKo 2fvCw== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 4008qt983w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jun 2024 01:47:58 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 26 Jun 2024 01:47:57 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 26 Jun 2024 01:47:57 -0700 Received: from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.168.34]) by maili.marvell.com (Postfix) with ESMTP id 63EBC3F707C; Wed, 26 Jun 2024 01:47:55 -0700 (PDT) From: Gowrishankar Muthukrishnan To: , Ciara Power CC: Anoob Joseph , Akhil Goyal , Gowrishankar Muthukrishnan Subject: [PATCH v2 1/6] app/crypto-perf: add modex groups test Date: Wed, 26 Jun 2024 14:17:40 +0530 Message-ID: <20240626084747.1595-2-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20240626084747.1595-1-gmuthukrishn@marvell.com> References: <20240615115309.2678-1-gmuthukrishn@marvell.com> <20240626084747.1595-1-gmuthukrishn@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: DrJdI6L3Mq6246hBI8Go41ZaSuDNhKj1 X-Proofpoint-GUID: DrJdI6L3Mq6246hBI8Go41ZaSuDNhKj1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-26_03,2024-06-25_01,2024-05-17_01 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 Add perf tests for modex groups 5, 14, 15, 16, 17 and 18 based on RFC 3526. Signed-off-by: Gowrishankar Muthukrishnan --- app/test-crypto-perf/cperf_test_vectors.c | 570 +++++++++++++++++++++- app/test-crypto-perf/cperf_test_vectors.h | 4 +- 2 files changed, 571 insertions(+), 3 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c index 3c35eea460..de43d303a5 100644 --- a/app/test-crypto-perf/cperf_test_vectors.c +++ b/app/test-crypto-perf/cperf_test_vectors.c @@ -8,7 +8,7 @@ #include "cperf_test_vectors.h" struct -cperf_modex_test_data modex_perf_data[4] = { +cperf_modex_test_data modex_perf_data[10] = { { .base = { .data = { @@ -233,6 +233,574 @@ cperf_modex_test_data modex_perf_data[4] = { .result = { .len = 448 } + }, + { + .base = { + .data = { + 0x02, + }, + .len = 1 + }, + .exponent = { + .data = { + 0x6C, 0x80, 0xFF, 0x29, 0xF9, 0x27, 0x2E, 0x6D, + 0xE1, 0xB7, 0x3F, 0x13, 0x77, 0xD2, 0x3E, 0x49, + 0xCE, 0xAE, 0xBD, 0x73, 0x7A, 0x0F, 0xE7, 0xA4, + 0x20, 0x49, 0x72, 0x87, 0x4E, 0x1B + }, + .len = 30 + }, + .modulus = { + .data = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, + 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, + 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, + 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, + 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, + 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, + 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, + 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, + 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, + 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, + 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, + 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, + 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, + 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, + 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, + 0x98, 0xDA, 0x48, 0x36, 0x1C, 0x55, 0xD3, 0x9A, + 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, + 0x83, 0x65, 0x5D, 0x23, 0xDC, 0xA3, 0xAD, 0x96, + 0x1C, 0x62, 0xF3, 0x56, 0x20, 0x85, 0x52, 0xBB, + 0x9E, 0xD5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6D, + 0x67, 0x0C, 0x35, 0x4E, 0x4A, 0xBC, 0x98, 0x04, + 0xF1, 0x74, 0x6C, 0x08, 0xCA, 0x23, 0x73, 0x27, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }, + .len = 192 + }, + .result = { + .len = 192 + } + }, + { + .base = { + .data = { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + }, + .len = 64 + }, + .exponent = { + .data = { + 0x8E, 0x4E, 0x41, 0xA2, 0xE0, 0x59, 0xA8, 0x29, + 0x71, 0xF6, 0x21, 0xC9, 0xD5, 0x0E, 0x36, 0x0F, + 0x59, 0xD6, 0x74, 0x4C, 0x3A, 0xC7, 0x13, 0x5E, + 0x7D, 0x2D, 0x43, 0x63, 0x5A, 0x3D, 0xCA, 0x5F, + 0xF7, 0xB2, 0x3D, 0x9C, 0x3F, 0xA1, 0x5D, 0x71 + }, + .len = 40 + }, + .modulus = { + .data = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, + 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, + 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, + 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, + 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, + 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, + 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, + 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, + 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, + 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, + 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, + 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, + 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, + 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, + 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, + 0x98, 0xDA, 0x48, 0x36, 0x1C, 0x55, 0xD3, 0x9A, + 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, + 0x83, 0x65, 0x5D, 0x23, 0xDC, 0xA3, 0xAD, 0x96, + 0x1C, 0x62, 0xF3, 0x56, 0x20, 0x85, 0x52, 0xBB, + 0x9E, 0xD5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6D, + 0x67, 0x0C, 0x35, 0x4E, 0x4A, 0xBC, 0x98, 0x04, + 0xF1, 0x74, 0x6C, 0x08, 0xCA, 0x18, 0x21, 0x7C, + 0x32, 0x90, 0x5E, 0x46, 0x2E, 0x36, 0xCE, 0x3B, + 0xE3, 0x9E, 0x77, 0x2C, 0x18, 0x0E, 0x86, 0x03, + 0x9B, 0x27, 0x83, 0xA2, 0xEC, 0x07, 0xA2, 0x8F, + 0xB5, 0xC5, 0x5D, 0xF0, 0x6F, 0x4C, 0x52, 0xC9, + 0xDE, 0x2B, 0xCB, 0xF6, 0x95, 0x58, 0x17, 0x18, + 0x39, 0x95, 0x49, 0x7C, 0xEA, 0x95, 0x6A, 0xE5, + 0x15, 0xD2, 0x26, 0x18, 0x98, 0xFA, 0x05, 0x10, + 0x15, 0x72, 0x8E, 0x5A, 0x8A, 0xAC, 0xAA, 0x68, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }, + .len = 256 + }, + .result = { + .len = 256 + } + }, + { + .base = { + .data = { + 0x02, + }, + .len = 1 + }, + .exponent = { + .data = { + 0x63, 0x4D, 0x67, 0x4E, 0x4A, 0x16, 0x0F, 0xEB, + 0x76, 0xC8, 0xAB, 0x3B, 0x4A, 0x74, 0x03, 0x02, + 0x2F, 0xAC, 0x34, 0x23, 0xC8, 0x2E, 0x1E, 0x60, + 0x63, 0x1E, 0x7D, 0x3F, 0x22, 0xB9, 0xBF, 0x2D, + 0x4F, 0xB3, 0x72, 0xAC, 0x1E, 0x62, 0xA7, 0x47, + 0x7A, 0xF3, 0x45, 0xAB, 0x5B, 0x67, 0x12, 0x80, + 0x77, 0xDA, 0xF8, 0xF4 + }, + .len = 52 + }, + .modulus = { + .data = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, + 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, + 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, + 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, + 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, + 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, + 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, + 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, + 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, + 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, + 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, + 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, + 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, + 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, + 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, + 0x98, 0xDA, 0x48, 0x36, 0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+ 0xF1, 0x2F, 0xFA, 0x06, 0xD9, 0x8A, 0x08, 0x64, + 0xD8, 0x76, 0x02, 0x73, 0x3E, 0xC8, 0x6A, 0x64, + 0x52, 0x1F, 0x2B, 0x18, 0x17, 0x7B, 0x20, 0x0C, + 0xBB, 0xE1, 0x17, 0x57, 0x7A, 0x61, 0x5D, 0x6C, + 0x77, 0x09, 0x88, 0xC0, 0xBA, 0xD9, 0x46, 0xE2, + 0x08, 0xE2, 0x4F, 0xA0, 0x74, 0xE5, 0xAB, 0x31, + 0x43, 0xDB, 0x5B, 0xFC, 0xE0, 0xFD, 0x10, 0x8E, + 0x4B, 0x82, 0xD1, 0x20, 0xA9, 0x3A, 0xD2, 0xCA, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }, + .len = 384 + }, + .result = { + .len = 384 + } + }, + { + .base = { + .data = { + 0x02, + }, + .len = 1 + }, + .exponent = { + .data = { + 0xF2, 0x77, 0xFF, 0x91, 0x08, 0xF6, 0x16, 0x8E, + 0xEE, 0x8C, 0xCC, 0x62, 0x07, 0xA4, 0xE3, 0x0F, + 0xB8, 0xE8, 0xFD, 0x77, 0xEA, 0x06, 0x1D, 0x9F, + 0x2A, 0x96, 0xE8, 0x0D, 0x66, 0xA4, 0x97, 0x7E, + 0xDA, 0xDB, 0xC0, 0xC0, 0x2F, 0x72, 0xCD, 0xFC, + 0xBE, 0xC3, 0xAA, 0x46, 0x31, 0x7C, 0x4B, 0x4D, + 0x0B, 0x14, 0x02, 0x5C, 0x7F, 0x29, 0xC1, 0xDE, + 0xC5, 0x06, 0x70, 0x0B + }, + .len = 60 + }, + .modulus = { + .data = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, + 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, + 0x29, 0x02, 0x4E, 0x08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A, 0x10, 0xBD, 0xBA, 0x5B, 0x26, + 0x99, 0xC3, 0x27, 0x18, 0x6A, 0xF4, 0xE2, 0x3C, + 0x1A, 0x94, 0x68, 0x34, 0xB6, 0x15, 0x0B, 0xDA, + 0x25, 0x83, 0xE9, 0xCA, 0x2A, 0xD4, 0x4C, 0xE8, + 0xDB, 0xBB, 0xC2, 0xDB, 0x04, 0xDE, 0x8E, 0xF9, + 0x2E, 0x8E, 0xFC, 0x14, 0x1F, 0xBE, 0xCA, 0xA6, + 0x28, 0x7C, 0x59, 0x47, 0x4E, 0x6B, 0xC0, 0x5D, + 0x99, 0xB2, 0x96, 0x4F, 0xA0, 0x90, 0xC3, 0xA2, + 0x23, 0x3B, 0xA1, 0x86, 0x51, 0x5B, 0xE7, 0xED, + 0x1F, 0x61, 0x29, 0x70, 0xCE, 0xE2, 0xD7, 0xAF, + 0xB8, 0x1B, 0xDD, 0x76, 0x21, 0x70, 0x48, 0x1C, + 0xD0, 0x06, 0x91, 0x27, 0xD5, 0xB0, 0x5A, 0xA9, + 0x93, 0xB4, 0xEA, 0x98, 0x8D, 0x8F, 0xDD, 0xC1, + 0x86, 0xFF, 0xB7, 0xDC, 0x90, 0xA6, 0xC0, 0x8F, + 0x4D, 0xF4, 0x35, 0xC9, 0x34, 0x06, 0x31, 0x99, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }, + .len = 512 + }, + .result = { + .len = 512 + } + }, + { + .base = { + .data = { + 0x02, + }, + .len = 1 + }, + .exponent = { + .data = { + 0x06, 0x8B, 0x74, 0x99, 0x02, 0xCE, 0x50, 0x2C, + 0xED, 0x29, 0x2F, 0xFB, 0x14, 0x74, 0x11, 0x7A, + 0x7C, 0x1D, 0xBF, 0xF8, 0xC3, 0x2D, 0xFD, 0x45, + 0x56, 0xCF, 0xCD, 0x92, 0x12, 0xF2, 0xC1, 0x96, + 0x73, 0x11, 0x4C, 0xAC, 0xFA, 0x0C, 0x4B, 0x2B, + 0xFA, 0xED, 0xA5, 0x5A, 0xDD, 0xF7, 0x5F, 0x75, + 0xB0, 0x18, 0x69, 0x63, 0xB0, 0x8E, 0x04, 0xA2, + 0x0D, 0x1F, 0x68, 0xA9, 0x1A, 0x75, 0x8A, 0x29, + 0xD4, 0xC1, 0x31, 0xAC + }, + .len = 68 + }, + .modulus = { + .data = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, + 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, + 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, + 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, + 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, + 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, + 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, + 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, + 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, + 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, + 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, + 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, + 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, + 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, + 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, + 0x98, 0xDA, 0x48, 0x36, 0x1C, 0x55, 0xD3, 0x9A, + 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, + 0x83, 0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, 0x5E, 0xD2, 0x0F, 0x80, 0x37, 0xE0, + 0xA7, 0x97, 0x15, 0xEE, 0xF2, 0x9B, 0xE3, 0x28, + 0x06, 0xA1, 0xD5, 0x8B, 0xB7, 0xC5, 0xDA, 0x76, + 0xF5, 0x50, 0xAA, 0x3D, 0x8A, 0x1F, 0xBF, 0xF0, + 0xEB, 0x19, 0xCC, 0xB1, 0xA3, 0x13, 0xD5, 0x5C, + 0xDA, 0x56, 0xC9, 0xEC, 0x2E, 0xF2, 0x96, 0x32, + 0x38, 0x7F, 0xE8, 0xD7, 0x6E, 0x3C, 0x04, 0x68, + 0x04, 0x3E, 0x8F, 0x66, 0x3F, 0x48, 0x60, 0xEE, + 0x12, 0xBF, 0x2D, 0x5B, 0x0B, 0x74, 0x74, 0xD6, + 0xE6, 0x94, 0xF9, 0x1E, 0x6D, 0xCC, 0x40, 0x24, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }, + .len = 768 + }, + .result = { + .len = 768 + } + }, + { + .base = { + .data = { + 0x02, + }, + .len = 1 + }, + .exponent = { + .data = { + 0x01, 0xA6, 0x8A, 0x0A, 0xDA, 0xA6, 0x14, 0x43, + 0x84, 0xD6, 0xEB, 0x11, 0x67, 0xA6, 0xD2, 0xAC, + 0x11, 0x5D, 0x15, 0x99, 0x31, 0x99, 0xAE, 0x08, + 0x3D, 0xEC, 0x19, 0x57, 0x3D, 0xDF, 0x96, 0x7C, + 0x9A, 0x1A, 0x72, 0x80, 0x1F, 0xF3, 0x50, 0x91, + 0xD0, 0x70, 0x11, 0x37, 0xA8, 0xFE, 0xE4, 0x37, + 0x3B, 0x36, 0x62, 0x89, 0xCF, 0x31, 0x1D, 0x76, + 0x28, 0xBE, 0x5F, 0x25, 0x12, 0x6E, 0x72, 0x83, + 0x8A, 0x1A, 0xC2, 0xFA, 0xD6, 0x49, 0x2C, 0x4F, + 0x2D, 0xF1, 0x77, 0x67, 0x49, 0xDA + }, + .len = 78 + }, + .modulus = { + .data = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, + 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, + 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, + 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, + 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, + 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, + 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, + 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, + 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, + 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, + 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, + 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, + 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, + 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, + 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, + 0x98, 0xDA, 0x48, 0x36, 0x1C, 0x55, 0xD3, 0x9A, + 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, + 0x83, 0x65, 0x5D, 0x23, 0xDC, 0xA3, 0xAD, 0x96, + 0x1C, 0x62, 0xF3, 0x56, 0x20, 0x85, 0x52, 0xBB, + 0x9E, 0xD5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6D, + 0x67, 0x0C, 0x35, 0x4E, 0x4A, 0xBC, 0x98, 0x04, + 0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B, 0x3C, 0xF5, 0xB3, 0xA2, 0x78, 0xA6, + 0x6D, 0x2A, 0x13, 0xF8, 0x3F, 0x44, 0xF8, 0x2D, + 0xDF, 0x31, 0x0E, 0xE0, 0x74, 0xAB, 0x6A, 0x36, + 0x45, 0x97, 0xE8, 0x99, 0xA0, 0x25, 0x5D, 0xC1, + 0x64, 0xF3, 0x1C, 0xC5, 0x08, 0x46, 0x85, 0x1D, + 0xF9, 0xAB, 0x48, 0x19, 0x5D, 0xED, 0x7E, 0xA1, + 0xB1, 0xD5, 0x10, 0xBD, 0x7E, 0xE7, 0x4D, 0x73, + 0xFA, 0xF3, 0x6B, 0xC3, 0x1E, 0xCF, 0xA2, 0x68, + 0x35, 0x90, 0x46, 0xF4, 0xEB, 0x87, 0x9F, 0x92, + 0x40, 0x09, 0x43, 0x8B, 0x48, 0x1C, 0x6C, 0xD7, + 0x88, 0x9A, 0x00, 0x2E, 0xD5, 0xEE, 0x38, 0x2B, + 0xC9, 0x19, 0x0D, 0xA6, 0xFC, 0x02, 0x6E, 0x47, + 0x95, 0x58, 0xE4, 0x47, 0x56, 0x77, 0xE9, 0xAA, + 0x9E, 0x30, 0x50, 0xE2, 0x76, 0x56, 0x94, 0xDF, + 0xC8, 0x1F, 0x56, 0xE8, 0x80, 0xB9, 0x6E, 0x71, + 0x60, 0xC9, 0x80, 0xDD, 0x98, 0xED, 0xD3, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }, + .len = 1024 + }, + .result = { + .len = 1024 + } } }; diff --git a/app/test-crypto-perf/cperf_test_vectors.h b/app/test-crypto-perf/cperf_test_vectors.h index 649478ff83..a3e431e5e6 100644 --- a/app/test-crypto-perf/cperf_test_vectors.h +++ b/app/test-crypto-perf/cperf_test_vectors.h @@ -78,7 +78,7 @@ struct cperf_test_vector { }; struct cperf_modex_test_data { -#define DATA_SIZE 512 +#define DATA_SIZE 1024 struct { uint8_t data[DATA_SIZE]; uint16_t len; @@ -110,6 +110,6 @@ extern uint8_t aad[]; extern uint8_t digest[2048]; -extern struct cperf_modex_test_data modex_perf_data[4]; +extern struct cperf_modex_test_data modex_perf_data[10]; #endif From patchwork Wed Jun 26 08:47:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 141751 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 CA5CF454FF; Wed, 26 Jun 2024 10:48:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A4A7742E95; Wed, 26 Jun 2024 10:48:31 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id F27F840611; Wed, 26 Jun 2024 10:48:05 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45Q5SCRf005544; Wed, 26 Jun 2024 01:48:05 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=u we3iB586GIApTu5Gh3FXEJ2gWRSuOjjmrAoOMDfOsA=; b=KmJtJS+BLhDQOEZ4h 0wD3+S0xANnCWGgpgT7IHTX39/M4plrxwS4kdoXerY85+3/mIskvIFN8mUyHnYhe 3YTi8uS5XtSNsPRgijMWtW6Ks3Px9zRGNq2UPu7pNZGzRZhYGWakiApEwzwNsnZ+ T+Z07VwpATWCu0YG/SAxnzDnRanTVLENIYRHi/3f85gcrsfqLTQnabSpVgQ6oJ4l uRUIAkajdYo6CqkwUBqD0upEcKBw3klEvmMjwp7EH606hkkGJVlN3vqh6uTzuuih yK/odu5mrdYVdTTaU/oPJeXEV0vgSXZFsmSfw4fSsXBJfBPUA05sMdOCdnPO+yAt n3JRQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 400cur8jge-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jun 2024 01:48:05 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 26 Jun 2024 01:48:03 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 26 Jun 2024 01:48:03 -0700 Received: from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.168.34]) by maili.marvell.com (Postfix) with ESMTP id 9C5083F707C; Wed, 26 Jun 2024 01:48:01 -0700 (PDT) From: Gowrishankar Muthukrishnan To: , Ciara Power , Akhil Goyal , Fan Zhang , Anoob Joseph CC: Gowrishankar Muthukrishnan , Subject: [PATCH v2 2/6] app/crypto-perf: remove redundant local varriable Date: Wed, 26 Jun 2024 14:17:41 +0530 Message-ID: <20240626084747.1595-3-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20240626084747.1595-1-gmuthukrishn@marvell.com> References: <20240615115309.2678-1-gmuthukrishn@marvell.com> <20240626084747.1595-1-gmuthukrishn@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 9UxHSAkHoD96A3bcMJcz2mYSCqsCTft- X-Proofpoint-GUID: 9UxHSAkHoD96A3bcMJcz2mYSCqsCTft- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-26_03,2024-06-25_01,2024-05-17_01 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 Remove redundant local variable used for asym session. Fixes: a29bb248988 ("cryptodev: hide asymmetric session structure") Fixes: 2973dbf93b4 ("security: hide session structure") Cc: stable@dpdk.org Signed-off-by: Gowrishankar Muthukrishnan --- app/test-crypto-perf/cperf_ops.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c index 4ca001b721..a802281a71 100644 --- a/app/test-crypto-perf/cperf_ops.c +++ b/app/test-crypto-perf/cperf_ops.c @@ -21,7 +21,6 @@ cperf_set_ops_asym(struct rte_crypto_op **ops, uint64_t *tsc_start __rte_unused) { uint16_t i; - void *asym_sess = (void *)sess; for (i = 0; i < nb_ops; i++) { struct rte_crypto_asym_op *asym_op = ops[i]->asym; @@ -31,7 +30,7 @@ cperf_set_ops_asym(struct rte_crypto_op **ops, asym_op->modex.base.length = options->modex_data->base.len; asym_op->modex.result.data = options->modex_data->result.data; asym_op->modex.result.length = options->modex_data->result.len; - rte_crypto_op_attach_asym_session(ops[i], asym_sess); + rte_crypto_op_attach_asym_session(ops[i], sess); } } @@ -62,7 +61,6 @@ cperf_set_ops_security(struct rte_crypto_op **ops, for (i = 0; i < nb_ops; i++) { struct rte_crypto_sym_op *sym_op = ops[i]->sym; - void *sec_sess = (void *)sess; uint32_t buf_sz; uint32_t *per_pkt_hfn = rte_crypto_op_ctod_offset(ops[i], @@ -70,7 +68,7 @@ cperf_set_ops_security(struct rte_crypto_op **ops, *per_pkt_hfn = options->pdcp_ses_hfn_en ? 0 : PDCP_DEFAULT_HFN; ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED; - rte_security_attach_session(ops[i], sec_sess); + rte_security_attach_session(ops[i], sess); sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] + src_buf_offset); @@ -127,7 +125,6 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops, uint16_t iv_offset __rte_unused, uint32_t *imix_idx, uint64_t *tsc_start) { - void *sec_sess = sess; const uint32_t test_buffer_size = options->test_buffer_size; uint64_t tsc_start_temp, tsc_end_temp; uint16_t i = 0; @@ -140,7 +137,7 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops, uint32_t offset = test_buffer_size; ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED; - rte_security_attach_session(ops[i], sec_sess); + rte_security_attach_session(ops[i], sess); sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] + src_buf_offset); sym_op->m_src->pkt_len = test_buffer_size; From patchwork Wed Jun 26 08:47:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 141752 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 43271454FF; Wed, 26 Jun 2024 10:48:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BAC0942EA0; Wed, 26 Jun 2024 10:48:32 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 113D040611; Wed, 26 Jun 2024 10:48:11 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45Q0jWHD002938; Wed, 26 Jun 2024 01:48:11 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=2 lmFfdQcgtt9pUcklFKdsv4MAdPM0+uCuR4jBphDoP4=; b=kS+yo3Jl0PYXJ5uyp AwZ4WsRd5Lx+eE+o3LzcHqh5DsZ1xuKOnqN8KQ0Zu/XHQEfvhDyD67JIWc6mFkzA PEM7jdTbzeBt7ahz0HyuI7gS8BWYeicTyN04qQFlQ9iVFE1b4gIqrfqQgbg3BFS0 5wEFqXTLaxNvYMQ4Y/RMT3vdl7oh00lHdBpQ5SYHSQhAMot6iM8ghDIGsKP7IAED mdls97YjUdrRaf30xJb4L1jWqXxTgxvSc7owhxLwTSMPkSwFqtEwYCUcx0e1h5p9 VmRBJzfwdEFrpu2l81E8/sQyFUHFrg2nAHYnNDR1ZWwzn5+IPi0qMtZZzfm8uSNx 5aHaQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 4008qt984u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jun 2024 01:48:10 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 26 Jun 2024 01:48:10 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 26 Jun 2024 01:48:10 -0700 Received: from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.168.34]) by maili.marvell.com (Postfix) with ESMTP id CBB263F707B; Wed, 26 Jun 2024 01:48:07 -0700 (PDT) From: Gowrishankar Muthukrishnan To: , Ciara Power , Akhil Goyal , Kiran Kumar K CC: Anoob Joseph , Gowrishankar Muthukrishnan , Subject: [PATCH v2 3/6] app/crypto-perf: fix result location for asymmetric test Date: Wed, 26 Jun 2024 14:17:42 +0530 Message-ID: <20240626084747.1595-4-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20240626084747.1595-1-gmuthukrishn@marvell.com> References: <20240615115309.2678-1-gmuthukrishn@marvell.com> <20240626084747.1595-1-gmuthukrishn@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: V4HzORs2_W_vPJAbjR1lqsrTwep1viQJ X-Proofpoint-GUID: V4HzORs2_W_vPJAbjR1lqsrTwep1viQJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-26_03,2024-06-25_01,2024-05-17_01 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 For asymmetric op, private test data should be stored after rte_crypto_asym_op struct. Fixes: a538d1d2d01e ("test/crypto-perf: extend asymmetric crypto throughput test") Cc: stable@dpdk.org Signed-off-by: Gowrishankar Muthukrishnan --- app/test-crypto-perf/cperf_test_common.c | 6 ++++-- app/test-crypto-perf/cperf_test_latency.c | 14 +++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c index 94d39fb177..6b8ab65731 100644 --- a/app/test-crypto-perf/cperf_test_common.c +++ b/app/test-crypto-perf/cperf_test_common.c @@ -149,11 +149,11 @@ cperf_alloc_common_memory(const struct cperf_options *options, int ret; /* Calculate the object size */ - uint16_t crypto_op_size = sizeof(struct rte_crypto_op) + - sizeof(struct rte_crypto_sym_op); + uint16_t crypto_op_size = sizeof(struct rte_crypto_op); uint16_t crypto_op_private_size; if (options->op_type == CPERF_ASYM_MODEX) { + crypto_op_size += sizeof(struct rte_crypto_asym_op); snprintf(pool_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_op_pool%u", rte_socket_id()); *pool = rte_crypto_op_pool_create( @@ -170,6 +170,8 @@ cperf_alloc_common_memory(const struct cperf_options *options, return 0; } + crypto_op_size += sizeof(struct rte_crypto_sym_op); + /* * If doing AES-CCM, IV field needs to be 16 bytes long, * and AAD field needs to be long enough to have 18 bytes, diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index b8ad6bf4d4..376847e761 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -122,7 +122,11 @@ store_timestamp(struct rte_crypto_op *op, uint64_t timestamp) { struct priv_op_data *priv_data; - priv_data = (struct priv_op_data *) (op->sym + 1); + if (op->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC) + priv_data = (struct priv_op_data *) (op->sym + 1); + else + priv_data = (struct priv_op_data *) (op->asym + 1); + priv_data->result->status = op->status; priv_data->result->tsc_end = timestamp; } @@ -251,9 +255,13 @@ cperf_latency_test_runner(void *arg) ctx->res[tsc_idx].tsc_start = tsc_start; /* * Private data structure starts after the end of the - * rte_crypto_sym_op structure. + * rte_crypto_sym_op (or rte_crypto_asym_op) structure. */ - priv_data = (struct priv_op_data *) (ops[i]->sym + 1); + if (ops[i]->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC) + priv_data = (struct priv_op_data *) (ops[i]->sym + 1); + else + priv_data = (struct priv_op_data *) (ops[i]->asym + 1); + priv_data->result = (void *)&ctx->res[tsc_idx]; tsc_idx++; } From patchwork Wed Jun 26 08:47:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 141753 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 B2008454FF; Wed, 26 Jun 2024 10:49:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B404742E8F; Wed, 26 Jun 2024 10:48:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id BB65E40611 for ; Wed, 26 Jun 2024 10:48:17 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45Q5RfPD005327; Wed, 26 Jun 2024 01:48:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=9 kl4wXRED6O49UDjIRevUi+AcQ1s5W+lewWa6nO0d00=; b=gPwbJMq+aOHzPf1JM h+Eu2rll1ooTKxSmYFE6Y+4E+MmUBKPffs/auaHQ8ozNLgijh5CqaRPUCjasKicZ peU5bI9hdyH2mCVqHlaaiPhMPLCGtaSGWrryJQPy3+rxjSCo4PgdcMSalik+pf35 rqYZN6u6zTC3X4PS2D59DE5snraUy9xjJS5g6FlrZNGjphfjDc+M5IUTmZs0B/df QZ9D0z5HOpmwJC/Dw6C1AR1OeJCBaftAGPNQIQo9tBg0zQ/XHX3ml9oecivZ8kVt EZiAYRQ5K9bxKJ6S2GaNSObHEzLT5Q6v+573dhoPr6tk+dGKkIExM6IjRo0FGQ6S DU3eA== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 400cur8jgp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jun 2024 01:48:17 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 26 Jun 2024 01:48:15 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 26 Jun 2024 01:48:15 -0700 Received: from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.168.34]) by maili.marvell.com (Postfix) with ESMTP id E66D33F707B; Wed, 26 Jun 2024 01:48:13 -0700 (PDT) From: Gowrishankar Muthukrishnan To: , Ciara Power CC: Anoob Joseph , Akhil Goyal , Gowrishankar Muthukrishnan Subject: [PATCH v2 4/6] app/crypto-perf: add function to check asymmetric operation Date: Wed, 26 Jun 2024 14:17:43 +0530 Message-ID: <20240626084747.1595-5-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20240626084747.1595-1-gmuthukrishn@marvell.com> References: <20240615115309.2678-1-gmuthukrishn@marvell.com> <20240626084747.1595-1-gmuthukrishn@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: EFUwXi4VQBwIoKNHWkcvs-V5kWOwAQj5 X-Proofpoint-GUID: EFUwXi4VQBwIoKNHWkcvs-V5kWOwAQj5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-26_03,2024-06-25_01,2024-05-17_01 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 Replace checking input option for every asymmetric test case by a function. Signed-off-by: Gowrishankar Muthukrishnan --- v2: - cperf_is_asym_test is fixed to check only modex in this patch. --- app/test-crypto-perf/cperf_test_common.c | 11 ++++++++++- app/test-crypto-perf/cperf_test_common.h | 2 ++ app/test-crypto-perf/cperf_test_latency.c | 7 ++++--- app/test-crypto-perf/cperf_test_throughput.c | 2 +- app/test-crypto-perf/cperf_test_verify.c | 2 +- app/test-crypto-perf/main.c | 8 ++++---- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c index 6b8ab65731..0f1f0b72c1 100644 --- a/app/test-crypto-perf/cperf_test_common.c +++ b/app/test-crypto-perf/cperf_test_common.c @@ -152,7 +152,7 @@ cperf_alloc_common_memory(const struct cperf_options *options, uint16_t crypto_op_size = sizeof(struct rte_crypto_op); uint16_t crypto_op_private_size; - if (options->op_type == CPERF_ASYM_MODEX) { + if (cperf_is_asym_test(options)) { crypto_op_size += sizeof(struct rte_crypto_asym_op); snprintf(pool_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_op_pool%u", rte_socket_id()); @@ -301,3 +301,12 @@ cperf_mbuf_set(struct rte_mbuf *mbuf, mbuf = mbuf->next; } } + +bool +cperf_is_asym_test(const struct cperf_options *options) +{ + if (options->op_type == CPERF_ASYM_MODEX) + return true; + + return false; +} diff --git a/app/test-crypto-perf/cperf_test_common.h b/app/test-crypto-perf/cperf_test_common.h index a603a607d5..2d1f69aaa2 100644 --- a/app/test-crypto-perf/cperf_test_common.h +++ b/app/test-crypto-perf/cperf_test_common.h @@ -26,4 +26,6 @@ cperf_mbuf_set(struct rte_mbuf *mbuf, const struct cperf_options *options, const struct cperf_test_vector *test_vector); +bool +cperf_is_asym_test(const struct cperf_options *options); #endif /* _CPERF_TEST_COMMON_H_ */ diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index 376847e761..201815b469 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -47,7 +47,7 @@ cperf_latency_test_free(struct cperf_latency_ctx *ctx) return; if (ctx->sess != NULL) { - if (ctx->options->op_type == CPERF_ASYM_MODEX) + if (cperf_is_asym_test(ctx->options)) rte_cryptodev_asym_session_free(ctx->dev_id, ctx->sess); #ifdef RTE_LIB_SECURITY else if (ctx->options->op_type == CPERF_PDCP || @@ -217,8 +217,9 @@ cperf_latency_test_runner(void *arg) &imix_idx, &tsc_start); /* Populate the mbuf with the test vector */ - for (i = 0; i < burst_size; i++) - cperf_mbuf_set(ops[i]->sym->m_src, + if (!cperf_is_asym_test(ctx->options)) + for (i = 0; i < burst_size; i++) + cperf_mbuf_set(ops[i]->sym->m_src, ctx->options, ctx->test_vector); diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c index c0891e7c99..7112b95529 100644 --- a/app/test-crypto-perf/cperf_test_throughput.c +++ b/app/test-crypto-perf/cperf_test_throughput.c @@ -37,7 +37,7 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx) if (!ctx) return; if (ctx->sess) { - if (ctx->options->op_type == CPERF_ASYM_MODEX) + if (cperf_is_asym_test(ctx->options)) rte_cryptodev_asym_session_free(ctx->dev_id, (void *)ctx->sess); #ifdef RTE_LIB_SECURITY diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index 222c7a1cd8..91429841ca 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -42,7 +42,7 @@ cperf_verify_test_free(struct cperf_verify_ctx *ctx) return; if (ctx->sess != NULL) { - if (ctx->options->op_type == CPERF_ASYM_MODEX) + if (cperf_is_asym_test(ctx->options)) rte_cryptodev_asym_session_free(ctx->dev_id, ctx->sess); #ifdef RTE_LIB_SECURITY else if (ctx->options->op_type == CPERF_PDCP || diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index 40c0b4b54f..780f22f399 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -18,6 +18,7 @@ #include "cperf.h" #include "cperf_options.h" #include "cperf_test_vector_parsing.h" +#include "cperf_test_common.h" #include "cperf_test_throughput.h" #include "cperf_test_latency.h" #include "cperf_test_verify.h" @@ -203,7 +204,7 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs) rte_cryptodev_info_get(cdev_id, &cdev_info); - if (opts->op_type == CPERF_ASYM_MODEX) { + if (cperf_is_asym_test(opts)) { if ((cdev_info.feature_flags & RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO) == 0) continue; @@ -289,7 +290,7 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs) return -ENOTSUP; } - if (opts->op_type == CPERF_ASYM_MODEX) + if (cperf_is_asym_test(opts)) ret = create_asym_op_pool_socket(socket_id, sessions_needed); else @@ -300,9 +301,8 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs) qp_conf.mp_session = session_pool_socket[socket_id].sess_mp; - if (opts->op_type == CPERF_ASYM_MODEX) { + if (cperf_is_asym_test(opts)) qp_conf.mp_session = NULL; - } ret = rte_cryptodev_configure(cdev_id, &conf); if (ret < 0) { From patchwork Wed Jun 26 08:47:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 141754 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 191D3454FF; Wed, 26 Jun 2024 10:49:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C20C42EA5; Wed, 26 Jun 2024 10:48:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id ED33142EA6 for ; Wed, 26 Jun 2024 10:48:46 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45Q4BjmH013873; Wed, 26 Jun 2024 01:48:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=m g/wQf8jHeWwyFx9G5pBd51J3x6Bl38/6g/QyiCTqeI=; b=UPZGcZx7NYz9cw7Ck gkSidbGmAJ3XeiSOSlGWPJcTzUBofFqULJ0oFMeYm7XVO/S9nBKyQS72h2ZA+xsS aJBRJFKafG40tlj3Sb/ybgiV1cLf4m+cfvIdqUKc6/KK8IWl+BSTeZGY/WX6jahz Mq6KwPP9MRsETJKAwOJhAzEQz8Sb/b5jgRi09TTtKD5OPwZyGu8qdWs3f0mM/j76 nwybVZ7pJBHtISL4G+vVZu7vS75xYk2QEyWx+F6JxDxOf0rPHus/kIcuyLa7ez+s jtw9tAE8jhZkTueltRrNa3Qz57s7lkHxMMz3SG0SF14t39EdF8QZPwKZqgiA5Y8M 5jRNw== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 4008qt9862-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jun 2024 01:48:45 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 26 Jun 2024 01:48:21 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 26 Jun 2024 01:48:21 -0700 Received: from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.168.34]) by maili.marvell.com (Postfix) with ESMTP id 7098B3F707B; Wed, 26 Jun 2024 01:48:19 -0700 (PDT) From: Gowrishankar Muthukrishnan To: , Ciara Power CC: Anoob Joseph , Akhil Goyal Subject: [PATCH v2 5/6] app/crypto-perf: support SM2 Date: Wed, 26 Jun 2024 14:17:44 +0530 Message-ID: <20240626084747.1595-6-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20240626084747.1595-1-gmuthukrishn@marvell.com> References: <20240615115309.2678-1-gmuthukrishn@marvell.com> <20240626084747.1595-1-gmuthukrishn@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: fktdKf87oqLhWpfEuH9qkrwm3moXyelD X-Proofpoint-GUID: fktdKf87oqLhWpfEuH9qkrwm3moXyelD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-26_03,2024-06-25_01,2024-05-17_01 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 From: Akhil Goyal Added support for SM2 asymmetric crypto performance. A new command line option is added to specify asymmetric operation type `--asym-op Type`. Type can be sign/verify/encrypt/decrypt. Example command: ./dpdk-test-crypto-perf --vdev crypto_openssl -c 0x30 -- \ --devtype crypto_openssl --ptest throughput --optype sm2 \ --total-ops 10000 --asym-op sign Signed-off-by: Akhil Goyal --- app/test-crypto-perf/cperf_ops.c | 69 ++++++++++- app/test-crypto-perf/cperf_options.h | 6 + app/test-crypto-perf/cperf_options_parsing.c | 55 ++++++++- app/test-crypto-perf/cperf_test_common.c | 3 +- app/test-crypto-perf/cperf_test_vectors.c | 120 +++++++++++++++++++ app/test-crypto-perf/cperf_test_vectors.h | 25 ++++ app/test-crypto-perf/main.c | 61 ++++++++++ doc/guides/tools/cryptoperf.rst | 6 + 8 files changed, 341 insertions(+), 4 deletions(-) diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c index a802281a71..f0860a46c0 100644 --- a/app/test-crypto-perf/cperf_ops.c +++ b/app/test-crypto-perf/cperf_ops.c @@ -10,7 +10,7 @@ #include "cperf_test_vectors.h" static void -cperf_set_ops_asym(struct rte_crypto_op **ops, +cperf_set_ops_asym_modex(struct rte_crypto_op **ops, uint32_t src_buf_offset __rte_unused, uint32_t dst_buf_offset __rte_unused, uint16_t nb_ops, void *sess, @@ -34,6 +34,47 @@ cperf_set_ops_asym(struct rte_crypto_op **ops, } } +static void +cperf_set_ops_asym_sm2(struct rte_crypto_op **ops, + uint32_t src_buf_offset __rte_unused, + uint32_t dst_buf_offset __rte_unused, uint16_t nb_ops, + void *sess, + const struct cperf_options *options, + const struct cperf_test_vector *test_vector __rte_unused, + uint16_t iv_offset __rte_unused, + uint32_t *imix_idx __rte_unused, + uint64_t *tsc_start __rte_unused) +{ + uint16_t i; + + for (i = 0; i < nb_ops; i++) { + struct rte_crypto_asym_op *asym_op = ops[i]->asym; + + ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED; + rte_crypto_op_attach_asym_session(ops[i], sess); + + /* Populate op with operational details */ + asym_op->sm2.hash = options->asym_hash_alg; + + asym_op->sm2.op_type = options->asym_op_type; + asym_op->sm2.message.data = options->sm2_data->message.data; + asym_op->sm2.message.length = options->sm2_data->message.length; + asym_op->sm2.cipher.data = options->sm2_data->cipher.data; + asym_op->sm2.cipher.length = options->sm2_data->cipher.length; + asym_op->sm2.id.data = options->sm2_data->id.data; + asym_op->sm2.id.length = options->sm2_data->id.length; + + asym_op->sm2.k.data = options->sm2_data->k.data; + asym_op->sm2.k.length = options->sm2_data->k.length; + + asym_op->sm2.r.data = options->sm2_data->sign_r.data; + asym_op->sm2.r.length = options->sm2_data->sign_r.length; + asym_op->sm2.s.data = options->sm2_data->sign_s.data; + asym_op->sm2.s.length = options->sm2_data->sign_s.length; + } +} + + #ifdef RTE_LIB_SECURITY static void test_ipsec_vec_populate(struct rte_mbuf *m, const struct cperf_options *options, @@ -932,6 +973,27 @@ cperf_create_session(struct rte_mempool *sess_mp, } return asym_sess; } + + if (options->op_type == CPERF_ASYM_SM2) { + xform.next = NULL; + xform.xform_type = RTE_CRYPTO_ASYM_XFORM_SM2; + xform.ec.curve_id = options->sm2_data->curve; + xform.ec.pkey.data = options->sm2_data->pkey.data; + xform.ec.pkey.length = options->sm2_data->pkey.length; + xform.ec.q.x.data = options->sm2_data->pubkey_qx.data; + xform.ec.q.x.length = options->sm2_data->pubkey_qx.length; + xform.ec.q.y.data = options->sm2_data->pubkey_qy.data; + xform.ec.q.y.length = options->sm2_data->pubkey_qy.length; + + ret = rte_cryptodev_asym_session_create(dev_id, &xform, + sess_mp, &asym_sess); + if (ret < 0) { + RTE_LOG(ERR, USER1, "SM2 Asym session create failed\n"); + return NULL; + } + + return asym_sess; + } #ifdef RTE_LIB_SECURITY /* * security only @@ -1230,7 +1292,10 @@ cperf_get_op_functions(const struct cperf_options *options, op_fns->populate_ops = cperf_set_ops_cipher; break; case CPERF_ASYM_MODEX: - op_fns->populate_ops = cperf_set_ops_asym; + op_fns->populate_ops = cperf_set_ops_asym_modex; + break; + case CPERF_ASYM_SM2: + op_fns->populate_ops = cperf_set_ops_asym_sm2; break; #ifdef RTE_LIB_SECURITY case CPERF_PDCP: diff --git a/app/test-crypto-perf/cperf_options.h b/app/test-crypto-perf/cperf_options.h index be36c70be1..d730ae18d0 100644 --- a/app/test-crypto-perf/cperf_options.h +++ b/app/test-crypto-perf/cperf_options.h @@ -49,6 +49,8 @@ #define CPERF_DIGEST_SZ ("digest-sz") +#define CPERF_ASYM_OP ("asym-op") + #ifdef RTE_LIB_SECURITY #define CPERF_PDCP_SN_SZ ("pdcp-sn-sz") #define CPERF_PDCP_DOMAIN ("pdcp-domain") @@ -85,6 +87,7 @@ enum cperf_op_type { CPERF_DOCSIS, CPERF_IPSEC, CPERF_ASYM_MODEX, + CPERF_ASYM_SM2, CPERF_TLS, }; @@ -162,6 +165,9 @@ struct cperf_options { uint8_t imix_distribution_count; struct cperf_modex_test_data *modex_data; uint16_t modex_len; + struct cperf_sm2_test_data *sm2_data; + enum rte_crypto_asym_op_type asym_op_type; + enum rte_crypto_auth_algorithm asym_hash_alg; }; void diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c index 8c20974273..49609e560e 100644 --- a/app/test-crypto-perf/cperf_options_parsing.c +++ b/app/test-crypto-perf/cperf_options_parsing.c @@ -37,7 +37,7 @@ usage(char *progname) " --desc-nb N: set number of descriptors for each crypto device\n" " --devtype TYPE: set crypto device type to use\n" " --optype cipher-only / auth-only / cipher-then-auth / auth-then-cipher /\n" - " aead / pdcp / docsis / ipsec / modex / tls-record : set operation type\n" + " aead / pdcp / docsis / ipsec / modex / sm2 / tls-record : set operation type\n" " --sessionless: enable session-less crypto operations\n" " --out-of-place: enable out-of-place crypto operations\n" " --test-file NAME: set the test vector file path\n" @@ -61,6 +61,7 @@ usage(char *progname) " --csv-friendly: enable test result output CSV friendly\n" " --modex-len N: modex length, supported lengths are " "60, 128, 255, 448. Default: 128\n" + " --asym-op encrypt / decrypt / sign / verify : set asym operation type\n" #ifdef RTE_LIB_SECURITY " --pdcp-sn-sz N: set PDCP SN size N <5/7/12/15/18>\n" " --pdcp-domain DOMAIN: set PDCP domain \n" @@ -482,6 +483,10 @@ parse_op_type(struct cperf_options *opts, const char *arg) cperf_op_type_strs[CPERF_ASYM_MODEX], CPERF_ASYM_MODEX }, + { + cperf_op_type_strs[CPERF_ASYM_SM2], + CPERF_ASYM_SM2 + }, { cperf_op_type_strs[CPERF_TLS], CPERF_TLS @@ -861,6 +866,45 @@ parse_aead_aad_sz(struct cperf_options *opts, const char *arg) return parse_uint16_t(&opts->aead_aad_sz, arg); } +static int +parse_asym_op(struct cperf_options *opts, const char *arg) +{ + struct name_id_map asym_op_namemap[] = { + { + rte_crypto_asym_op_strings + [RTE_CRYPTO_ASYM_OP_ENCRYPT], + RTE_CRYPTO_ASYM_OP_ENCRYPT + }, + { + rte_crypto_asym_op_strings + [RTE_CRYPTO_ASYM_OP_DECRYPT], + RTE_CRYPTO_ASYM_OP_DECRYPT + }, + { + rte_crypto_asym_op_strings + [RTE_CRYPTO_ASYM_OP_SIGN], + RTE_CRYPTO_ASYM_OP_SIGN + }, + { + rte_crypto_asym_op_strings + [RTE_CRYPTO_ASYM_OP_VERIFY], + RTE_CRYPTO_ASYM_OP_VERIFY + } + }; + + int id = get_str_key_id_mapping(asym_op_namemap, + RTE_DIM(asym_op_namemap), arg); + if (id < 0) { + RTE_LOG(ERR, USER1, "invalid ASYM operation specified\n"); + return -1; + } + + opts->asym_op_type = (enum rte_crypto_asym_op_type)id; + + return 0; +} + + static int parse_csv_friendly(struct cperf_options *opts, const char *arg __rte_unused) { @@ -935,6 +979,8 @@ static struct option lgopts[] = { { CPERF_DIGEST_SZ, required_argument, 0, 0 }, + { CPERF_ASYM_OP, required_argument, 0, 0 }, + #ifdef RTE_LIB_SECURITY { CPERF_PDCP_SN_SZ, required_argument, 0, 0 }, { CPERF_PDCP_DOMAIN, required_argument, 0, 0 }, @@ -1017,6 +1063,9 @@ cperf_options_default(struct cperf_options *opts) opts->docsis_hdr_sz = 17; #endif opts->modex_data = (struct cperf_modex_test_data *)&modex_perf_data[0]; + + opts->sm2_data = &sm2_perf_data; + opts->asym_op_type = RTE_CRYPTO_ASYM_OP_SIGN; } static int @@ -1053,6 +1102,7 @@ cperf_opts_parse_long(int opt_idx, struct cperf_options *opts) { CPERF_AEAD_IV_SZ, parse_aead_iv_sz }, { CPERF_AEAD_AAD_SZ, parse_aead_aad_sz }, { CPERF_DIGEST_SZ, parse_digest_sz }, + { CPERF_ASYM_OP, parse_asym_op }, #ifdef RTE_LIB_SECURITY { CPERF_PDCP_SN_SZ, parse_pdcp_sn_sz }, { CPERF_PDCP_DOMAIN, parse_pdcp_domain }, @@ -1438,6 +1488,9 @@ cperf_options_dump(struct cperf_options *opts) printf("#\n"); printf("# number of queue pairs per device: %u\n", opts->nb_qps); printf("# crypto operation: %s\n", cperf_op_type_strs[opts->op_type]); + if (opts->op_type == CPERF_ASYM_SM2) + printf("# asym operation type: %s\n", + rte_crypto_asym_op_strings[opts->asym_op_type]); printf("# sessionless: %s\n", opts->sessionless ? "yes" : "no"); printf("# out of place: %s\n", opts->out_of_place ? "yes" : "no"); if (opts->test == CPERF_TEST_TYPE_PMDCC) diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c index 0f1f0b72c1..14ca9e964a 100644 --- a/app/test-crypto-perf/cperf_test_common.c +++ b/app/test-crypto-perf/cperf_test_common.c @@ -305,7 +305,8 @@ cperf_mbuf_set(struct rte_mbuf *mbuf, bool cperf_is_asym_test(const struct cperf_options *options) { - if (options->op_type == CPERF_ASYM_MODEX) + if (options->op_type == CPERF_ASYM_MODEX || + options->op_type == CPERF_ASYM_SM2) return true; return false; diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c index de43d303a5..5ea5333029 100644 --- a/app/test-crypto-perf/cperf_test_vectors.c +++ b/app/test-crypto-perf/cperf_test_vectors.c @@ -804,6 +804,80 @@ cperf_modex_test_data modex_perf_data[10] = { } }; +static uint8_t fp256_pkey[] = { + 0x77, 0x84, 0x35, 0x65, 0x4c, 0x7a, 0x6d, 0xb1, + 0x1e, 0x63, 0x0b, 0x41, 0x97, 0x36, 0x04, 0xf4, + 0xec, 0x35, 0xee, 0x3b, 0x76, 0xc2, 0x34, 0x08, + 0xd9, 0x4a, 0x22, 0x0d, 0x7f, 0xf6, 0xc6, 0x90 +}; + +static uint8_t fp256_qx[] = { + 0x7b, 0x24, 0xa3, 0x03, 0xcf, 0xb2, 0x22, 0xfa, + 0x4c, 0xb3, 0x88, 0x54, 0xf9, 0x30, 0xd1, 0x4d, + 0xe3, 0x50, 0xda, 0xba, 0xe6, 0xa7, 0x0b, 0x91, + 0x4c, 0x04, 0x0d, 0x5c, 0xe0, 0x8e, 0x86, 0xc5 +}; + +static uint8_t fp256_qy[] = { + 0xbc, 0x39, 0xe3, 0x19, 0x4e, 0xd2, 0x29, 0x22, + 0x5b, 0x37, 0x2d, 0xeb, 0xcc, 0x05, 0x52, 0x8d, + 0xb9, 0x40, 0xa3, 0xab, 0x3c, 0xbe, 0x16, 0x30, + 0x1c, 0xe4, 0xe8, 0x7f, 0xba, 0x6e, 0x0b, 0xae +}; + +static uint8_t fp256_k[] = { + 0x01, 0x04, 0x02, 0x05, 0x04, 0x06, 0x03, 0x07 +}; + +static uint8_t fp256_sign_r[] = { + 0x75, 0x2B, 0x8C, 0x15, 0x38, 0x10, 0xF6, 0xC0, + 0x28, 0xC9, 0x8A, 0x51, 0xD0, 0x62, 0x69, 0x4B, + 0xF6, 0x58, 0x06, 0xEB, 0xF1, 0x91, 0x1F, 0x15, + 0x8B, 0x08, 0x09, 0xF9, 0x88, 0x0A, 0x44, 0x24 +}; + +static uint8_t fp256_sign_s[] = { + 0x5A, 0x3C, 0x96, 0x3E, 0x1C, 0xB4, 0x19, 0xF9, + 0xD7, 0x78, 0xB8, 0xCE, 0xFF, 0x9D, 0xB1, 0x31, + 0x77, 0xDB, 0xA0, 0xFE, 0x84, 0x61, 0x1A, 0xD9, + 0x4E, 0xFF, 0x82, 0x13, 0x1C, 0xCA, 0x04, 0x75, +}; + +static uint8_t fp256_id[] = { + 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8 +}; + +static uint8_t fp256_message[] = { + 0x6D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, + 0x64, 0x69, 0x67, 0x65, 0x73, 0x74 +}; + +static uint8_t fp256_digest[] = { + 0x0F, 0xB5, 0xCE, 0xF3, 0x3C, 0xB7, 0xD1, 0x35, + 0xA9, 0x3A, 0xC7, 0xA7, 0x89, 0x2A, 0x6D, 0x9A, + 0xF3, 0x1E, 0xC5, 0x38, 0xD3, 0x65, 0x1B, 0xB9, + 0xDF, 0x5F, 0x7F, 0x4A, 0xD8, 0x89, 0x57, 0xF1 +}; + +static uint8_t fp256_cipher[] = { + 0x30, 0x78, 0x02, 0x21, 0x00, 0xAB, 0xBD, 0xE8, + 0xE8, 0x80, 0x93, 0x36, 0x77, 0xB6, 0x44, 0x47, + 0x6D, 0x00, 0xF6, 0x51, 0xC8, 0x80, 0x9C, 0x9E, + 0xD9, 0xEC, 0x36, 0x8A, 0x60, 0x8E, 0x26, 0x2D, + 0x71, 0x31, 0xB7, 0xC1, 0x38, 0x02, 0x21, 0x00, + 0xE1, 0xBF, 0x4C, 0x13, 0x7A, 0x87, 0x40, 0x32, + 0xF5, 0xA1, 0xE2, 0xA1, 0x3B, 0x83, 0xBF, 0x6B, + 0x3F, 0xFB, 0xC8, 0x13, 0x01, 0xDE, 0xCF, 0xC0, + 0xF4, 0x24, 0x66, 0x52, 0x89, 0xDA, 0x6D, 0x7A, + 0x04, 0x20, 0x8E, 0xFD, 0x52, 0x77, 0xC9, 0xE7, + 0x90, 0xD1, 0x17, 0x75, 0xDE, 0xEE, 0xF3, 0xE5, + 0x11, 0x0C, 0x5D, 0xE1, 0x3A, 0xB6, 0x2B, 0x72, + 0x60, 0xE5, 0xD5, 0xF3, 0x0F, 0xE2, 0x44, 0xDB, + 0xBC, 0x66, 0x04, 0x0E, 0x78, 0x2D, 0xC0, 0x3D, + 0x38, 0xA2, 0x42, 0xA4, 0x8E, 0x8B, 0xF5, 0x06, + 0x32, 0xFA +}; + uint8_t plaintext[2048] = { 0x71, 0x75, 0x83, 0x98, 0x75, 0x42, 0x51, 0x09, 0x94, 0x02, 0x13, 0x20, 0x15, 0x64, 0x46, 0x32, 0x08, 0x18, 0x91, 0x82, 0x86, 0x52, 0x23, 0x93, @@ -1208,6 +1282,52 @@ uint8_t ipsec_plaintext[2048] = { 0x75, 0x67, 0x00, 0x01 }; +/** SM2 Fp256 elliptic curve test params */ +struct +cperf_sm2_test_data sm2_perf_data = { + .pubkey_qx = { + .data = fp256_qx, + .length = sizeof(fp256_qx), + }, + .pubkey_qy = { + .data = fp256_qy, + .length = sizeof(fp256_qy), + }, + .k = { + .data = fp256_k, + .length = sizeof(fp256_k), + }, + .sign_r = { + .data = fp256_sign_r, + .length = sizeof(fp256_sign_r), + }, + .sign_s = { + .data = fp256_sign_s, + .length = sizeof(fp256_sign_s), + }, + .id = { + .data = fp256_id, + .length = sizeof(fp256_id), + }, + .pkey = { + .data = fp256_pkey, + .length = sizeof(fp256_pkey), + }, + .message = { + .data = fp256_message, + .length = sizeof(fp256_message), + }, + .digest = { + .data = fp256_digest, + .length = sizeof(fp256_digest), + }, + .cipher = { + .data = fp256_cipher, + .length = sizeof(fp256_cipher), + }, + .curve = RTE_CRYPTO_EC_GROUP_SM2 +}; + struct cperf_test_vector* cperf_test_vector_get_dummy(struct cperf_options *options) { diff --git a/app/test-crypto-perf/cperf_test_vectors.h b/app/test-crypto-perf/cperf_test_vectors.h index a3e431e5e6..a218081d6e 100644 --- a/app/test-crypto-perf/cperf_test_vectors.h +++ b/app/test-crypto-perf/cperf_test_vectors.h @@ -75,6 +75,16 @@ struct cperf_test_vector { uint32_t mlen; uint32_t elen; } modex; + + struct { + uint8_t *sign_r; + uint8_t *sign_s; + uint8_t *message; + uint8_t *cipher; + uint32_t sign_len; + uint32_t msg_len; + uint32_t cipher_len; + } sm2; }; struct cperf_modex_test_data { @@ -97,6 +107,20 @@ struct cperf_modex_test_data { } result; }; +struct cperf_sm2_test_data { + rte_crypto_param pubkey_qx; + rte_crypto_param pubkey_qy; + rte_crypto_param pkey; + rte_crypto_param k; + rte_crypto_param sign_r; + rte_crypto_param sign_s; + rte_crypto_param id; + rte_crypto_param cipher; + rte_crypto_param message; + rte_crypto_param digest; + int curve; +}; + struct cperf_test_vector* cperf_test_vector_get_dummy(struct cperf_options *options); @@ -111,5 +135,6 @@ extern uint8_t aad[]; extern uint8_t digest[2048]; extern struct cperf_modex_test_data modex_perf_data[10]; +extern struct cperf_sm2_test_data sm2_perf_data; #endif diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index 780f22f399..2f39edbe6a 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -45,6 +45,7 @@ const char *cperf_op_type_strs[] = { [CPERF_DOCSIS] = "docsis", [CPERF_IPSEC] = "ipsec", [CPERF_ASYM_MODEX] = "modex", + [CPERF_ASYM_SM2] = "sm2", [CPERF_TLS] = "tls-record" }; @@ -224,6 +225,7 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs) }; switch (opts->op_type) { + case CPERF_ASYM_SM2: case CPERF_ASYM_MODEX: conf.ff_disable |= (RTE_CRYPTODEV_FF_SECURITY | RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO); @@ -362,6 +364,65 @@ cperf_verify_devices_capabilities(struct cperf_options *opts, } + if (opts->op_type == CPERF_ASYM_SM2) { + asym_cap_idx.type = RTE_CRYPTO_ASYM_XFORM_SM2; + asym_capability = rte_cryptodev_asym_capability_get(cdev_id, &asym_cap_idx); + if (asym_capability == NULL) + return -1; + + if (!rte_cryptodev_asym_xform_capability_check_optype(asym_capability, + opts->asym_op_type)) + return -1; + + if (rte_cryptodev_asym_xform_capability_check_hash(asym_capability, + RTE_CRYPTO_AUTH_SM3)) { + opts->asym_hash_alg = RTE_CRYPTO_AUTH_SM3; + if (opts->asym_op_type == RTE_CRYPTO_ASYM_OP_SIGN || + opts->asym_op_type == RTE_CRYPTO_ASYM_OP_VERIFY) { + opts->sm2_data->message.data = sm2_perf_data.message.data; + opts->sm2_data->message.length = + sm2_perf_data.message.length; + opts->sm2_data->id.data = sm2_perf_data.id.data; + opts->sm2_data->id.length = sm2_perf_data.id.length; + } + } else { + opts->asym_hash_alg = RTE_CRYPTO_AUTH_NULL; + if (opts->asym_op_type == RTE_CRYPTO_ASYM_OP_SIGN || + opts->asym_op_type == RTE_CRYPTO_ASYM_OP_VERIFY) { + opts->sm2_data->message.data = sm2_perf_data.digest.data; + opts->sm2_data->message.length = + sm2_perf_data.digest.length; + opts->sm2_data->id.data = NULL; + opts->sm2_data->id.length = 0; + } + } + if (asym_capability->internal_rng != 0) { + opts->sm2_data->k.data = NULL; + opts->sm2_data->k.length = 0; + } + if (opts->asym_op_type == RTE_CRYPTO_ASYM_OP_ENCRYPT) { + opts->sm2_data->message.data = sm2_perf_data.message.data; + opts->sm2_data->message.length = sm2_perf_data.message.length; + opts->sm2_data->cipher.data = sm2_perf_data.cipher.data; + opts->sm2_data->cipher.length = sm2_perf_data.cipher.length; + } else if (opts->asym_op_type == RTE_CRYPTO_ASYM_OP_DECRYPT) { + opts->sm2_data->cipher.data = sm2_perf_data.cipher.data; + opts->sm2_data->cipher.length = sm2_perf_data.cipher.length; + opts->sm2_data->message.data = sm2_perf_data.message.data; + opts->sm2_data->message.length = sm2_perf_data.message.length; + } else if (opts->asym_op_type == RTE_CRYPTO_ASYM_OP_SIGN) { + opts->sm2_data->sign_r.data = sm2_perf_data.sign_r.data; + opts->sm2_data->sign_r.length = sm2_perf_data.sign_r.length; + opts->sm2_data->sign_s.data = sm2_perf_data.sign_s.data; + opts->sm2_data->sign_s.length = sm2_perf_data.sign_s.length; + } else if (opts->asym_op_type == RTE_CRYPTO_ASYM_OP_VERIFY) { + opts->sm2_data->sign_r.data = sm2_perf_data.sign_r.data; + opts->sm2_data->sign_r.length = sm2_perf_data.sign_r.length; + opts->sm2_data->sign_s.data = sm2_perf_data.sign_s.data; + opts->sm2_data->sign_s.length = sm2_perf_data.sign_s.length; + } + } + if (opts->op_type == CPERF_AUTH_ONLY || opts->op_type == CPERF_CIPHER_THEN_AUTH || opts->op_type == CPERF_AUTH_THEN_CIPHER) { diff --git a/doc/guides/tools/cryptoperf.rst b/doc/guides/tools/cryptoperf.rst index facf412799..8cfb194f10 100644 --- a/doc/guides/tools/cryptoperf.rst +++ b/doc/guides/tools/cryptoperf.rst @@ -175,6 +175,7 @@ The following are the application command-line options: pdcp docsis modex + sm2 ipsec tls-record @@ -342,6 +343,11 @@ The following are the application command-line options: Set modex length for asymmetric crypto perf test. Supported lengths are 60, 128, 255, 448. Default length is 128. +* ``--asym-op `` + + Set Asymmetric crypto operation mode. + To be used with SM2 asymmetric crypto ops. Default is ``sign``. + * ``--tls-version `` Set TLS/DTLS protocol version for perf test (default is TLS1.2). From patchwork Wed Jun 26 08:47:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 141755 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 159FB454FF; Wed, 26 Jun 2024 10:51:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9FDE842E76; Wed, 26 Jun 2024 10:51:31 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 951BF42E6E for ; Wed, 26 Jun 2024 10:50:04 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45Q8ngiS023031; Wed, 26 Jun 2024 01:50:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=E p2cCLBLdO/Ill2Bm+ECjJ4JZM54DMLQw5nk778VBQA=; b=GC50h4rA+zSnrAMCy bwNI8D5JIYDm7L1WHGPTocvuiGd4AemELSPvojKT8clQDuhgmPD6HdPpap0vdsrJ FWL1Ob4tIvkq/k78+wZV1R/vZ26Q0z2uZO5tzFzUXAop2gAj0nV8JdSvy0KLCliu fO5SZrzzArICr0UU8I/1SiV0KJiOgJ400J/9J5ekKmUQRvYnSIeefpe5aDsqvWGj YaKJKwMviJSPpw2E5OuIDNwwdhl3wfeypYD86r/t878BHBJ9nT/jWIGkS2oQByyv rJ92oGXAM3C3uDNonqNxhbaXOR2qxa77v6ppIA7awceCiWApP9/dQydpQ+hlETxN cf7MA== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 400ftng017-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jun 2024 01:50:03 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 26 Jun 2024 01:48:28 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 26 Jun 2024 01:48:27 -0700 Received: from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.168.34]) by maili.marvell.com (Postfix) with ESMTP id EB9913F707B; Wed, 26 Jun 2024 01:48:25 -0700 (PDT) From: Gowrishankar Muthukrishnan To: , Ciara Power CC: Anoob Joseph , Akhil Goyal , Gowrishankar Muthukrishnan Subject: [PATCH v2 6/6] app/crypto-perf: support ECDSA Date: Wed, 26 Jun 2024 14:17:45 +0530 Message-ID: <20240626084747.1595-7-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20240626084747.1595-1-gmuthukrishn@marvell.com> References: <20240615115309.2678-1-gmuthukrishn@marvell.com> <20240626084747.1595-1-gmuthukrishn@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: AUVz_NGtZVmDo-udDfKfjivTMmZL9hU8 X-Proofpoint-GUID: AUVz_NGtZVmDo-udDfKfjivTMmZL9hU8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-26_03,2024-06-25_01,2024-05-17_01 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 Added support for ECDSA SECP256R1 curve SIGN and VERIFY operations. Signed-off-by: Gowrishankar Muthukrishnan --- app/test-crypto-perf/cperf_ops.c | 57 ++++++++++++++ app/test-crypto-perf/cperf_options.h | 2 + app/test-crypto-perf/cperf_options_parsing.c | 10 ++- app/test-crypto-perf/cperf_test_common.c | 1 + app/test-crypto-perf/cperf_test_vectors.c | 83 ++++++++++++++++++++ app/test-crypto-perf/cperf_test_vectors.h | 12 +++ app/test-crypto-perf/main.c | 18 +++++ doc/guides/tools/cryptoperf.rst | 1 + 8 files changed, 182 insertions(+), 2 deletions(-) diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c index f0860a46c0..62b165124f 100644 --- a/app/test-crypto-perf/cperf_ops.c +++ b/app/test-crypto-perf/cperf_ops.c @@ -34,6 +34,39 @@ cperf_set_ops_asym_modex(struct rte_crypto_op **ops, } } +static void +cperf_set_ops_asym_ecdsa(struct rte_crypto_op **ops, + uint32_t src_buf_offset __rte_unused, + uint32_t dst_buf_offset __rte_unused, uint16_t nb_ops, + void *sess, + const struct cperf_options *options, + const struct cperf_test_vector *test_vector __rte_unused, + uint16_t iv_offset __rte_unused, + uint32_t *imix_idx __rte_unused, + uint64_t *tsc_start __rte_unused) +{ + uint16_t i; + + for (i = 0; i < nb_ops; i++) { + struct rte_crypto_asym_op *asym_op = ops[i]->asym; + + ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED; + rte_crypto_op_attach_asym_session(ops[i], sess); + + asym_op->ecdsa.op_type = options->asym_op_type; + asym_op->ecdsa.message.data = options->secp256r1_data->message.data; + asym_op->ecdsa.message.length = options->secp256r1_data->message.length; + + asym_op->ecdsa.k.data = options->secp256r1_data->k.data; + asym_op->ecdsa.k.length = options->secp256r1_data->k.length; + + asym_op->ecdsa.r.data = options->secp256r1_data->sign_r.data; + asym_op->ecdsa.r.length = options->secp256r1_data->sign_r.length; + asym_op->ecdsa.s.data = options->secp256r1_data->sign_s.data; + asym_op->ecdsa.s.length = options->secp256r1_data->sign_s.length; + } +} + static void cperf_set_ops_asym_sm2(struct rte_crypto_op **ops, uint32_t src_buf_offset __rte_unused, @@ -974,6 +1007,27 @@ cperf_create_session(struct rte_mempool *sess_mp, return asym_sess; } + if (options->op_type == CPERF_ASYM_SECP256R1) { + xform.next = NULL; + xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA; + xform.ec.curve_id = options->secp256r1_data->curve; + xform.ec.pkey.data = options->secp256r1_data->pkey.data; + xform.ec.pkey.length = options->secp256r1_data->pkey.length; + xform.ec.q.x.data = options->secp256r1_data->pubkey_qx.data; + xform.ec.q.x.length = options->secp256r1_data->pubkey_qx.length; + xform.ec.q.y.data = options->secp256r1_data->pubkey_qy.data; + xform.ec.q.y.length = options->secp256r1_data->pubkey_qy.length; + + ret = rte_cryptodev_asym_session_create(dev_id, &xform, + sess_mp, &asym_sess); + if (ret < 0) { + RTE_LOG(ERR, USER1, "ECDSA Asym session create failed\n"); + return NULL; + } + + return asym_sess; + } + if (options->op_type == CPERF_ASYM_SM2) { xform.next = NULL; xform.xform_type = RTE_CRYPTO_ASYM_XFORM_SM2; @@ -1294,6 +1348,9 @@ cperf_get_op_functions(const struct cperf_options *options, case CPERF_ASYM_MODEX: op_fns->populate_ops = cperf_set_ops_asym_modex; break; + case CPERF_ASYM_SECP256R1: + op_fns->populate_ops = cperf_set_ops_asym_ecdsa; + break; case CPERF_ASYM_SM2: op_fns->populate_ops = cperf_set_ops_asym_sm2; break; diff --git a/app/test-crypto-perf/cperf_options.h b/app/test-crypto-perf/cperf_options.h index d730ae18d0..9364c030c0 100644 --- a/app/test-crypto-perf/cperf_options.h +++ b/app/test-crypto-perf/cperf_options.h @@ -87,6 +87,7 @@ enum cperf_op_type { CPERF_DOCSIS, CPERF_IPSEC, CPERF_ASYM_MODEX, + CPERF_ASYM_SECP256R1, CPERF_ASYM_SM2, CPERF_TLS, }; @@ -165,6 +166,7 @@ struct cperf_options { uint8_t imix_distribution_count; struct cperf_modex_test_data *modex_data; uint16_t modex_len; + struct cperf_ecdsa_test_data *secp256r1_data; struct cperf_sm2_test_data *sm2_data; enum rte_crypto_asym_op_type asym_op_type; enum rte_crypto_auth_algorithm asym_hash_alg; diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c index 49609e560e..b6ed9c8a57 100644 --- a/app/test-crypto-perf/cperf_options_parsing.c +++ b/app/test-crypto-perf/cperf_options_parsing.c @@ -11,6 +11,7 @@ #include #include "cperf_options.h" +#include "cperf_test_common.h" #include "cperf_test_vectors.h" #define AES_BLOCK_SIZE 16 @@ -37,7 +38,7 @@ usage(char *progname) " --desc-nb N: set number of descriptors for each crypto device\n" " --devtype TYPE: set crypto device type to use\n" " --optype cipher-only / auth-only / cipher-then-auth / auth-then-cipher /\n" - " aead / pdcp / docsis / ipsec / modex / sm2 / tls-record : set operation type\n" + " aead / pdcp / docsis / ipsec / modex / secp256r1 / sm2 / tls-record : set operation type\n" " --sessionless: enable session-less crypto operations\n" " --out-of-place: enable out-of-place crypto operations\n" " --test-file NAME: set the test vector file path\n" @@ -483,6 +484,10 @@ parse_op_type(struct cperf_options *opts, const char *arg) cperf_op_type_strs[CPERF_ASYM_MODEX], CPERF_ASYM_MODEX }, + { + cperf_op_type_strs[CPERF_ASYM_SECP256R1], + CPERF_ASYM_SECP256R1 + }, { cperf_op_type_strs[CPERF_ASYM_SM2], CPERF_ASYM_SM2 @@ -1064,6 +1069,7 @@ cperf_options_default(struct cperf_options *opts) #endif opts->modex_data = (struct cperf_modex_test_data *)&modex_perf_data[0]; + opts->secp256r1_data = &secp256r1_perf_data; opts->sm2_data = &sm2_perf_data; opts->asym_op_type = RTE_CRYPTO_ASYM_OP_SIGN; } @@ -1488,7 +1494,7 @@ cperf_options_dump(struct cperf_options *opts) printf("#\n"); printf("# number of queue pairs per device: %u\n", opts->nb_qps); printf("# crypto operation: %s\n", cperf_op_type_strs[opts->op_type]); - if (opts->op_type == CPERF_ASYM_SM2) + if (opts->op_type == CPERF_ASYM_SM2 || opts->op_type == CPERF_ASYM_SECP256R1) printf("# asym operation type: %s\n", rte_crypto_asym_op_strings[opts->asym_op_type]); printf("# sessionless: %s\n", opts->sessionless ? "yes" : "no"); diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c index 14ca9e964a..33bee43c93 100644 --- a/app/test-crypto-perf/cperf_test_common.c +++ b/app/test-crypto-perf/cperf_test_common.c @@ -306,6 +306,7 @@ bool cperf_is_asym_test(const struct cperf_options *options) { if (options->op_type == CPERF_ASYM_MODEX || + options->op_type == CPERF_ASYM_SECP256R1 || options->op_type == CPERF_ASYM_SM2) return true; diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c index 5ea5333029..19c56b46bd 100644 --- a/app/test-crypto-perf/cperf_test_vectors.c +++ b/app/test-crypto-perf/cperf_test_vectors.c @@ -804,6 +804,55 @@ cperf_modex_test_data modex_perf_data[10] = { } }; +static uint8_t secp256r1_pkey[] = { + 0x51, 0x9b, 0x42, 0x3d, 0x71, 0x5f, 0x8b, 0x58, + 0x1f, 0x4f, 0xa8, 0xee, 0x59, 0xf4, 0x77, 0x1a, + 0x5b, 0x44, 0xc8, 0x13, 0x0b, 0x4e, 0x3e, 0xac, + 0xca, 0x54, 0xa5, 0x6d, 0xda, 0x72, 0xb4, 0x64 +}; + +static uint8_t secp256r1_qx[] = { + 0x1c, 0xcb, 0xe9, 0x1c, 0x07, 0x5f, 0xc7, 0xf4, + 0xf0, 0x33, 0xbf, 0xa2, 0x48, 0xdb, 0x8f, 0xcc, + 0xd3, 0x56, 0x5d, 0xe9, 0x4b, 0xbf, 0xb1, 0x2f, + 0x3c, 0x59, 0xff, 0x46, 0xc2, 0x71, 0xbf, 0x83 +}; + +static uint8_t secp256r1_qy[] = { + 0xce, 0x40, 0x14, 0xc6, 0x88, 0x11, 0xf9, 0xa2, + 0x1a, 0x1f, 0xdb, 0x2c, 0x0e, 0x61, 0x13, 0xe0, + 0x6d, 0xb7, 0xca, 0x93, 0xb7, 0x40, 0x4e, 0x78, + 0xdc, 0x7c, 0xcd, 0x5c, 0xa8, 0x9a, 0x4c, 0xa9 +}; + +static uint8_t secp256r1_k[] = { + 0x94, 0xa1, 0xbb, 0xb1, 0x4b, 0x90, 0x6a, 0x61, + 0xa2, 0x80, 0xf2, 0x45, 0xf9, 0xe9, 0x3c, 0x7f, + 0x3b, 0x4a, 0x62, 0x47, 0x82, 0x4f, 0x5d, 0x33, + 0xb9, 0x67, 0x07, 0x87, 0x64, 0x2a, 0x68, 0xde +}; + +static uint8_t secp256r1_sign_r[] = { + 0xf3, 0xac, 0x80, 0x61, 0xb5, 0x14, 0x79, 0x5b, + 0x88, 0x43, 0xe3, 0xd6, 0x62, 0x95, 0x27, 0xed, + 0x2a, 0xfd, 0x6b, 0x1f, 0x6a, 0x55, 0x5a, 0x7a, + 0xca, 0xbb, 0x5e, 0x6f, 0x79, 0xc8, 0xc2, 0xac +}; + +static uint8_t secp256r1_sign_s[] = { + 0x8b, 0xf7, 0x78, 0x19, 0xca, 0x05, 0xa6, 0xb2, + 0x78, 0x6c, 0x76, 0x26, 0x2b, 0xf7, 0x37, 0x1c, + 0xef, 0x97, 0xb2, 0x18, 0xe9, 0x6f, 0x17, 0x5a, + 0x3c, 0xcd, 0xda, 0x2a, 0xcc, 0x05, 0x89, 0x03 +}; + +static uint8_t secp256r1_message[] = { + 0x44, 0xac, 0xf6, 0xb7, 0xe3, 0x6c, 0x13, 0x42, + 0xc2, 0xc5, 0x89, 0x72, 0x04, 0xfe, 0x09, 0x50, + 0x4e, 0x1e, 0x2e, 0xfb, 0x1a, 0x90, 0x03, 0x77, + 0xdb, 0xc4, 0xe7, 0xa6, 0xa1, 0x33, 0xec, 0x56 +}; + static uint8_t fp256_pkey[] = { 0x77, 0x84, 0x35, 0x65, 0x4c, 0x7a, 0x6d, 0xb1, 0x1e, 0x63, 0x0b, 0x41, 0x97, 0x36, 0x04, 0xf4, @@ -1282,6 +1331,40 @@ uint8_t ipsec_plaintext[2048] = { 0x75, 0x67, 0x00, 0x01 }; +/** ECDSA secp256r1 elliptic curve test params */ +struct +cperf_ecdsa_test_data secp256r1_perf_data = { + .pubkey_qx = { + .data = secp256r1_qx, + .length = sizeof(secp256r1_qx), + }, + .pubkey_qy = { + .data = secp256r1_qy, + .length = sizeof(secp256r1_qy), + }, + .k = { + .data = secp256r1_k, + .length = sizeof(secp256r1_k), + }, + .sign_r = { + .data = secp256r1_sign_r, + .length = sizeof(secp256r1_sign_r), + }, + .sign_s = { + .data = secp256r1_sign_s, + .length = sizeof(secp256r1_sign_s), + }, + .pkey = { + .data = secp256r1_pkey, + .length = sizeof(secp256r1_pkey), + }, + .message = { + .data = secp256r1_message, + .length = sizeof(secp256r1_message), + }, + .curve = RTE_CRYPTO_EC_GROUP_SECP256R1 +}; + /** SM2 Fp256 elliptic curve test params */ struct cperf_sm2_test_data sm2_perf_data = { diff --git a/app/test-crypto-perf/cperf_test_vectors.h b/app/test-crypto-perf/cperf_test_vectors.h index a218081d6e..d46cbbc2c8 100644 --- a/app/test-crypto-perf/cperf_test_vectors.h +++ b/app/test-crypto-perf/cperf_test_vectors.h @@ -107,6 +107,17 @@ struct cperf_modex_test_data { } result; }; +struct cperf_ecdsa_test_data { + rte_crypto_param pubkey_qx; + rte_crypto_param pubkey_qy; + rte_crypto_param pkey; + rte_crypto_param k; + rte_crypto_param sign_r; + rte_crypto_param sign_s; + rte_crypto_param message; + int curve; +}; + struct cperf_sm2_test_data { rte_crypto_param pubkey_qx; rte_crypto_param pubkey_qy; @@ -135,6 +146,7 @@ extern uint8_t aad[]; extern uint8_t digest[2048]; extern struct cperf_modex_test_data modex_perf_data[10]; +extern struct cperf_ecdsa_test_data secp256r1_perf_data; extern struct cperf_sm2_test_data sm2_perf_data; #endif diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index 2f39edbe6a..989ff456bb 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -45,6 +45,7 @@ const char *cperf_op_type_strs[] = { [CPERF_DOCSIS] = "docsis", [CPERF_IPSEC] = "ipsec", [CPERF_ASYM_MODEX] = "modex", + [CPERF_ASYM_SECP256R1] = "ecdsa_p256r1", [CPERF_ASYM_SM2] = "sm2", [CPERF_TLS] = "tls-record" }; @@ -225,6 +226,7 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs) }; switch (opts->op_type) { + case CPERF_ASYM_SECP256R1: case CPERF_ASYM_SM2: case CPERF_ASYM_MODEX: conf.ff_disable |= (RTE_CRYPTODEV_FF_SECURITY | @@ -364,6 +366,22 @@ cperf_verify_devices_capabilities(struct cperf_options *opts, } + if (opts->op_type == CPERF_ASYM_SECP256R1) { + asym_cap_idx.type = RTE_CRYPTO_ASYM_XFORM_ECDSA; + asym_capability = rte_cryptodev_asym_capability_get(cdev_id, &asym_cap_idx); + if (asym_capability == NULL) + return -1; + + if (!rte_cryptodev_asym_xform_capability_check_optype(asym_capability, + opts->asym_op_type)) + return -1; + + if (asym_capability->internal_rng != 0) { + opts->secp256r1_data->k.data = NULL; + opts->secp256r1_data->k.length = 0; + } + } + if (opts->op_type == CPERF_ASYM_SM2) { asym_cap_idx.type = RTE_CRYPTO_ASYM_XFORM_SM2; asym_capability = rte_cryptodev_asym_capability_get(cdev_id, &asym_cap_idx); diff --git a/doc/guides/tools/cryptoperf.rst b/doc/guides/tools/cryptoperf.rst index 8cfb194f10..6d1d50f237 100644 --- a/doc/guides/tools/cryptoperf.rst +++ b/doc/guides/tools/cryptoperf.rst @@ -175,6 +175,7 @@ The following are the application command-line options: pdcp docsis modex + ecdsa_p256r1 sm2 ipsec tls-record