From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 95F6D42B83; Tue, 23 May 2023 21:51:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF66742BDA; Tue, 23 May 2023 21:50:39 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id F1ADE42D17 for ; Tue, 23 May 2023 21:50:37 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34NHuJiM012380; Tue, 23 May 2023 12:50:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=JBrCM8bi63VdkFacPYgUsVuxWIeVogRbOj71/z6C1Vc=; b=e1qYo5B1HROltu/u9Lej3gVtjD+Nmq0btEnp/AShQIuVdiSu0y9b8S9fxK6vdRPCxcxi tN1WSScBB6vtbRvIT2ERdsz7eKYP5dFhtzSVT5dQGA2rmhPK6RhaeRIrBd624wUuZSNr 5Au/bmw/UkwW8scd5N70SlgSImOw138ZLJnq+C1WVmyckvCiivHmLo6sEUiroilluRSJ XXLVQUb98gBNjfxeyitCuonemPOsu4ZYNmqZ6pyT+Jm+x7GLs9L7BGnrm7xxadgCck0E ep8aWlxWeR1dMIJKs3AucWUAMdxGytdYZcv6+zuP6OPeYhWU++GUMzn4kDTPRmjSnH9B yg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3qpwqk30ya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 23 May 2023 12:50:35 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 23 May 2023 12:50:33 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 23 May 2023 12:50:33 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id CF8825B6927; Tue, 23 May 2023 12:50:29 -0700 (PDT) From: Akhil Goyal To: , Akhil Goyal CC: , , , , , , , , Subject: [PATCH 12/13] test/security: verify MACsec anti replay Date: Wed, 24 May 2023 01:19:17 +0530 Message-ID: <20230523194918.1940212-13-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230523194918.1940212-1-gakhil@marvell.com> References: <20220928124516.93050-5-gakhil@marvell.com> <20230523194918.1940212-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: -XjOUj-oT7c00HNvg-zosBdS7LPhMc0_ X-Proofpoint-GUID: -XjOUj-oT7c00HNvg-zosBdS7LPhMc0_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_12,2023-05-23_02,2023-05-22_02 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: Ankur Dwivedi This patch enables anti replay test case for MACsec. Signed-off-by: Ankur Dwivedi Signed-off-by: Akhil Goyal --- app/test/test_security_inline_macsec.c | 82 +++ .../test_security_inline_macsec_vectors.h | 467 ++++++++++++++++++ 2 files changed, 549 insertions(+) diff --git a/app/test/test_security_inline_macsec.c b/app/test/test_security_inline_macsec.c index 6f9cec333d..de67744f78 100644 --- a/app/test/test_security_inline_macsec.c +++ b/app/test/test_security_inline_macsec.c @@ -61,6 +61,7 @@ struct mcs_test_opts { uint8_t replay_protect; uint8_t rekey_en; const struct mcs_test_vector *rekey_td; + const struct mcs_test_vector *ar_td[3]; bool dump_all_stats; uint8_t check_untagged_rx; uint8_t check_bad_tag_cnt; @@ -716,6 +717,15 @@ mcs_stats_check(struct rte_security_ctx *ctx, enum mcs_op op, if (opts->check_pkts_unchecked_stats && sc_stat.pkt_unchecked_cnt != 1) return TEST_FAILED; + if (opts->replay_protect) { + if (opts->replay_win_sz == 0 && + sc_stat.pkt_late_cnt != 2) + return TEST_FAILED; + else if (opts->replay_win_sz == 32 && + sc_stat.pkt_late_cnt != 1) + return TEST_FAILED; + } + for (i = 0; i < RTE_SECURITY_MACSEC_NUM_AN; i++) { memset(&sa_stat, 0, sizeof(struct rte_security_macsec_sa_stats)); rte_security_macsec_sa_stats_get(ctx, rx_sa_id[i], @@ -845,6 +855,7 @@ test_macsec(const struct mcs_test_vector *td[], enum mcs_op op, const struct mcs int nb_rx = 0, nb_sent; int i, j = 0, ret, id, an = 0; uint8_t tci_off; + int k; memset(rx_pkts_burst, 0, sizeof(rx_pkts_burst[0]) * opts->nb_td); @@ -875,6 +886,20 @@ test_macsec(const struct mcs_test_vector *td[], enum mcs_op op, const struct mcs } j++; + if (opts->replay_protect) { + for (k = 0; k < 3; k++, j++) { + tx_pkts_burst[j] = init_packet(mbufpool, + opts->ar_td[k]->secure_pkt.data, + opts->ar_td[k]->secure_pkt.len); + if (tx_pkts_burst[j] == NULL) { + while (j--) + rte_pktmbuf_free(tx_pkts_burst[j]); + ret = TEST_FAILED; + goto out; + } + } + } + if (opts->rekey_en) { err_vector.td = td[i]; @@ -1068,6 +1093,15 @@ test_macsec(const struct mcs_test_vector *td[], enum mcs_op op, const struct mcs } } + if (opts->replay_protect) { + for (i = 0; i < nb_rx; i++) { + rte_pktmbuf_free(rx_pkts_burst[i]); + rx_pkts_burst[i] = NULL; + } + ret = TEST_SUCCESS; + goto out; + } + for (i = 0; i < nb_rx; i++) { if (opts->rekey_en && i == 1) { /* The second received packet is matched with @@ -1995,6 +2029,50 @@ test_inline_macsec_rekey_rx(const void *data __rte_unused) return all_err; } +static int +test_inline_macsec_anti_replay(const void *data __rte_unused) +{ + const struct mcs_test_vector *cur_td; + struct mcs_test_opts opts = {0}; + uint16_t replay_win_sz[2] = {32, 0}; + int err, all_err = 0; + int i, size; + int j; + + opts.val_frames = RTE_SECURITY_MACSEC_VALIDATE_STRICT; + opts.sa_in_use = 1; + opts.nb_td = 1; + opts.sectag_insert_mode = 1; + opts.replay_protect = 1; + + size = (sizeof(list_mcs_anti_replay_vectors) / sizeof((list_mcs_anti_replay_vectors)[0])); + + for (j = 0; j < 2; j++) { + opts.replay_win_sz = replay_win_sz[j]; + + for (i = 0; i < size; i++) { + cur_td = &list_mcs_anti_replay_vectors[i]; + opts.ar_td[0] = &list_mcs_anti_replay_vectors[++i]; + opts.ar_td[1] = &list_mcs_anti_replay_vectors[++i]; + opts.ar_td[2] = &list_mcs_anti_replay_vectors[++i]; + err = test_macsec(&cur_td, MCS_DECAP, &opts); + if (err) { + printf("Replay window: %u, Anti replay test case %d failed\n", + opts.replay_win_sz, i); + err = -1; + } else { + printf("Replay window: %u, Anti replay test case %d passed\n", + opts.replay_win_sz, i); + err = 0; + } + all_err += err; + } + } + + printf("\n%s: Success: %d, Failure: %d\n", __func__, size + all_err, -all_err); + return all_err; +} + static int ut_setup_inline_macsec(void) { @@ -2232,6 +2310,10 @@ static struct unit_test_suite inline_macsec_testsuite = { "MACsec re-key Rx", ut_setup_inline_macsec, ut_teardown_inline_macsec, test_inline_macsec_rekey_rx), + TEST_CASE_NAMED_ST( + "MACsec anti-replay", + ut_setup_inline_macsec, ut_teardown_inline_macsec, + test_inline_macsec_anti_replay), TEST_CASES_END() /**< NULL terminate unit test array */ }, diff --git a/app/test/test_security_inline_macsec_vectors.h b/app/test/test_security_inline_macsec_vectors.h index 80425b0b71..ddaa8043e7 100644 --- a/app/test/test_security_inline_macsec_vectors.h +++ b/app/test/test_security_inline_macsec_vectors.h @@ -3425,4 +3425,471 @@ static const struct mcs_test_vector list_mcs_rekey_vectors[] = { }, }; +static const struct mcs_test_vector list_mcs_anti_replay_vectors[] = { +{ + .test_idx = 0, + .alg = RTE_SECURITY_MACSEC_ALG_GCM_128, + .ssci = 0x0, + .salt = {0}, + .sa_key = { + .data = { + 0x07, 0x1B, 0x11, 0x3B, 0x0C, 0xA7, 0x43, 0xFE, + 0xCC, 0xCF, 0x3D, 0x05, 0x1F, 0x73, 0x73, 0x82 + }, + .len = 16, + }, + .plain_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* User Data */ + 0x08, 0x00, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, + 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, + 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, + 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, + 0x43, 0x44, 0x45, 0x46, + }, + .len = 64, + }, + .secure_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* MACsec EtherType */ + 0x88, 0xE5, + /* TCI and AN */ + 0x2C, + /* SL */ + 0x0, + /* PN */ + 0x0, 0x0, 0x0, 0x2, + /* SCI */ + 0xFE, 0x2F, 0xCD, 0x14, 0x24, 0x1B, 0x88, 0x2C, + /* Secure Data */ + 0x39, 0x38, 0x97, 0x44, 0xA2, 0x6D, 0x71, 0x3D, + 0x14, 0x27, 0xC7, 0x3E, 0x02, 0x96, 0x81, 0xAD, + 0x47, 0x82, 0x2A, 0xCF, 0x19, 0x79, 0x12, 0x49, + 0x0F, 0x93, 0x5A, 0x32, 0x43, 0x79, 0xEF, 0x9D, + 0x70, 0xF8, 0xA9, 0xBE, 0x3D, 0x00, 0x5D, 0x22, + 0xDA, 0x87, 0x3D, 0xC1, 0xBE, 0x1B, 0x13, 0xD9, + 0x99, 0xDB, 0xF1, 0xC8, + /* ICV */ + 0x4B, 0xC4, 0xF8, 0xC6, 0x09, 0x78, 0xB9, 0xBB, + 0x5D, 0xC0, 0x04, 0xF3, 0x20, 0x7D, 0x14, 0x87, + }, + .len = 96, + }, +}, +{ + .test_idx = 1, + .alg = RTE_SECURITY_MACSEC_ALG_GCM_128, + .ssci = 0x0, + .salt = {0}, + .sa_key = { + .data = { + 0x07, 0x1B, 0x11, 0x3B, 0x0C, 0xA7, 0x43, 0xFE, + 0xCC, 0xCF, 0x3D, 0x05, 0x1F, 0x73, 0x73, 0x82 + }, + .len = 16, + }, + .plain_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* User Data */ + 0x08, 0x00, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, + 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, + 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, + 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, + 0x43, 0x44, 0x45, 0x46, + }, + .len = 64, + }, + .secure_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* MACsec EtherType */ + 0x88, 0xE5, + /* TCI and AN */ + 0x2C, + /* SL */ + 0x0, + /* PN */ + 0x0, 0x0, 0x0, 0x4B, + /* SCI */ + 0xFE, 0x2F, 0xCD, 0x14, 0x24, 0x1B, 0x88, 0x2C, + /* Secure Data */ + 0x51, 0xC9, 0xBB, 0xF3, 0x24, 0x38, 0xF9, 0x06, + 0x76, 0x9E, 0x61, 0xCE, 0xB8, 0x65, 0xA7, 0xE4, + 0x1F, 0x16, 0x5D, 0x59, 0xB8, 0x44, 0x0F, 0x94, + 0x50, 0xF0, 0x4C, 0x35, 0x7D, 0x91, 0x53, 0xC6, + 0x28, 0x4D, 0xA8, 0xAB, 0x13, 0x3B, 0xC0, 0x2D, + 0x11, 0x8E, 0xCC, 0x75, 0xC9, 0xD8, 0x8F, 0x60, + 0x67, 0xE1, 0x03, 0x2C, + /* ICV */ + 0xA5, 0xF1, 0x2C, 0x85, 0x10, 0xEE, 0x67, 0x7E, + 0xDB, 0x4E, 0xF6, 0x0A, 0xA1, 0x0F, 0x15, 0x69, + }, + .len = 96, + }, +}, +{ + .test_idx = 2, + .alg = RTE_SECURITY_MACSEC_ALG_GCM_128, + .ssci = 0x0, + .salt = {0}, + .sa_key = { + .data = { + 0x07, 0x1B, 0x11, 0x3B, 0x0C, 0xA7, 0x43, 0xFE, + 0xCC, 0xCF, 0x3D, 0x05, 0x1F, 0x73, 0x73, 0x82 + }, + .len = 16, + }, + .plain_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* User Data */ + 0x08, 0x00, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, + 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, + 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, + 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, + 0x43, 0x44, 0x45, 0x46, + }, + .len = 64, + }, + .secure_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* MACsec EtherType */ + 0x88, 0xE5, + /* TCI and AN */ + 0x2C, + /* SL */ + 0x0, + /* PN */ + 0x0, 0x0, 0x0, 0x32, + /* SCI */ + 0xFE, 0x2F, 0xCD, 0x14, 0x24, 0x1B, 0x88, 0x2C, + /* Secure Data */ + 0x6F, 0xB6, 0xF8, 0x54, 0x67, 0x23, 0x3C, 0xE8, + 0x67, 0x54, 0x8B, 0xAD, 0x31, 0xC3, 0x2B, 0xAA, + 0x70, 0x1A, 0xC8, 0x0D, 0x3C, 0x31, 0x54, 0x0F, + 0xDD, 0x8F, 0x23, 0x0F, 0x86, 0xF3, 0x80, 0x31, + 0x8B, 0x30, 0xD9, 0x15, 0xF9, 0x3B, 0xD6, 0x00, + 0x95, 0xBD, 0xF3, 0x7F, 0xD2, 0x41, 0x28, 0xFC, + 0x52, 0x27, 0xB5, 0x88, + /* ICV */ + 0x64, 0x3C, 0x67, 0xD7, 0xB8, 0xC1, 0xAF, 0x15, + 0x82, 0x5F, 0x06, 0x4F, 0x5A, 0xED, 0x47, 0xC1, + }, + .len = 96, + }, +}, +{ + .test_idx = 3, + .alg = RTE_SECURITY_MACSEC_ALG_GCM_128, + .ssci = 0x0, + .salt = {0}, + .sa_key = { + .data = { + 0x07, 0x1B, 0x11, 0x3B, 0x0C, 0xA7, 0x43, 0xFE, + 0xCC, 0xCF, 0x3D, 0x05, 0x1F, 0x73, 0x73, 0x82 + }, + .len = 16, + }, + .plain_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* User Data */ + 0x08, 0x00, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, + 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, + 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, + 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, + 0x43, 0x44, 0x45, 0x46, + }, + .len = 64, + }, + .secure_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* MACsec EtherType */ + 0x88, 0xE5, + /* TCI and AN */ + 0x2C, + /* SL */ + 0x0, + /* PN */ + 0x0, 0x0, 0x0, 0x3, + /* SCI */ + 0xFE, 0x2F, 0xCD, 0x14, 0x24, 0x1B, 0x88, 0x2C, + /* Secure Data */ + 0x16, 0x6E, 0x74, 0xE5, 0xF7, 0x49, 0xCC, 0x42, + 0x06, 0x30, 0x99, 0x60, 0x10, 0xAA, 0xB3, 0xEC, + 0x3C, 0xEF, 0x6C, 0x7D, 0x72, 0x93, 0x61, 0x28, + 0x39, 0x8E, 0x6B, 0x5C, 0x6C, 0x9E, 0xCA, 0x86, + 0x70, 0x5A, 0x95, 0x98, 0x0F, 0xB2, 0xC8, 0x05, + 0xD6, 0xC9, 0xBA, 0x9A, 0xCF, 0x7B, 0x5F, 0xD0, + 0xAE, 0x50, 0x66, 0x7D, + /* ICV */ + 0xC8, 0xF1, 0x4A, 0x10, 0x8A, 0xFF, 0x64, 0x6C, + 0xC7, 0x18, 0xC2, 0x7A, 0x16, 0x1A, 0x0D, 0xCA, + }, + .len = 96, + }, +}, +{ + .test_idx = 4, + .alg = RTE_SECURITY_MACSEC_ALG_GCM_XPN_128, + .ssci = 0x7A30C118, + .xpn = 0x0, /* Most significant 32 bits */ + .salt = { + 0xE6, 0x30, 0xE8, 0x1A, 0x48, 0xDE, + 0x86, 0xA2, 0x1C, 0x66, 0xFA, 0x6D, + }, + .sa_key = { + .data = { + 0x07, 0x1B, 0x11, 0x3B, 0x0C, 0xA7, 0x43, 0xFE, + 0xCC, 0xCF, 0x3D, 0x05, 0x1F, 0x73, 0x73, 0x82, + }, + .len = 16, + }, + .plain_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* User Data */ + 0x08, 0x00, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, + 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, + 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, + 0x00, 0x04, + }, + .len = 54, + }, + .secure_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* MACsec EtherType */ + 0x88, 0xE5, + /* TCI and AN */ + 0x4C, + /* SL */ + 0x2A, + /* PN */ + 0xFF, 0xFF, 0xFF, 0xFE, + /* Secure Data */ + 0xA4, 0x80, 0xA4, 0x24, 0xD3, 0xCB, 0x3B, 0x05, + 0xD5, 0x5B, 0x48, 0xE0, 0x23, 0xEA, 0x8C, 0x11, + 0xE2, 0xB6, 0xE9, 0x69, 0x39, 0x40, 0xA6, 0xEA, + 0xC9, 0xCD, 0xF9, 0xD8, 0x85, 0x8C, 0xD6, 0xFA, + 0xB6, 0x9A, 0xE2, 0x37, 0xAA, 0x0C, 0x02, 0x2C, + 0xB8, 0xC1, + /* ICV */ + 0xE3, 0x36, 0x34, 0x7A, 0x7C, 0x00, 0x71, 0x1F, + 0xAC, 0x04, 0x48, 0x82, 0x64, 0xD2, 0xDF, 0x58, + }, + .len = 78, + }, +}, +{ + .test_idx = 5, + .alg = RTE_SECURITY_MACSEC_ALG_GCM_XPN_128, + .ssci = 0x7A30C118, + .xpn = 0x1, /* Most significant 32 bits */ + .salt = { + 0xE6, 0x30, 0xE8, 0x1A, 0x48, 0xDE, + 0x86, 0xA2, 0x1C, 0x66, 0xFA, 0x6D, + }, + .sa_key = { + .data = { + 0x07, 0x1B, 0x11, 0x3B, 0x0C, 0xA7, 0x43, 0xFE, + 0xCC, 0xCF, 0x3D, 0x05, 0x1F, 0x73, 0x73, 0x82, + }, + .len = 16, + }, + .plain_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* User Data */ + 0x08, 0x00, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, + 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, + 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, + 0x00, 0x04, + }, + .len = 54, + }, + .secure_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* MACsec EtherType */ + 0x88, 0xE5, + /* TCI and AN */ + 0x4C, + /* SL */ + 0x2A, + /* PN */ + 0x00, 0x00, 0x00, 0x62, + /* Secure Data */ + 0x62, 0x62, 0x9E, 0x43, 0x59, 0x0C, 0xC6, 0x33, + 0x26, 0x3C, 0xBF, 0x93, 0x5D, 0xE2, 0x8A, 0x7F, + 0x96, 0xB4, 0xF7, 0x08, 0xEA, 0x9A, 0xA8, 0x88, + 0xB4, 0xE8, 0xBE, 0x8D, 0x28, 0x84, 0xE0, 0x16, + 0x08, 0x92, 0xB0, 0xAB, 0x76, 0x60, 0xEA, 0x05, + 0x74, 0x79, + /* ICV */ + 0x8E, 0x5D, 0x81, 0xA6, 0x3F, 0xDF, 0x39, 0xB8, + 0x19, 0x33, 0x73, 0x09, 0xCE, 0xC1, 0xAF, 0x85, + }, + .len = 78, + }, +}, +{ + .test_idx = 6, + .alg = RTE_SECURITY_MACSEC_ALG_GCM_XPN_128, + .ssci = 0x7A30C118, + .xpn = 0x1, /* Most significant 32 bits */ + .salt = { + 0xE6, 0x30, 0xE8, 0x1A, 0x48, 0xDE, + 0x86, 0xA2, 0x1C, 0x66, 0xFA, 0x6D, + }, + .sa_key = { + .data = { + 0x07, 0x1B, 0x11, 0x3B, 0x0C, 0xA7, 0x43, 0xFE, + 0xCC, 0xCF, 0x3D, 0x05, 0x1F, 0x73, 0x73, 0x82, + }, + .len = 16, + }, + .plain_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* User Data */ + 0x08, 0x00, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, + 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, + 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, + 0x00, 0x04, + }, + .len = 54, + }, + .secure_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* MACsec EtherType */ + 0x88, 0xE5, + /* TCI and AN */ + 0x4C, + /* SL */ + 0x2A, + /* PN */ + 0x00, 0x00, 0x00, 0x58, + /* Secure Data */ + 0xC7, 0xDC, 0xF4, 0xC9, 0x8C, 0x59, 0x6E, 0x96, + 0x3D, 0x4B, 0x89, 0xB3, 0xF3, 0x8D, 0x5D, 0x99, + 0x4E, 0xDF, 0x48, 0x74, 0x02, 0x25, 0x93, 0xB4, + 0x12, 0xFB, 0x0F, 0x28, 0xA5, 0x02, 0x78, 0xAC, + 0x0B, 0x14, 0xF1, 0xAC, 0x1C, 0x0C, 0x80, 0x37, + 0x6B, 0x44, + /* ICV */ + 0x47, 0x5A, 0xEE, 0x37, 0xFC, 0x6E, 0xDE, 0xB9, + 0x14, 0x0E, 0xBD, 0x22, 0x05, 0x12, 0x00, 0x52, + }, + .len = 78, + }, +}, +{ + .test_idx = 7, + .alg = RTE_SECURITY_MACSEC_ALG_GCM_XPN_128, + .ssci = 0x7A30C118, + .xpn = 0x1, /* Most significant 32 bits */ + .salt = { + 0xE6, 0x30, 0xE8, 0x1A, 0x48, 0xDE, + 0x86, 0xA2, 0x1C, 0x66, 0xFA, 0x6D, + }, + .sa_key = { + .data = { + 0x07, 0x1B, 0x11, 0x3B, 0x0C, 0xA7, 0x43, 0xFE, + 0xCC, 0xCF, 0x3D, 0x05, 0x1F, 0x73, 0x73, 0x82, + }, + .len = 16, + }, + .plain_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* User Data */ + 0x08, 0x00, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, + 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, + 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, + 0x00, 0x04, + }, + .len = 54, + }, + .secure_pkt = { + .data = {/* MAC DA */ + 0xE2, 0x01, 0x06, 0xD7, 0xCD, 0x0D, + /* MAC SA */ + 0xF0, 0x76, 0x1E, 0x8D, 0xCD, 0x3D, + /* MACsec EtherType */ + 0x88, 0xE5, + /* TCI and AN */ + 0x4C, + /* SL */ + 0x2A, + /* PN */ + 0x00, 0x00, 0x00, 0x02, + /* Secure Data */ + 0xDD, 0x86, 0x37, 0x48, 0x11, 0xF3, 0xA8, 0x96, + 0x25, 0x3A, 0xD9, 0xBE, 0x7C, 0x62, 0x72, 0xD6, + 0x43, 0x70, 0xB6, 0x92, 0x04, 0x25, 0x46, 0xC1, + 0x17, 0xBC, 0x14, 0xE1, 0x09, 0x4C, 0x04, 0x94, + 0x51, 0x1F, 0x6E, 0x89, 0x32, 0x13, 0x4B, 0xAC, + 0x2A, 0x60, + /* ICV */ + 0x96, 0xC0, 0xB4, 0xA4, 0xC7, 0xEC, 0xF5, 0xEF, + 0x5E, 0x51, 0x22, 0x14, 0xF8, 0x70, 0xA0, 0x22, + }, + .len = 78, + }, +}, +}; + #endif -- 2.25.1