From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 705F8CD5BD1 for ; Thu, 28 May 2026 08:01:52 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D93F40608; Thu, 28 May 2026 10:01:48 +0200 (CEST) Received: from mx0a-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 4BB8A4014F for ; Thu, 28 May 2026 09:58:59 +0200 (CEST) Received: from pps.filterd (m0431384.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64RKiUEo604424; Thu, 28 May 2026 00:58:58 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=MpSj0L7f2UTG3VYU3soGHJ5 R2Lv1CetEWit0jZ5shHk=; b=M9x9Ol4N3EjNk/D3/6d30cru/VWv/ezft+VHB+z S8m/p+Hsd0FJrdKHEH9U0JYZjJ/au02Y5AUSTI1N8LLANwVGH6zSnMLaCMBEs2KK ji0kHGnlbt7lwyhFjgDMn7CBi7COa3/EZXSOGfS+1hDP6sbsyNaIgV2CpoZUpZLU I8G5G+mdyX8vvgiLUFX4IrRy3V3UPpNHxfQ5AejjQ+CiBgHiJ/nmE9FsqCTNH653 J6fmLYMb+awEI8NnMCzINccNfCDd1vjsuIMvRhlYnRyCdoPiRTYkrIJqNfS+RW69 VgkFmoMBY9cbuJYijAXvchVhQvQKy6muadBjYDKimsLwZCA== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 4ee7wu1fc7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 May 2026 00:58:58 -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.25; Thu, 28 May 2026 00:58:56 -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.25 via Frontend Transport; Thu, 28 May 2026 00:58:56 -0700 Received: from cavium-PowerEdge-T110-II.. (unknown [10.28.38.34]) by maili.marvell.com (Postfix) with ESMTP id 7A4645C68E6; Thu, 28 May 2026 00:58:54 -0700 (PDT) From: Pratik Senapati To: CC: , , , Subject: [PATCH] app/crypto-perf: support ML KEM Date: Thu, 28 May 2026 13:28:52 +0530 Message-ID: <20260528075853.2206573-1-psenapati@marvell.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTI4MDA3OSBTYWx0ZWRfXy3V8YSJFxbFk C+ff8rW16f6GyYvvwE13xsSF550gowiNsmjF7glm2qj2JVPWUQM5DFg9fNe6SVxcYpifuQtZbah WF12uNTy3jqDm6Odn/DNedpsX08lrd3TaP3vQsk8AIjM27SeO2taKdh4uR1lLIoThTfUEb+AlyT F3Ua1Dkbsu7FvNMexcxlaZj/GFJGUHodqvtwY2Bm7X8XmrfElLKrEKFUk4a43Oy/Yzuk+poSjy1 JeDUk2pBRBOhEN++xp5SNqnEaxz96AqjlvmTslKXNB0uTUL0hwQPaPb0d6yxWjj+q3W+B5sckd8 9XvKjfM51NSVYbA/olIc6zz7QBMjald+T64KCTPteuAJqFsudWgU0HPid09ygdRZL6CpGv81BGS Pc/vpx3Yd241CfOK59/D634SFmK9eGlN9d0ixzPiHHyy+lfuEaOuliF1VqxTI7LgpS+bnm6A3tt OkmTVnwSK/MSHO3vCsg== X-Proofpoint-ORIG-GUID: h5Ow6iCnCrR8rK1IkfNXww8dnKmlsx8D X-Authority-Analysis: v=2.4 cv=M9d97Sws c=1 sm=1 tr=0 ts=6a17f5c2 cx=c_pps a=gIfcoYsirJbf48DBMSPrZA==:117 a=gIfcoYsirJbf48DBMSPrZA==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=l0iWHRpgs5sLHlkKQ1IR:22 a=TtqV-g6YmW1Jfm2GSLaY:22 a=M5GUcnROAAAA:8 a=EfwNXROUspds96XmZAcA:9 a=OBjm3rFKGHvpk9ecZwUJ:22 X-Proofpoint-GUID: h5Ow6iCnCrR8rK1IkfNXww8dnKmlsx8D X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-05-28_02,2026-05-26_03,2025-10-01_01 X-Mailman-Approved-At: Thu, 28 May 2026 10:01:46 +0200 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 ML-KEM512 support to test-crypto-perf. Signed-off-by: Pratik Senapati --- app/test-crypto-perf/cperf_ops.c | 61 +++ app/test-crypto-perf/cperf_options.h | 2 + app/test-crypto-perf/cperf_options_parsing.c | 20 + app/test-crypto-perf/cperf_test_common.c | 3 +- app/test-crypto-perf/cperf_test_vectors.c | 470 +++++++++++++++++++ app/test-crypto-perf/cperf_test_vectors.h | 27 ++ app/test-crypto-perf/main.c | 21 +- 7 files changed, 602 insertions(+), 2 deletions(-) diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c index 9297b4a3d3..806265f7bf 100644 --- a/app/test-crypto-perf/cperf_ops.c +++ b/app/test-crypto-perf/cperf_ops.c @@ -208,6 +208,49 @@ cperf_set_ops_asym_sm2(struct rte_crypto_op **ops, } } +static void +cperf_set_ops_asym_mlkem(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); + + if (options->asym_op_type == RTE_CRYPTO_ASYM_OP_ENCRYPT) { + asym_op->mlkem.op = RTE_CRYPTO_ML_KEM_OP_ENCAP; + asym_op->mlkem.encap.ek.data = options->mlkem_data->ek.data; + asym_op->mlkem.encap.ek.length = options->mlkem_data->ek.length; + asym_op->mlkem.encap.cipher.data = options->mlkem_data->cipher.data; + asym_op->mlkem.encap.cipher.length = options->mlkem_data->cipher.length; + asym_op->mlkem.encap.sk.data = options->mlkem_data->sk.data; + asym_op->mlkem.encap.sk.length = options->mlkem_data->sk.length; + asym_op->mlkem.encap.message.data = options->mlkem_data->message.data; + asym_op->mlkem.encap.message.length = options->mlkem_data->message.length; + } else if (options->asym_op_type == RTE_CRYPTO_ASYM_OP_DECRYPT) { + asym_op->mlkem.op = RTE_CRYPTO_ML_KEM_OP_DECAP; + asym_op->mlkem.decap.dk.data = options->mlkem_data->dk.data; + asym_op->mlkem.decap.dk.length = options->mlkem_data->dk.length; + asym_op->mlkem.decap.cipher.data = options->mlkem_data->cipher.data; + asym_op->mlkem.decap.cipher.length = options->mlkem_data->cipher.length; + asym_op->mlkem.decap.sk.data = options->mlkem_data->sk.data; + asym_op->mlkem.decap.sk.length = options->mlkem_data->sk.length; + } else { + rte_panic("Unsupported ML-KEM operation type %d\n", options->asym_op_type); + } + } +} + #ifdef RTE_LIB_SECURITY static void @@ -1226,6 +1269,21 @@ cperf_create_session(struct rte_mempool *sess_mp, return asym_sess; } + + if (options->op_type == CPERF_ASYM_MLKEM512) { + xform.next = NULL; + xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ML_KEM; + xform.mlkem.type = RTE_CRYPTO_ML_KEM_512; + + ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mp, &asym_sess); + if (ret < 0) { + RTE_LOG(ERR, USER1, "ML-KEM Asym session create failed\n"); + return NULL; + } + return asym_sess; + } + + #ifdef RTE_LIB_SECURITY /* * security only @@ -1542,6 +1600,9 @@ cperf_get_op_functions(const struct cperf_options *options, case CPERF_ASYM_SM2: op_fns->populate_ops = cperf_set_ops_asym_sm2; break; + case CPERF_ASYM_MLKEM512: + op_fns->populate_ops = cperf_set_ops_asym_mlkem; + break; #ifdef RTE_LIB_SECURITY case CPERF_PDCP: case CPERF_DOCSIS: diff --git a/app/test-crypto-perf/cperf_options.h b/app/test-crypto-perf/cperf_options.h index 428e8cb4f1..98b8eeec3e 100644 --- a/app/test-crypto-perf/cperf_options.h +++ b/app/test-crypto-perf/cperf_options.h @@ -101,6 +101,7 @@ enum cperf_op_type { CPERF_ASYM_SECP521R1, CPERF_ASYM_ED25519, CPERF_ASYM_SM2, + CPERF_ASYM_MLKEM512, CPERF_TLS, }; @@ -187,6 +188,7 @@ struct cperf_options { struct cperf_ecdsa_test_data *secp521r1_data; struct cperf_eddsa_test_data *eddsa_data; struct cperf_sm2_test_data *sm2_data; + struct cperf_mlkem_test_data *mlkem_data; enum rte_crypto_asym_op_type asym_op_type; enum rte_crypto_auth_algorithm asym_hash_alg; struct cperf_rsa_test_data *rsa_data; diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c index 14e731586b..34afa938c8 100644 --- a/app/test-crypto-perf/cperf_options_parsing.c +++ b/app/test-crypto-perf/cperf_options_parsing.c @@ -41,6 +41,7 @@ usage(char *progname) " --optype cipher-only / auth-only / cipher-then-auth / auth-then-cipher /\n" " aead / pdcp / docsis / ipsec / modex / rsa / secp192r1 /\n" " secp224r1 / secp256r1 / secp384r1 / secp521r1 / eddsa / sm2 /\n" + " mlkem_512 /\n" " tls-record : set operation type\n" " --sessionless: enable session-less crypto operations\n" " --shared-session: share 1 session across all queue pairs on crypto device\n" @@ -559,6 +560,10 @@ parse_op_type(struct cperf_options *opts, const char *arg) cperf_op_type_strs[CPERF_ASYM_SM2], CPERF_ASYM_SM2 }, + { + cperf_op_type_strs[CPERF_ASYM_MLKEM512], + CPERF_ASYM_MLKEM512 + }, { cperf_op_type_strs[CPERF_TLS], CPERF_TLS @@ -1174,6 +1179,7 @@ cperf_options_default(struct cperf_options *opts) opts->secp521r1_data = &secp521r1_perf_data; opts->eddsa_data = &ed25519_perf_data; opts->sm2_data = &sm2_perf_data; + opts->mlkem_data = &mlkem_encap_perf_data[0]; opts->asym_op_type = RTE_CRYPTO_ASYM_OP_ENCRYPT; } @@ -1669,6 +1675,18 @@ cperf_options_check(struct cperf_options *options) } } + if (options->op_type == CPERF_ASYM_MLKEM512) { + if (options->asym_op_type == RTE_CRYPTO_ASYM_OP_ENCRYPT) + options->mlkem_data = &mlkem_encap_perf_data[0]; + else if (options->asym_op_type == RTE_CRYPTO_ASYM_OP_DECRYPT) + options->mlkem_data = &mlkem_decap_perf_data[0]; + else { + RTE_LOG(ERR, USER1, + "ML-KEM operations only support encrypt (encapsulate) and decrypt (decapsulate)\n"); + return -EINVAL; + } + } + #ifdef RTE_LIB_SECURITY if (options->op_type == CPERF_DOCSIS) { if (check_docsis_buffer_length(options) < 0) @@ -1741,6 +1759,8 @@ cperf_options_dump(struct cperf_options *opts) rte_crypto_asym_op_strings[opts->asym_op_type]); if (opts->op_type == CPERF_ASYM_RSA) printf("# rsa test name: %s\n", opts->rsa_data->name); + if (opts->op_type == CPERF_ASYM_MLKEM512) + printf("# mlkem test name: %s\n", opts->mlkem_data->name); } printf("# sessionless: %s\n", opts->sessionless ? "yes" : "no"); printf("# shared session: %s\n", opts->shared_session ? "yes" : "no"); diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c index caf429b4d9..383d4bd940 100644 --- a/app/test-crypto-perf/cperf_test_common.c +++ b/app/test-crypto-perf/cperf_test_common.c @@ -313,7 +313,8 @@ cperf_is_asym_test(const struct cperf_options *options) options->op_type == CPERF_ASYM_SECP384R1 || options->op_type == CPERF_ASYM_SECP521R1 || options->op_type == CPERF_ASYM_ED25519 || - options->op_type == CPERF_ASYM_SM2) + options->op_type == CPERF_ASYM_SM2 || + options->op_type == CPERF_ASYM_MLKEM512) 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 f4f856ff69..6e2435b004 100644 --- a/app/test-crypto-perf/cperf_test_vectors.c +++ b/app/test-crypto-perf/cperf_test_vectors.c @@ -3510,6 +3510,430 @@ uint8_t rsa_8192_cipher[] = { 0xab, 0x45, 0xa7, 0x55, 0xf5, 0xc1, 0x33, 0x3e, }; +uint8_t mlkem_512_dk[] = { + 0xd8, 0xc8, 0x4d, 0x74, 0x57, 0x6d, 0x43, 0x65, + 0x84, 0xe0, 0x82, 0x87, 0x2d, 0xd0, 0x0b, 0x39, + 0x08, 0x41, 0xc8, 0x85, 0x15, 0x26, 0xfb, 0x85, + 0x68, 0xe1, 0x30, 0x98, 0xf0, 0xb1, 0x3d, 0xea, + 0xa5, 0x4c, 0xc4, 0x59, 0x81, 0xfb, 0x33, 0xed, + 0x20, 0x3a, 0x7f, 0x10, 0x82, 0x3d, 0x85, 0x18, + 0x69, 0x56, 0x6b, 0x5b, 0x7c, 0x92, 0x0f, 0x57, + 0x37, 0xf2, 0x93, 0x38, 0x24, 0xd3, 0x1e, 0xe1, + 0x84, 0x16, 0x39, 0x9a, 0x0d, 0xbd, 0xba, 0x22, + 0xaa, 0xc8, 0xa1, 0xd9, 0xd8, 0x2a, 0xc7, 0xc1, + 0x78, 0x21, 0x01, 0x85, 0x38, 0x54, 0x39, 0x34, + 0x25, 0x8c, 0xce, 0xda, 0xa3, 0x0c, 0x66, 0x99, + 0x39, 0xf7, 0x63, 0xb6, 0x86, 0x80, 0xe0, 0xe4, + 0x64, 0x2a, 0xfc, 0xc2, 0xe0, 0x71, 0x6c, 0x59, + 0x7c, 0x9a, 0x03, 0xac, 0x6f, 0x16, 0x08, 0x64, + 0x3d, 0x4b, 0xa5, 0x83, 0xc5, 0x34, 0x27, 0x2a, + 0x20, 0x18, 0xb8, 0x2d, 0x28, 0x61, 0x2a, 0x94, + 0x55, 0xc7, 0xc3, 0x93, 0x91, 0x71, 0x43, 0x7f, + 0x74, 0xb2, 0x6b, 0x55, 0xb1, 0x9d, 0xc8, 0x08, + 0x53, 0xda, 0xb6, 0x19, 0x46, 0x5c, 0x20, 0xea, + 0x31, 0x31, 0xfc, 0x41, 0x02, 0xe6, 0x3c, 0x3e, + 0xd8, 0x68, 0x6f, 0xa6, 0x66, 0x1e, 0xc7, 0xc6, + 0x0a, 0xf8, 0x02, 0x1e, 0x1e, 0xfa, 0x9a, 0x30, + 0x18, 0x64, 0xdc, 0x30, 0x20, 0x9a, 0xb6, 0x6e, + 0x85, 0xe8, 0xb0, 0xb3, 0xe1, 0x24, 0x4e, 0xf0, + 0x4a, 0x9c, 0xb3, 0x0e, 0xe0, 0xd2, 0x6a, 0x6e, + 0xc7, 0xc3, 0x15, 0x35, 0x49, 0x77, 0x07, 0x7e, + 0x33, 0x7c, 0x97, 0x6e, 0xeb, 0xb3, 0x7c, 0x86, + 0xb2, 0xa0, 0xe3, 0x8a, 0x13, 0x81, 0x99, 0xc6, + 0x75, 0x41, 0xa6, 0x2a, 0x6f, 0x16, 0xe2, 0x4e, + 0x52, 0x14, 0x0d, 0xcb, 0x74, 0x8d, 0xb4, 0x89, + 0xcf, 0xa8, 0x4c, 0x57, 0xaa, 0x18, 0x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x99, 0xd9, 0x4c, 0xb3, 0xf7, 0x45, + 0x92, 0xfa, 0x77, 0x9e, 0x18, 0x72, 0x1a, 0x23, + 0x9c, 0x4e, 0x5e, 0xd9, 0x22, 0x2e, 0xb0, 0x16, + 0x9d, 0x03, 0x6a, 0x0e, 0x49, 0x94, 0x97, 0xa3, + 0x19, 0x94, 0xa1, 0x7e, 0x9d, 0x7b, 0x87, 0xc1, + 0x6a, 0x12, 0x42, 0xc9, 0x22, 0xbe, 0xeb, 0x38, + 0xbe, 0xfa, 0x0b, 0xac, 0x25, 0xb9, 0x78, 0xec, + 0x33, 0xdf, 0x86, 0xcb, 0xce, 0xe1, 0xa6, 0x69, + 0x28, 0x39, 0xd5, 0x68, 0x73, 0xcb, 0x8a, 0xcc, + 0x3d, 0xfa, 0x0e, 0x79, 0x71, 0x3e, 0x44, 0x19, + 0x9a, 0xac, 0xf4, 0x43, 0xa9, 0xba, 0x10, 0x7e, + 0x49, 0xc8, 0x8f, 0xf9, 0xac, 0xd2, 0x07, 0xb1, + 0x4b, 0x2b, 0x15, 0x65, 0x05, 0x12, 0xc3, 0xcc, + 0x36, 0x69, 0x17, 0x78, 0xa3, 0x00, 0x6d, 0xb7, + 0xe9, 0x03, 0x78, 0xb3, 0x33, 0xe5, 0xcc, 0x22, + 0xc3, 0x91, 0x8f, 0x47, 0x79, 0xaf, 0x2e, 0x19, + 0x91, 0x05, 0xab, 0x5e, 0x3e, 0x43, 0xa4, 0x34, + 0x0b, 0x8c, 0x89, 0x75, 0xc0, 0x08, 0x44, 0x07, + 0xdd, 0x17, 0x83, 0xc6, 0x48, 0x09, 0x12, 0xe6, + 0x25, 0xde, 0x99, 0x00, 0x51, 0xc1, 0x65, 0x8a, + 0x85, 0x02, 0xa8, 0xd5, 0x72, 0x41, 0x67, 0x66, + 0x08, 0xe9, 0x10, 0xa3, 0xa2, 0x07, 0xc8, 0x06, + 0xc6, 0x0c, 0xc6, 0x47, 0xf7, 0x35, 0x20, 0x40, + 0x69, 0x04, 0x3c, 0xba, 0x4b, 0xd3, 0x78, 0xa2, + 0xa4, 0x71, 0xc7, 0x83, 0x2b, 0x69, 0xf9, 0xa2, + 0x8b, 0xf5, 0xa6, 0x87, 0x46, 0xb3, 0x9b, 0x7a, + 0x35, 0x97, 0x0b, 0xf4, 0x68, 0x15, 0x4a, 0x87, + 0xeb, 0x0b, 0x2b, 0xa3, 0xba, 0xcd, 0xb3, 0x28, + 0x80, 0x38, 0x19, 0x17, 0x1f, 0x44, 0x6f, 0x7f, + 0x50, 0x75, 0x93, 0x00, 0x4c, 0x36, 0x07, 0x07, + 0x11, 0xec, 0x91, 0xc4, 0x99, 0x5d, 0xf8, 0xe1, + 0x53, 0x84, 0x01, 0xca, 0x6a, 0x64, 0x8c, 0xef, + 0x17, 0xce, 0x81, 0xf5, 0xce, 0xaa, 0x80, 0xc1, + 0x85, 0xc6, 0x6b, 0xe2, 0xc9, 0x43, 0xc9, 0xf5, + 0xc3, 0x3a, 0xdb, 0xcf, 0xb9, 0x29, 0x64, 0x8d, + 0xe7, 0x98, 0x0f, 0x8b, 0xb0, 0xd2, 0x84, 0x25, + 0x37, 0xd1, 0x80, 0x38, 0x81, 0xb9, 0xe8, 0xb4, + 0xa7, 0xc8, 0x3a, 0x27, 0x77, 0x9b, 0x81, 0xbb, + 0x61, 0xae, 0x59, 0x06, 0x57, 0x40, 0x69, 0x11, + 0xb2, 0x41, 0x68, 0x2d, 0x26, 0x62, 0x93, 0x40, + 0x4d, 0x97, 0x1c, 0xb4, 0x63, 0x65, 0x04, 0xf8, + 0x8c, 0x2a, 0x01, 0xb9, 0x6d, 0x3d, 0x87, 0x30, + 0x28, 0x70, 0x80, 0x1d, 0xb2, 0x24, 0xb0, 0x5c, + 0x90, 0x95, 0xa3, 0x6c, 0xdc, 0xa6, 0x66, 0x15, + 0x33, 0x37, 0x8c, 0xa8, 0x9f, 0x24, 0xa3, 0x52, + 0x21, 0x06, 0xb6, 0xaf, 0x51, 0xc0, 0x1d, 0x42, + 0xa6, 0x55, 0x93, 0x6b, 0x4a, 0x32, 0x4e, 0xec, + 0x46, 0xbe, 0xfa, 0x4a, 0x13, 0x5a, 0xca, 0x11, + 0x39, 0xa1, 0x81, 0x8b, 0xc4, 0x07, 0x1b, 0x43, + 0x1e, 0xa0, 0x5b, 0x34, 0x2d, 0x10, 0x6c, 0xdd, + 0x3b, 0x18, 0x78, 0xe1, 0x0d, 0x5b, 0x61, 0x3d, + 0xfd, 0x51, 0x6a, 0x78, 0x88, 0x2f, 0xa7, 0x84, + 0xa3, 0x4f, 0x30, 0x3e, 0xb0, 0xdc, 0x96, 0xa8, + 0xd7, 0xbb, 0x4c, 0xa6, 0x95, 0xb9, 0x27, 0x3f, + 0x70, 0x46, 0xa3, 0xd8, 0x36, 0x22, 0x3b, 0x4b, + 0x91, 0xa4, 0xe6, 0x31, 0x0d, 0xbb, 0x27, 0x2f, + 0x15, 0x2c, 0xa7, 0x44, 0x19, 0xa9, 0xc1, 0xc8, + 0xb2, 0x77, 0x1a, 0xd5, 0x14, 0x29, 0xa1, 0x76, + 0xcc, 0x81, 0x88, 0x47, 0x3c, 0xd9, 0x9e, 0xba, + 0x99, 0x26, 0xbb, 0xf6, 0x5e, 0xbc, 0x2a, 0x8e, + 0xa0, 0x32, 0x32, 0x2e, 0x24, 0xa1, 0xc3, 0x07, + 0xa5, 0xd4, 0xbb, 0x95, 0x03, 0x29, 0xb5, 0x59, + 0x5a, 0x2b, 0x6c, 0x95, 0x15, 0xba, 0xb0, 0xaf, + 0x27, 0xa2, 0xcb, 0xef, 0x46, 0xb6, 0xb2, 0x25, + 0x21, 0x23, 0xf8, 0x18, 0x1c, 0xb0, 0x54, 0xad, + 0x48, 0x38, 0xf6, 0x33, 0xa2, 0x55, 0xc8, 0x63, + 0xce, 0x56, 0x34, 0x86, 0x6a, 0x61, 0x75, 0x75, + 0x7f, 0x75, 0x49, 0x2a, 0x57, 0x72, 0x76, 0x3e, + 0xa7, 0x08, 0x56, 0x28, 0x0b, 0x44, 0xa9, 0x00, + 0xc2, 0x88, 0x28, 0x02, 0x55, 0x33, 0x55, 0x43, + 0x97, 0x97, 0x42, 0xa4, 0xfe, 0xb1, 0x95, 0xee, + 0x9b, 0x5d, 0xa9, 0x18, 0xc1, 0x90, 0xa5, 0x65, + 0x20, 0x99, 0x39, 0xd2, 0xea, 0x08, 0x1c, 0xda, + 0xa8, 0xfa, 0xa3, 0x3b, 0x56, 0xf0, 0x59, 0x17, + 0x10, 0x0b, 0x45, 0x4a, 0x86, 0x88, 0x96, 0x49, + 0x68, 0x98, 0x26, 0x55, 0x40, 0xb7, 0x5a, 0x29, + 0x82, 0x93, 0xa1, 0x0e, 0x7b, 0x4b, 0xa2, 0x49, + 0x61, 0x2b, 0xaf, 0xb4, 0x2d, 0xa1, 0xdc, 0xae, + 0x79, 0x44, 0x66, 0x20, 0x72, 0xc5, 0x01, 0x36, + 0x10, 0xd8, 0x81, 0x36, 0xb1, 0xea, 0xb1, 0x0d, + 0xc2, 0x05, 0x75, 0xd8, 0xad, 0xe0, 0x73, 0xc6, + 0x82, 0x8c, 0x7e, 0x97, 0x2b, 0x87, 0xb5, 0xc9, + 0x1e, 0xac, 0xb0, 0x2a, 0x16, 0x20, 0x88, 0xb9, + 0x41, 0x2f, 0xc8, 0x4b, 0xce, 0xd8, 0xc4, 0xa8, + 0xe2, 0x68, 0x35, 0xd9, 0xd0, 0xc4, 0x7a, 0xf2, + 0x25, 0xca, 0xb8, 0x06, 0x42, 0xcb, 0xc9, 0x8f, + 0x0a, 0x60, 0xde, 0x19, 0xa8, 0xcb, 0x90, 0x85, + 0x74, 0x42, 0x03, 0x89, 0xf4, 0x97, 0x8e, 0x41, + 0xc5, 0x72, 0xe3, 0x52, 0x55, 0x81, 0x73, 0xe1, + 0x71, 0x22, 0xa2, 0xfb, 0x8a, 0x36, 0xea, 0xb3, + 0xc3, 0x33, 0x4f, 0x23, 0x55, 0x03, 0x1c, 0xa1, + 0x84, 0x74, 0xe1, 0x69, 0x4d, 0xb3, 0xc2, 0x1f, + 0xbc, 0x62, 0xeb, 0xf0, 0x50, 0x45, 0xb7, 0x83, + 0xd3, 0x28, 0x37, 0x46, 0x35, 0x79, 0x04, 0x38, + 0x16, 0xbd, 0x72, 0x2f, 0xbc, 0xf9, 0x7d, 0xb8, + 0x20, 0x12, 0x87, 0xa7, 0xb0, 0x82, 0x7c, 0x3e, + 0x4d, 0xa7, 0x18, 0x04, 0x54, 0x75, 0x19, 0x52, + 0x61, 0x80, 0x57, 0xbe, 0x06, 0x37, 0x9c, 0xde, + 0xb0, 0x93, 0x70, 0x54, 0x3f, 0x15, 0x83, 0xb2, + 0xd3, 0x88, 0xa6, 0xd8, 0x56, 0x9b, 0x91, 0xf3, + 0x00, 0x01, 0x00, 0xcd, 0xcb, 0x97, 0x16, 0x27, + 0xc7, 0xaf, 0xb1, 0xd5, 0xba, 0x90, 0xa1, 0x24, + 0x33, 0x26, 0x95, 0xba, 0xcb, 0x63, 0xa1, 0x56, + 0xb0, 0x23, 0x09, 0x4e, 0xa8, 0x0a, 0x75, 0x02, + 0xd8, 0x3b, 0xc1, 0x05, 0xa0, 0x73, 0x25, 0x26, + 0x3e, 0xb8, 0x5b, 0xca, 0x6a, 0xae, 0x41, 0x22, + 0xc5, 0x9d, 0x88, 0x3f, 0x37, 0x8c, 0x50, 0xcd, + 0x09, 0x32, 0x34, 0x81, 0x98, 0xc1, 0x17, 0xa5, + 0x62, 0x94, 0x8d, 0xcd, 0xd0, 0xc3, 0x08, 0x07, + 0x2f, 0x8d, 0x52, 0x7b, 0xee, 0x81, 0xc5, 0x95, + 0x2c, 0x8b, 0x46, 0x45, 0x5d, 0xf2, 0x62, 0x4d, + 0x2e, 0x22, 0x7f, 0x0d, 0xa5, 0xc8, 0xba, 0x72, + 0xa0, 0x8f, 0xd0, 0x21, 0x45, 0x28, 0xb9, 0xad, + 0xac, 0x96, 0xa6, 0xc7, 0x33, 0x6d, 0xf3, 0x17, + 0xcb, 0x7a, 0x32,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, 0x27, + 0x95, 0x6e, 0x92, 0x1b, 0xaf, 0xe4, 0x9b, 0x5e, + 0x96, 0xec, 0xc7, 0xbf, 0x64, 0x77, 0x75, 0x6d, + 0xda, 0xa8, 0x9c, 0x48, 0xf3, 0x79, 0x80, 0x4e, + 0xed, 0x6f, 0xe0, 0x20, 0x1a, 0x2b, 0x7c, 0xa1, + 0xac, 0x74, 0x42, 0x49, 0xd7, 0xe7, 0x7f, 0x57, + 0x5a, 0xdb, 0x69, 0xb5, 0xe2, 0x7e, 0x81, 0x8d, + 0xa9, 0x22, 0x5c, 0xda, 0xf3, 0xad, 0xbc, 0x3e, + 0x0b, 0xd4, 0x9d, 0x63, 0xef, 0x40, 0x34, 0x66, + 0x80, 0x8c, 0x2d, 0x31, 0x13, 0xdb, 0x31, 0x03, + 0xdf, 0x29, 0x92, 0x4a, 0x81, 0x76, 0x4f, 0x4d, + 0x5a, 0x64, 0x79, 0xf2, 0x8b, 0xc8, 0x3b, 0xc9, + 0xf3, 0x35, 0xc7, 0x18, 0xcb, 0xb1, 0xa8, 0xd2, + 0x24, 0xdb, 0x4d, 0x6a, 0x6a, 0xf1, 0xeb, 0xd2, +}; + +uint8_t mlkem_512_ek[] = { + 0x28, 0x70, 0x80, 0x1d, 0xb2, 0x24, 0xb0, 0x5c, + 0x90, 0x95, 0xa3, 0x6c, 0xdc, 0xa6, 0x66, 0x15, + 0x33, 0x37, 0x8c, 0xa8, 0x9f, 0x24, 0xa3, 0x52, + 0x21, 0x06, 0xb6, 0xaf, 0x51, 0xc0, 0x1d, 0x42, + 0xa6, 0x55, 0x93, 0x6b, 0x4a, 0x32, 0x4e, 0xec, + 0x46, 0xbe, 0xfa, 0x4a, 0x13, 0x5a, 0xca, 0x11, + 0x39, 0xa1, 0x81, 0x8b, 0xc4, 0x07, 0x1b, 0x43, + 0x1e, 0xa0, 0x5b, 0x34, 0x2d, 0x10, 0x6c, 0xdd, + 0x3b, 0x18, 0x78, 0xe1, 0x0d, 0x5b, 0x61, 0x3d, + 0xfd, 0x51, 0x6a, 0x78, 0x88, 0x2f, 0xa7, 0x84, + 0xa3, 0x4f, 0x30, 0x3e, 0xb0, 0xdc, 0x96, 0xa8, + 0xd7, 0xbb, 0x4c, 0xa6, 0x95, 0xb9, 0x27, 0x3f, + 0x70, 0x46, 0xa3, 0xd8, 0x36, 0x22, 0x3b, 0x4b, + 0x91, 0xa4, 0xe6, 0x31, 0x0d, 0xbb, 0x27, 0x2f, + 0x15, 0x2c, 0xa7, 0x44, 0x19, 0xa9, 0xc1, 0xc8, + 0xb2, 0x77, 0x1a, 0xd5, 0x14, 0x29, 0xa1, 0x76, + 0xcc, 0x81, 0x88, 0x47, 0x3c, 0xd9, 0x9e, 0xba, + 0x99, 0x26, 0xbb, 0xf6, 0x5e, 0xbc, 0x2a, 0x8e, + 0xa0, 0x32, 0x32, 0x2e, 0x24, 0xa1, 0xc3, 0x07, + 0xa5, 0xd4, 0xbb, 0x95, 0x03, 0x29, 0xb5, 0x59, + 0x5a, 0x2b, 0x6c, 0x95, 0x15, 0xba, 0xb0, 0xaf, + 0x27, 0xa2, 0xcb, 0xef, 0x46, 0xb6, 0xb2, 0x25, + 0x21, 0x23, 0xf8, 0x18, 0x1c, 0xb0, 0x54, 0xad, + 0x48, 0x38, 0xf6, 0x33, 0xa2, 0x55, 0xc8, 0x63, + 0xce, 0x56, 0x34, 0x86, 0x6a, 0x61, 0x75, 0x75, + 0x7f, 0x75, 0x49, 0x2a, 0x57, 0x72, 0x76, 0x3e, + 0xa7, 0x08, 0x56, 0x28, 0x0b, 0x44, 0xa9, 0x00, + 0xc2, 0x88, 0x28, 0x02, 0x55, 0x33, 0x55, 0x43, + 0x97, 0x97, 0x42, 0xa4, 0xfe, 0xb1, 0x95, 0xee, + 0x9b, 0x5d, 0xa9, 0x18, 0xc1, 0x90, 0xa5, 0x65, + 0x20, 0x99, 0x39, 0xd2, 0xea, 0x08, 0x1c, 0xda, + 0xa8, 0xfa, 0xa3, 0x3b, 0x56, 0xf0, 0x59, 0x17, + 0x10, 0x0b, 0x45, 0x4a, 0x86, 0x88, 0x96, 0x49, + 0x68, 0x98, 0x26, 0x55, 0x40, 0xb7, 0x5a, 0x29, + 0x82, 0x93, 0xa1, 0x0e, 0x7b, 0x4b, 0xa2, 0x49, + 0x61, 0x2b, 0xaf, 0xb4, 0x2d, 0xa1, 0xdc, 0xae, + 0x79, 0x44, 0x66, 0x20, 0x72, 0xc5, 0x01, 0x36, + 0x10, 0xd8, 0x81, 0x36, 0xb1, 0xea, 0xb1, 0x0d, + 0xc2, 0x05, 0x75, 0xd8, 0xad, 0xe0, 0x73, 0xc6, + 0x82, 0x8c, 0x7e, 0x97, 0x2b, 0x87, 0xb5, 0xc9, + 0x1e, 0xac, 0xb0, 0x2a, 0x16, 0x20, 0x88, 0xb9, + 0x41, 0x2f, 0xc8, 0x4b, 0xce, 0xd8, 0xc4, 0xa8, + 0xe2, 0x68, 0x35, 0xd9, 0xd0, 0xc4, 0x7a, 0xf2, + 0x25, 0xca, 0xb8, 0x06, 0x42, 0xcb, 0xc9, 0x8f, + 0x0a, 0x60, 0xde, 0x19, 0xa8, 0xcb, 0x90, 0x85, + 0x74, 0x42, 0x03, 0x89, 0xf4, 0x97, 0x8e, 0x41, + 0xc5, 0x72, 0xe3, 0x52, 0x55, 0x81, 0x73, 0xe1, + 0x71, 0x22, 0xa2, 0xfb, 0x8a, 0x36, 0xea, 0xb3, + 0xc3, 0x33, 0x4f, 0x23, 0x55, 0x03, 0x1c, 0xa1, + 0x84, 0x74, 0xe1, 0x69, 0x4d, 0xb3, 0xc2, 0x1f, + 0xbc, 0x62, 0xeb, 0xf0, 0x50, 0x45, 0xb7, 0x83, + 0xd3, 0x28, 0x37, 0x46, 0x35, 0x79, 0x04, 0x38, + 0x16, 0xbd, 0x72, 0x2f, 0xbc, 0xf9, 0x7d, 0xb8, + 0x20, 0x12, 0x87, 0xa7, 0xb0, 0x82, 0x7c, 0x3e, + 0x4d, 0xa7, 0x18, 0x04, 0x54, 0x75, 0x19, 0x52, + 0x61, 0x80, 0x57, 0xbe, 0x06, 0x37, 0x9c, 0xde, + 0xb0, 0x93, 0x70, 0x54, 0x3f, 0x15, 0x83, 0xb2, + 0xd3, 0x88, 0xa6, 0xd8, 0x56, 0x9b, 0x91, 0xf3, + 0x00, 0x01, 0x00, 0xcd, 0xcb, 0x97, 0x16, 0x27, + 0xc7, 0xaf, 0xb1, 0xd5, 0xba, 0x90, 0xa1, 0x24, + 0x33, 0x26, 0x95, 0xba, 0xcb, 0x63, 0xa1, 0x56, + 0xb0, 0x23, 0x09, 0x4e, 0xa8, 0x0a, 0x75, 0x02, + 0xd8, 0x3b, 0xc1, 0x05, 0xa0, 0x73, 0x25, 0x26, + 0x3e, 0xb8, 0x5b, 0xca, 0x6a, 0xae, 0x41, 0x22, + 0xc5, 0x9d, 0x88, 0x3f, 0x37, 0x8c, 0x50, 0xcd, + 0x09, 0x32, 0x34, 0x81, 0x98, 0xc1, 0x17, 0xa5, + 0x62, 0x94, 0x8d, 0xcd, 0xd0, 0xc3, 0x08, 0x07, + 0x2f, 0x8d, 0x52, 0x7b, 0xee, 0x81, 0xc5, 0x95, + 0x2c, 0x8b, 0x46, 0x45, 0x5d, 0xf2, 0x62, 0x4d, + 0x2e, 0x22, 0x7f, 0x0d, 0xa5, 0xc8, 0xba, 0x72, + 0xa0, 0x8f, 0xd0, 0x21, 0x45, 0x28, 0xb9, 0xad, + 0xac, 0x96, 0xa6, 0xc7, 0x33, 0x6d, 0xf3, 0x17, + 0xcb, 0x7a, 0x32, 0x4e, 0x4c, 0x83, 0xa7, 0x15, + 0x55, 0x6a, 0xca, 0xc1, 0xff, 0xd8, 0x90, 0xab, + 0xaa, 0xa4, 0x65, 0xb0, 0x25, 0xf7, 0x47, 0x00, + 0x2d, 0x20, 0x19, 0x23, 0xb5, 0x02, 0x39, 0x5a, + 0x69, 0x1c, 0xc4, 0xbc, 0xa3, 0x80, 0xcc, 0x82, + 0xd8, 0x66, 0x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 0x7f, 0x57, +}; + +uint8_t mlkem_512_message[] = { + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, + 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x4d, 0x4c, 0x2d, + 0x4b, 0x45, 0x4d, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x20, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, + 0x2e +}; + +uint8_t mlkem_512_cipher[] = { + 0x92, 0x98, 0x11, 0x65, 0x10, 0x78, 0xE3, 0xA4, + 0x34, 0x94, 0xD1, 0x22, 0x56, 0xD6, 0xB1, 0xF6, + 0xF7, 0x51, 0x2A, 0xCA, 0x8E, 0x04, 0x1D, 0x89, + 0xBB, 0xA7, 0x84, 0xEF, 0xAA, 0x70, 0x11, 0x75, + 0xFC, 0x48, 0xA1, 0x7E, 0x4C, 0x99, 0xBD, 0xB8, + 0x05, 0x01, 0xA6, 0xF0, 0x0E, 0x18, 0x0D, 0x75, + 0xF0, 0xBB, 0xBD, 0x6F, 0x28, 0xF4, 0xDC, 0x3A, + 0x58, 0x3D, 0x83, 0x1D, 0x78, 0xF9, 0x0E, 0x06, + 0x5C, 0x0B, 0x77, 0x4C, 0x28, 0x82, 0xE1, 0xA4, + 0x77, 0xAD, 0x14, 0x71, 0x3D, 0x5D, 0x53, 0x41, + 0xCE, 0x4F, 0x36, 0x32, 0x24, 0xD7, 0x09, 0xF0, + 0xB8, 0xF2, 0x95, 0x68, 0x84, 0x5C, 0x62, 0xC3, + 0x77, 0x9A, 0x74, 0xD3, 0x29, 0xC1, 0x88, 0x8B, + 0xBF, 0x05, 0x73, 0x43, 0x30, 0x20, 0xB4, 0xB0, + 0xB3, 0xE1, 0xB5, 0x91, 0xA8, 0xBD, 0x4B, 0x7F, + 0x2E, 0x53, 0x20, 0x55, 0xDE, 0x4D, 0xDB, 0x91, + 0x73, 0xF9, 0x2F, 0x21, 0xF6, 0xAE, 0x6D, 0xEE, + 0x67, 0x37, 0x82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09, 0xDF, 0x2B, 0x99, 0x08, 0x7A, 0x4C, + 0xD9, 0xC8, 0x3B, 0x54, 0xF0, 0x34, 0x07, 0x19, + 0xC5, 0x4A, 0x34, 0xBF, 0xB8, 0x31, 0xBF, 0x1C, + 0x6F, 0x5C, 0x07, 0x37, 0x76, 0xD9, 0xBD, 0x3B, + 0xB6, 0xB6, 0x8D, 0x6A, 0x1A, 0xE6, 0xE9, 0xCB, + 0x4D, 0xC3, 0xDC, 0x76, 0x91, 0xE7, 0x6F, 0x11, + 0x66, 0xF7, 0x76, 0xB3, 0x40, 0xAA, 0x51, 0x09, + 0x7C, 0xFE, 0xA2, 0x37, 0xBF, 0xC3, 0x92, 0xFA, + 0x75, 0x44, 0x76, 0xC7, 0x54, 0xC8, 0x91, 0x89, + 0x65, 0x84, 0x03, 0x3E, 0x46, 0x92, 0x1E, 0x67, + 0x8D, 0x8F, 0x52, 0x0D, 0x06, 0x22, 0x18, 0xFC, + 0x0B, 0x92, 0xCD, 0x94, 0xC2, 0x0A, 0x3F, 0x41, +}; + +uint8_t mlkem_512_sk[] = { + 0x26, 0xCD, 0x28, 0x15, 0xEB, 0x3E, 0x16, 0x56, + 0x84, 0x2D, 0x15, 0xAC, 0x32, 0x33, 0xDA, 0x01, + 0x71, 0x21, 0x82, 0x1B, 0xC7, 0xE3, 0x44, 0xF9, + 0x5E, 0x7A, 0xB9, 0x3A, 0x40, 0xAD, 0x38, 0x6A +}; + struct cperf_rsa_test_data rsa_qt_perf_data[4] = { { @@ -3822,6 +4246,52 @@ cperf_rsa_test_data rsa_pub_perf_data[4] = { } }; +struct cperf_mlkem_test_data mlkem_encap_perf_data[] = { + { + .name = "mlkem_512_encap (deterministic)", + .type = RTE_CRYPTO_ML_KEM_512, + .dk = { + .data = mlkem_512_dk, + .length = sizeof(mlkem_512_dk), + }, + .ek = { + .data = mlkem_512_ek, + .length = sizeof(mlkem_512_ek), + }, + .message = { + .data = mlkem_512_message, + .length = 32, + }, + .cipher = { + .data = mlkem_512_cipher, + .length = sizeof(mlkem_512_cipher), + }, + .sk = { + .data = mlkem_512_sk, + .length = sizeof(mlkem_512_sk), + }, + }, +}; + +struct cperf_mlkem_test_data mlkem_decap_perf_data[] = { + { + .name = "mlkem_512_decap", + .type = RTE_CRYPTO_ML_KEM_512, + .cipher = { + .data = mlkem_512_cipher, + .length = sizeof(mlkem_512_cipher), + }, + .dk = { + .data = mlkem_512_dk, + .length = sizeof(mlkem_512_dk), + }, + .sk = { + .data = mlkem_512_sk, + .length = sizeof(mlkem_512_sk), + }, + } +}; + 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 d6f18268c4..e498196ae3 100644 --- a/app/test-crypto-perf/cperf_test_vectors.h +++ b/app/test-crypto-perf/cperf_test_vectors.h @@ -107,6 +107,31 @@ struct cperf_modex_test_data { } result; }; +struct cperf_mlkem_test_data { + const char *name; + enum rte_crypto_ml_kem_type type; + struct { + uint8_t *data; + uint32_t length; + } dk; + struct { + uint8_t *data; + uint32_t length; + } ek; + struct { + uint8_t *data; + uint32_t length; + } message; + struct { + uint8_t *data; + uint32_t length; + } cipher; + struct { + uint8_t *data; + uint32_t length; + } sk; +}; + #define TEST_DATA_SIZE 4096 struct cperf_rsa_plaintext { uint8_t data[TEST_DATA_SIZE]; @@ -188,5 +213,7 @@ extern struct cperf_rsa_test_data rsa_pub_perf_data[4]; extern struct cperf_rsa_test_data rsa_exp_perf_data[4]; extern struct cperf_rsa_test_data rsa_qt_perf_data[4]; extern struct cperf_rsa_plaintext rsa_plaintext; +extern struct cperf_mlkem_test_data mlkem_encap_perf_data[]; +extern struct cperf_mlkem_test_data mlkem_decap_perf_data[]; #endif diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index f63e892413..2e228201ab 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -53,7 +53,8 @@ const char *cperf_op_type_strs[] = { [CPERF_ASYM_SECP521R1] = "ecdsa_p521r1", [CPERF_ASYM_ED25519] = "eddsa_25519", [CPERF_ASYM_SM2] = "sm2", - [CPERF_TLS] = "tls-record" + [CPERF_TLS] = "tls-record", + [CPERF_ASYM_MLKEM512] = "mlkem_512", }; const char *cperf_rsa_priv_keytype_strs[] = { @@ -245,6 +246,7 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs) case CPERF_ASYM_ED25519: case CPERF_ASYM_SM2: case CPERF_ASYM_RSA: + case CPERF_ASYM_MLKEM512: case CPERF_ASYM_MODEX: conf.ff_disable |= (RTE_CRYPTODEV_FF_SECURITY | RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO); @@ -515,6 +517,23 @@ cperf_verify_devices_capabilities(struct cperf_options *opts, } } + if (opts->op_type == CPERF_ASYM_MLKEM512) { + asym_cap_idx.type = RTE_CRYPTO_ASYM_XFORM_ML_KEM; + asym_capability = rte_cryptodev_asym_capability_get(cdev_id, &asym_cap_idx); + if (asym_capability == NULL) + return -1; + + if (opts->asym_op_type == RTE_CRYPTO_ASYM_OP_ENCRYPT) + opts->mlkem_data = &mlkem_encap_perf_data[0]; + else if (opts->asym_op_type == RTE_CRYPTO_ASYM_OP_DECRYPT) + opts->mlkem_data = &mlkem_decap_perf_data[0]; + else { + RTE_LOG(ERR, USER1, "Unsupported MLKEM operation type\n"); + return -ENOTSUP; + } + + } + if (opts->op_type == CPERF_AUTH_ONLY || opts->op_type == CPERF_CIPHER_THEN_AUTH || opts->op_type == CPERF_AUTH_THEN_CIPHER) { -- 2.43.0