From patchwork Thu Sep 3 16:06:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 76451 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 899CBA04BF; Thu, 3 Sep 2020 18:07:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B396C1C0D9; Thu, 3 Sep 2020 18:07:05 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 3DF6C1C0CA for ; Thu, 3 Sep 2020 18:07:03 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0AA981A0CAB; Thu, 3 Sep 2020 18:07:03 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 99F761A0C4C; Thu, 3 Sep 2020 18:06:59 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id AB3BD402D7; Thu, 3 Sep 2020 18:06:55 +0200 (CEST) From: akhil.goyal@nxp.com To: dev@dpdk.org Cc: hemant.agrawal@nxp.com, anoobj@marvell.com, declan.doherty@intel.com, david.coyle@intel.com, Franck LENORMAND , Akhil Goyal Date: Thu, 3 Sep 2020 21:36:46 +0530 Message-Id: <20200903160652.31654-2-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903160652.31654-1-akhil.goyal@nxp.com> References: <20200903160652.31654-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/7] common/dpaax/caamflib: Support PDCP-SDAP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Franck LENORMAND The SDAP is a protocol in the LTE stack on top of PDCP. It is dedicated to QoS. The difficulty of implementing this protocol is because the PDCP change behavior regarding encryption and authentication of the SDU it receives. In effect PDCP shall not encrypt the SDAP SDU but must authenticate it (when encryption and authentication is enabled). The current version of SEC does not support the SDAP and the change of behavior of PDCP prevent the use of the PDCP protocol command available. The way to do it is to reuse the PDCP implementation but to not use the PDCP protocol and to have descriptors which performs the PDCP protocol. It is configured by: It is implemented done doing small changes of code: #ifdef SDAP_SUPPORT length += SDAP_BYTE_SIZE; offset -= SDAP_BYTE_SIZE; #endif after having computed the size of the SN to read from the input data, then #ifdef SDAP_SUPPORT MATHI(p, MATH0, LSHIFT, 8, MATH1, 8, 0); MATHB(p, MATH1, AND, sn_mask, MATH1, 8, IFB | IMMED2); #else MATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2); #endif It will keep the SN and the SDAP header in MATH0, then shift it to remove the SDAP header and store the result in MATH1. Signed-off-by: Franck LENORMAND Signed-off-by: Akhil Goyal --- drivers/common/dpaax/caamflib/desc/pdcp.h | 8 + drivers/common/dpaax/caamflib/desc/sdap.h | 1063 +++++++++++++++++++++ 2 files changed, 1071 insertions(+) create mode 100644 drivers/common/dpaax/caamflib/desc/sdap.h diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h index 95d1416c2..f084cf1de 100644 --- a/drivers/common/dpaax/caamflib/desc/pdcp.h +++ b/drivers/common/dpaax/caamflib/desc/pdcp.h @@ -43,6 +43,14 @@ #define PDCP_C_PLANE_SN_MASK 0x1F000000 #define PDCP_C_PLANE_SN_MASK_BE 0x0000001F +/** + * PDCP_7BIT_SN_MASK - This mask is used in the PDCP descriptors for + * extracting the sequence number (SN) from the + * PDCP User Plane header. + */ +#define PDCP_7BIT_SN_MASK 0x7F000000 +#define PDCP_7BIT_SN_MASK_BE 0x0000007F + /** * PDCP_12BIT_SN_MASK - This mask is used in the PDCP descriptors for * extracting the sequence number (SN) from the diff --git a/drivers/common/dpaax/caamflib/desc/sdap.h b/drivers/common/dpaax/caamflib/desc/sdap.h new file mode 100644 index 000000000..0df13cdee --- /dev/null +++ b/drivers/common/dpaax/caamflib/desc/sdap.h @@ -0,0 +1,1063 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 NXP + */ + +#ifndef __DESC_SDAP_H__ +#define __DESC_SDAP_H__ + +#include "rta.h" +#include "common.h" +#include "pdcp.h" + +/* The file defines all the functions to do PDCP without protocol support in + * SEC + */ + +/* Enable SDAP support */ +#define SDAP_SUPPORT +#ifdef SDAP_SUPPORT +#define SDAP_BYTE_SIZE 1 +#define SDAP_BITS_SIZE (SDAP_BYTE_SIZE * 8) +#endif + +static inline void key_loading_opti(struct program *p, + struct alginfo *cipherdata, + struct alginfo *authdata) +{ + LABEL(lbl_skip_key_loading_jump); + REFERENCE(ref_skip_key_loading_jump); + + /* Optimisation to bypass key loading (and decryption of the keys): + * Jump command testing: + * - SHRD: Descriptor is shared + * - SELF: The shared descriptor is in the same DECO + * - BOTH: The Class 1 and 2 CHA have finished + * -> If this is true, we jump and skip loading of the keys as they are + * already loaded + */ + ref_skip_key_loading_jump = + JUMP(p, lbl_skip_key_loading_jump, LOCAL_JUMP, ALL_TRUE, + SHRD | SELF | BOTH); + + /* Load the keys */ + if (cipherdata) { + KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key, + cipherdata->keylen, INLINE_KEY(cipherdata)); + } + + if (authdata) { + KEY(p, KEY2, authdata->key_enc_flags, authdata->key, + authdata->keylen, INLINE_KEY(authdata)); + } + + /* Save the place where we want the jump to go */ + SET_LABEL(p, lbl_skip_key_loading_jump); + /* Update the jump command with the position where to jump */ + PATCH_JUMP(p, ref_skip_key_loading_jump, lbl_skip_key_loading_jump); +} + +static inline int pdcp_sdap_get_sn_parameters(enum pdcp_sn_size sn_size, + bool swap, uint32_t *offset, + uint32_t *length, + uint32_t *sn_mask) +{ + switch (sn_size) { + case PDCP_SN_SIZE_5: + *offset = 7; + *length = 1; + *sn_mask = (swap == false) ? PDCP_C_PLANE_SN_MASK : + PDCP_C_PLANE_SN_MASK_BE; + break; + case PDCP_SN_SIZE_7: + *offset = 7; + *length = 1; + *sn_mask = (swap == false) ? PDCP_7BIT_SN_MASK : + PDCP_7BIT_SN_MASK_BE; + break; + case PDCP_SN_SIZE_12: + *offset = 6; + *length = 2; + *sn_mask = (swap == false) ? PDCP_12BIT_SN_MASK : + PDCP_12BIT_SN_MASK_BE; + break; + case PDCP_SN_SIZE_15: + *offset = 6; + *length = 2; + *sn_mask = (swap == false) ? PDCP_U_PLANE_15BIT_SN_MASK : + PDCP_U_PLANE_15BIT_SN_MASK_BE; + break; + case PDCP_SN_SIZE_18: + *offset = 5; + *length = 3; + *sn_mask = (swap == false) ? PDCP_U_PLANE_18BIT_SN_MASK : + PDCP_U_PLANE_18BIT_SN_MASK_BE; + break; + default: + pr_err("Invalid sn_size for %s\n", __func__); + return -ENOTSUP; + } + +#ifdef SDAP_SUPPORT + *length += SDAP_BYTE_SIZE; + *offset -= SDAP_BYTE_SIZE; +#endif + + return 0; +} + +static inline int pdcp_sdap_insert_no_int_op(struct program *p, + bool swap __maybe_unused, + struct alginfo *cipherdata, + unsigned int dir, + enum pdcp_sn_size sn_size) +{ + int op; + uint32_t sn_mask; + uint32_t length; + uint32_t offset; + + if (pdcp_sdap_get_sn_parameters(sn_size, swap, &offset, &length, + &sn_mask)) + return -ENOTSUP; + + /* Load key */ + key_loading_opti(p, cipherdata, NULL); + + SEQLOAD(p, MATH0, offset, length, 0); + JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM); +#ifdef SDAP_SUPPORT + rta_mathi(p, MATH0, + ((swap == true) ? MATH_FUN_RSHIFT : MATH_FUN_LSHIFT), + SDAP_BITS_SIZE, MATH1, 8, 0); + MATHB(p, MATH1, AND, sn_mask, MATH1, 8, IFB | IMMED2); +#else + MATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2); +#endif + + SEQSTORE(p, MATH0, offset, length, 0); + + MATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0); + MOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED); + MATHB(p, MATH1, OR, MATH2, MATH2, 8, 0); + + MATHB(p, SEQINSZ, SUB, MATH3, VSEQINSZ, 4, 0); + MATHB(p, SEQINSZ, SUB, MATH3, VSEQOUTSZ, 4, 0); + + SEQFIFOSTORE(p, MSG, 0, 0, VLF); + + op = dir == OP_TYPE_ENCAP_PROTOCOL ? DIR_ENC : DIR_DEC; + switch (cipherdata->algtype) { + case PDCP_CIPHER_TYPE_SNOW: + /* Copy the IV */ + MOVEB(p, MATH2, 0, CONTEXT1, 0, 8, WAITCOMP | IMMED); + ALG_OPERATION(p, OP_ALG_ALGSEL_SNOW_F8, OP_ALG_AAI_F8, + OP_ALG_AS_INITFINAL, ICV_CHECK_DISABLE, op); + break; + + case PDCP_CIPHER_TYPE_AES: + /* The first 64 bits are 0 */ + MOVEB(p, MATH2, 0, CONTEXT1, 16, 8, WAITCOMP | IMMED); + ALG_OPERATION(p, OP_ALG_ALGSEL_AES, OP_ALG_AAI_CTR, + OP_ALG_AS_INITFINAL, ICV_CHECK_DISABLE, op); + break; + + case PDCP_CIPHER_TYPE_ZUC: + if (rta_sec_era < RTA_SEC_ERA_5) { + pr_err("Invalid era for selected algorithm\n"); + return -ENOTSUP; + } + /* The LSB and MSB is the same for ZUC context */ + MOVEB(p, MATH2, 0, CONTEXT1, 0, 0x08, IMMED); + MOVEB(p, MATH2, 0, CONTEXT1, 0x08, 0x08, WAITCOMP | IMMED); + + ALG_OPERATION(p, OP_ALG_ALGSEL_ZUCE, OP_ALG_AAI_F8, + OP_ALG_AS_INITFINAL, ICV_CHECK_DISABLE, op); + break; + + default: + pr_err("%s: Invalid encrypt algorithm selected: %d\n", + "pdcp_sdap_insert_15bit_op", cipherdata->algtype); + return -EINVAL; + } + + SEQFIFOLOAD(p, MSG1, 0, VLF | LAST1 | FLUSH1); + + return 0; +} + +static inline int +pdcp_sdap_insert_enc_only_op(struct program *p, bool swap __maybe_unused, + struct alginfo *cipherdata, + struct alginfo *authdata __maybe_unused, + unsigned int dir, enum pdcp_sn_size sn_size, + unsigned char era_2_sw_hfn_ovrd __maybe_unused) +{ + uint32_t offset = 0, length = 0, sn_mask = 0; + + if (pdcp_sdap_get_sn_parameters(sn_size, swap, &offset, &length, + &sn_mask)) + return -ENOTSUP; + + /* Load key */ + key_loading_opti(p, cipherdata, NULL); + + /* Load header */ + SEQLOAD(p, MATH0, offset, length, 0); + JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM); + +#ifdef SDAP_SUPPORT + rta_mathi(p, MATH0, + ((swap == true) ? MATH_FUN_RSHIFT : MATH_FUN_LSHIFT), + SDAP_BITS_SIZE, MATH1, 8, 0); + MATHB(p, MATH1, AND, sn_mask, MATH1, 8, IFB | IMMED2); +#else + MATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2); +#endif + + /* Word (32 bit) swap */ + MATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0); + /* Load words from PDB: word 02 (HFN) + word 03 (bearer_dir)*/ + MOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED); + /* Create basic IV */ + MATHB(p, MATH1, OR, MATH2, MATH2, 8, 0); + + /* Write header */ + SEQSTORE(p, MATH0, offset, length, 0); + + if (rta_sec_era > RTA_SEC_ERA_2) { + MATHB(p, SEQINSZ, SUB, ZERO, VSEQINSZ, 4, 0); + } else { + MATHB(p, SEQINSZ, SUB, ONE, MATH1, 4, 0); + MATHB(p, MATH1, ADD, ONE, VSEQINSZ, 4, 0); + } + + if (dir == OP_TYPE_ENCAP_PROTOCOL) + MATHB(p, SEQINSZ, ADD, PDCP_MAC_I_LEN, VSEQOUTSZ, 4, IMMED2); + else + MATHB(p, SEQINSZ, SUB, PDCP_MAC_I_LEN, VSEQOUTSZ, 4, IMMED2); + + switch (cipherdata->algtype) { + case PDCP_CIPHER_TYPE_SNOW: + MOVEB(p, MATH2, 0, CONTEXT1, 0, 8, WAITCOMP | IMMED); + SEQFIFOSTORE(p, MSG, 0, 0, VLF | CONT); + ALG_OPERATION(p, OP_ALG_ALGSEL_SNOW_F8, OP_ALG_AAI_F8, + OP_ALG_AS_INITFINAL, ICV_CHECK_DISABLE, + dir == OP_TYPE_ENCAP_PROTOCOL ? DIR_ENC : + DIR_DEC); + break; + + case PDCP_CIPHER_TYPE_AES: + MOVEB(p, MATH2, 0, CONTEXT1, 16, 8, WAITCOMP | IMMED); + + SEQFIFOSTORE(p, MSG, 0, 0, VLF | CONT); + ALG_OPERATION(p, OP_ALG_ALGSEL_AES, OP_ALG_AAI_CTR, + OP_ALG_AS_INITFINAL, ICV_CHECK_DISABLE, + dir == OP_TYPE_ENCAP_PROTOCOL ? DIR_ENC : + DIR_DEC); + break; + + case PDCP_CIPHER_TYPE_ZUC: + if (rta_sec_era < RTA_SEC_ERA_5) { + pr_err("Invalid era for selected algorithm\n"); + return -ENOTSUP; + } + + MOVEB(p, MATH2, 0, CONTEXT1, 0, 0x08, IMMED); + MOVEB(p, MATH2, 0, CONTEXT1, 0x08, 0x08, WAITCOMP | IMMED); + + SEQFIFOSTORE(p, MSG, 0, 0, VLF | CONT); + ALG_OPERATION(p, OP_ALG_ALGSEL_ZUCE, OP_ALG_AAI_F8, + OP_ALG_AS_INITFINAL, ICV_CHECK_DISABLE, + dir == OP_TYPE_ENCAP_PROTOCOL ? DIR_ENC : + DIR_DEC); + break; + + default: + pr_err("%s: Invalid encrypt algorithm selected: %d\n", + "pdcp_sdap_insert_enc_only_op", cipherdata->algtype); + return -EINVAL; + } + + if (dir == OP_TYPE_ENCAP_PROTOCOL) { + SEQFIFOLOAD(p, MSG1, 0, VLF); + FIFOLOAD(p, MSG1, PDCP_NULL_INT_MAC_I_VAL, 4, + LAST1 | FLUSH1 | IMMED); + } else { + SEQFIFOLOAD(p, MSG1, 0, VLF | LAST1 | FLUSH1); + MOVE(p, OFIFO, 0, MATH1, 4, PDCP_MAC_I_LEN, WAITCOMP | IMMED); + MATHB(p, MATH1, XOR, PDCP_NULL_INT_MAC_I_VAL, NONE, 4, IMMED2); + JUMP(p, PDCP_NULL_INT_ICV_CHECK_FAILED_STATUS, HALT_STATUS, + ALL_FALSE, MATH_Z); + } + + return 0; +} + +/* + * This function leverage the use of in/out snooping as SNOW and ZUC both + * have a class 1 and class 2 CHA. It also supports AES as cipher. + * Supported: + * - cipher: + * - AES-CTR + * - SNOW F8 + * - ZUC F8 + * - authentication + * - SNOW F8 + * - ZUC F8 + */ +static inline int +pdcp_sdap_insert_snoop_op(struct program *p, bool swap __maybe_unused, + struct alginfo *cipherdata, struct alginfo *authdata, + unsigned int dir, enum pdcp_sn_size sn_size, + unsigned char era_2_sw_hfn_ovrd __maybe_unused) +{ + uint32_t offset = 0, length = 0, sn_mask = 0; + uint32_t int_op_alg = 0; + uint32_t int_op_aai = 0; + uint32_t cipher_op_alg = 0; + uint32_t cipher_op_aai = 0; + + if (authdata->algtype == PDCP_CIPHER_TYPE_ZUC) { + if (rta_sec_era < RTA_SEC_ERA_5) { + pr_err("Invalid era for selected algorithm\n"); + return -ENOTSUP; + } + } + + if (pdcp_sdap_get_sn_parameters(sn_size, swap, &offset, &length, + &sn_mask)) + return -ENOTSUP; + + if (dir == OP_TYPE_ENCAP_PROTOCOL) + MATHB(p, SEQINSZ, SUB, length, VSEQINSZ, 4, IMMED2); + + key_loading_opti(p, cipherdata, authdata); + + /* Load the PDCP header from the input data + * Note: SEQINSZ is decremented by length + */ + SEQLOAD(p, MATH0, offset, length, 0); + /* Wait the SN is loaded */ + JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM); + + /* Pass the PDCP header to integrity block */ + MOVEB(p, MATH0, offset, IFIFOAB2, 0, length, IMMED); + +#ifdef SDAP_SUPPORT + /* If SDAP is enabled, the least significant byte is the SDAP header + * Remove it by shifting the register + */ + rta_mathi(p, MATH0, + ((swap == true) ? MATH_FUN_RSHIFT : MATH_FUN_LSHIFT), + SDAP_BITS_SIZE, MATH1, 8, 0); + /* Mask the PDCP header to keep only the SN */ + MATHB(p, MATH1, AND, sn_mask, MATH1, 8, IFB | IMMED2); +#else + /* Mask the PDCP header to keep only the SN */ + MATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2); +#endif + + /* Do a byte swap, it places the SN in upper part of the MATH reg */ + MATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0); + + /* Load the HFN / Beare / Dir from the PDB + * CAAM word are 32bit hence loading 8 byte loads 2 words: + * - The HFN at offset 8 + * - The Bearer / Dir at offset 12 + */ + MOVEB(p, DESCBUF, 8, MATH2, 0, 8, WAITCOMP | IMMED); + /* Create the 4 first byte of the ICV by oring the math registers */ + MATHB(p, MATH1, OR, MATH2, MATH1, 8, 0); + + /* Set the IV of class 1 CHA */ + if (cipherdata->algtype == PDCP_CIPHER_TYPE_AES) { + MOVEB(p, MATH1, 0, CONTEXT1, 16, 8, IMMED); + } else { + /* Set the IV for the confidentiality CHA */ + MOVEB(p, MATH1, 0, CONTEXT1, 0, 8, IMMED); + } + + /* Set the IV of class 2 CHA */ + if (authdata->algtype == PDCP_AUTH_TYPE_ZUC) { + /* Set the IV for the integrity CHA */ + MOVEB(p, MATH1, 0, CONTEXT2, 0, 8, WAITCOMP | IMMED); + } else if (authdata->algtype == PDCP_AUTH_TYPE_SNOW) { + MOVEB(p, MATH1, 0, CONTEXT2, 0, 4, WAITCOMP | IMMED); + + /* Generate the bottom snow IV for integrity + * Note: MATH1 lowest 32bits is as follow: + * | bearer (5) | Dir (1) | zero (26) | + * the resulting math regs will be: + * MATH3 MATH2 + * | zero (5) | Dir (1) | zero (26) | | Bearer (5) | zero (27) | + */ + if (swap == false) { + MATHB(p, MATH1, AND, upper_32_bits(PDCP_BEARER_MASK), + MATH2, 4, IMMED2); + MATHB(p, MATH1, AND, lower_32_bits(PDCP_DIR_MASK), + MATH3, 4, IMMED2); + } else { + MATHB(p, MATH1, AND, lower_32_bits(PDCP_BEARER_MASK_BE), + MATH2, 4, IMMED2); + MATHB(p, MATH1, AND, upper_32_bits(PDCP_DIR_MASK_BE), + MATH3, 4, IMMED2); + } + /* Word swap MATH3 reg */ + MATHB(p, MATH3, SHLD, MATH3, MATH3, 8, 0); + + /* Don't understand, seems to be doing a move of 12 byte + * (read MATH2 and overread MATH3) + */ + MOVEB(p, MATH2, 4, OFIFO, 0, 12, IMMED); + + /* Add the rest of the snow IV to the context */ + MOVE(p, OFIFO, 0, CONTEXT2, 4, 12, IMMED); + } + + /* Set the variable size of data the register will write */ + if (dir == OP_TYPE_ENCAP_PROTOCOL) { + /* We will add the interity data so add its length */ + MATHI(p, SEQINSZ, ADD, PDCP_MAC_I_LEN, VSEQOUTSZ, 4, IMMED2); + } else { + /* We will check the interity data so remove its length */ + MATHI(p, SEQINSZ, SUB, PDCP_MAC_I_LEN, VSEQOUTSZ, 4, IMMED2); + /* Do not take the ICV in the out-snooping configuration */ + MATHI(p, SEQINSZ, SUB, PDCP_MAC_I_LEN, VSEQINSZ, 4, IMMED2); + } + + /* We write the PDCP header to output*/ + SEQSTORE(p, MATH0, offset, length, 0); + + /* Definition of the flow of output data */ + if (dir == OP_TYPE_ENCAP_PROTOCOL) { + /* We write data according to VSEQOUTSZ */ + SEQFIFOSTORE(p, MSG, 0, 0, VLF); + } else { + /* We write data according to VSEQOUTSZ */ + SEQFIFOSTORE(p, MSG, 0, 0, VLF | CONT); + } + + /* Get parameters for authentication */ + if (authdata->algtype == PDCP_AUTH_TYPE_ZUC) { + int_op_alg = OP_ALG_ALGSEL_ZUCA; + int_op_aai = OP_ALG_AAI_F9; + } else if (authdata->algtype == PDCP_AUTH_TYPE_SNOW) { + int_op_alg = OP_ALG_ALGSEL_SNOW_F9; + int_op_aai = OP_ALG_AAI_F9; + } else { + pr_err("%s no support for auth alg: %d\n", __func__, + authdata->algtype); + return -1; + } + + /* Get parameters for ciphering */ + if (cipherdata->algtype == PDCP_CIPHER_TYPE_ZUC) { + cipher_op_alg = OP_ALG_ALGSEL_ZUCE; + cipher_op_aai = OP_ALG_AAI_F8; + } else if (cipherdata->algtype == PDCP_CIPHER_TYPE_SNOW) { + cipher_op_alg = OP_ALG_ALGSEL_SNOW_F8; + cipher_op_aai = OP_ALG_AAI_F8; + } else if (cipherdata->algtype == PDCP_CIPHER_TYPE_AES) { + cipher_op_alg = OP_ALG_ALGSEL_AES; + cipher_op_aai = OP_ALG_AAI_CTR; + } else { + pr_err("%s no support for cipher alg: %d\n", __func__, + authdata->algtype); + return -1; + } + + /* Configure the CHA, the class 2 CHA must be configured first or an + * error will be generated + */ + + /* Configure the class 2 CHA (integrity )*/ + ALG_OPERATION(p, int_op_alg, int_op_aai, OP_ALG_AS_INITFINAL, + dir == OP_TYPE_ENCAP_PROTOCOL ? ICV_CHECK_DISABLE : + ICV_CHECK_ENABLE, + DIR_ENC); + + /* Configure class 1 CHA (confidentiality)*/ + ALG_OPERATION(p, cipher_op_alg, cipher_op_aai, OP_ALG_AS_INITFINAL, + ICV_CHECK_DISABLE, + dir == OP_TYPE_ENCAP_PROTOCOL ? DIR_ENC : DIR_DEC); + + /* Definition of the flow of input data */ + if (dir == OP_TYPE_ENCAP_PROTOCOL) { + /* We read data according to VSEQINSZ + * Note: we perform an in-snooping, eg the data will be read + * only once. they will be sent to both the integrity CHA and + * confidentiality CHA + */ + SEQFIFOLOAD(p, MSGINSNOOP, 0, VLF | LAST2); + + /* When the integrity CHA is finished, send the ICV stored in + * the context to the confidentiality CHA for encryption + */ + MOVE(p, CONTEXT2, 0, IFIFOAB1, 0, 4, LAST1 | FLUSH1 | IMMED); + } else { + /* We read data according to VSEQINSZ + * Note: we perfrom an out-snooping, eg the data will be read + * only once. The will first be sent to the the confidentiality + * CHA for decryption, then the CAAM will direct them to the + * integrity CHA to verify the ICV (which is at the end of the + * sequence) + */ + SEQFIFOLOAD(p, MSGOUTSNOOP, 0, VLF | LAST2); + + /* Process the ICV by class 1 CHA */ + SEQFIFOLOAD(p, MSG1, 4, LAST1 | FLUSH1); + + /* Wait for class 1 CHA to finish, the ICV data are stalling in + * the output fifo + */ + JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CLASS1 | NOP | NIFP); + + if (rta_sec_era >= RTA_SEC_ERA_6) + LOAD(p, 0, DCTRL, 0, LDLEN_RST_CHA_OFIFO_PTR, IMMED); + + /* Save the content left in the Output FIFO (the ICV) to MATH0 + */ + MOVE(p, OFIFO, 0, MATH0, 0, 4, WAITCOMP | IMMED); + + /* Configure a NFIFO entry to take data from the altsource + * and send it to the class 2 CHA as an ICV + */ + NFIFOADD(p, IFIFO, ICV2, 4, LAST2); + + /* Move the content of MATH0 (OFIFO offset) to altsource + * Note: As configured by the altsource, this will send + * the + */ + if (rta_sec_era <= RTA_SEC_ERA_2) { + /* Shut off automatic Info FIFO entries */ + LOAD(p, 0, DCTRL, LDOFF_DISABLE_AUTO_NFIFO, 0, IMMED); + MOVE(p, MATH0, 0, IFIFOAB2, 0, 4, WAITCOMP | IMMED); + } else { + MOVE(p, MATH0, 0, IFIFO, 0, 4, WAITCOMP | IMMED); + } + } + + if (authdata->algtype == PDCP_CIPHER_TYPE_ZUC) { + /* Reset ZUCA mode and done interrupt + * Note: If it is not done, DECO generate an error: 200031ca + * -> ZUCA ICV failed + */ + LOAD(p, CLRW_CLR_C2MODE, CLRW, 0, 4, IMMED); + LOAD(p, CIRQ_ZADI, ICTRL, 0, 4, IMMED); + } + + return 0; +} + +/* Function used when the integrity algorithm is a class 1 CHA so outsnooping + * is not possible + * Supported: + * - cipher: + * - AES-CTR + * - SNOW F8 + * - ZUC F8 + * - authentication + * - AES-CMAC + */ +static inline int pdcp_sdap_insert_no_snoop_op( + struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, + struct alginfo *authdata, unsigned int dir, enum pdcp_sn_size sn_size, + unsigned char era_2_sw_hfn_ovrd __maybe_unused) +{ + uint32_t offset = 0, length = 0, sn_mask = 0; + uint32_t cipher_alg_op = 0; + uint32_t cipher_alg_aai = 0; + + if (authdata->algtype == PDCP_CIPHER_TYPE_ZUC) { + if (rta_sec_era < RTA_SEC_ERA_5) { + pr_err("Invalid era for selected algorithm\n"); + return -ENOTSUP; + } + } + + if (pdcp_sdap_get_sn_parameters(sn_size, swap, &offset, &length, + &sn_mask)) + return -ENOTSUP; + + SEQLOAD(p, MATH0, offset, length, 0); + JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM); + +#ifdef SDAP_SUPPORT + rta_mathi(p, MATH0, + ((swap == true) ? MATH_FUN_RSHIFT : MATH_FUN_LSHIFT), + SDAP_BITS_SIZE, MATH1, 8, 0); + MATHB(p, MATH1, AND, sn_mask, MATH1, 8, IFB | IMMED2); +#else + MATHB(p, MATH0, AND, sn_mask, MATH1, 8, IFB | IMMED2); +#endif + + MATHB(p, MATH1, SHLD, MATH1, MATH1, 8, 0); + MOVEB(p, DESCBUF, 8, MATH2, 0, 0x08, WAITCOMP | IMMED); + MATHB(p, MATH1, OR, MATH2, MATH2, 8, 0); + + SEQSTORE(p, MATH0, offset, length, 0); + + if (dir == OP_TYPE_ENCAP_PROTOCOL) { + /* Load authentication key */ + KEY(p, KEY1, authdata->key_enc_flags, authdata->key, + authdata->keylen, INLINE_KEY(authdata)); + + /* Set the iv for AES authentication */ + MOVEB(p, MATH2, 0, IFIFOAB1, 0, 8, IMMED); + + /* Pass the header */ + MOVEB(p, MATH0, offset, IFIFOAB1, 0, length, IMMED); + + /* Configure variable size for I/O */ + MATHB(p, SEQINSZ, SUB, ZERO, VSEQINSZ, 4, 0); + MATHB(p, VSEQINSZ, ADD, PDCP_MAC_I_LEN, VSEQOUTSZ, 4, IMMED2); + + /* Perform the authentication */ + ALG_OPERATION(p, OP_ALG_ALGSEL_AES, OP_ALG_AAI_CMAC, + OP_ALG_AS_INITFINAL, ICV_CHECK_DISABLE, DIR_DEC); + + /* Configure the read of data */ + SEQFIFOLOAD(p, MSG1, 0, VLF | LAST1 | FLUSH1); + + /* Save the ICV generated */ + MOVEB(p, CONTEXT1, 0, MATH3, 0, 4, WAITCOMP | IMMED); + + /* The CHA will be reused so we need to clear it */ + LOAD(p, CLRW_RESET_CLS1_CHA | + CLRW_CLR_C1KEY | + CLRW_CLR_C1CTX | + CLRW_CLR_C1ICV | + CLRW_CLR_C1DATAS | + CLRW_CLR_C1MODE, + CLRW, 0, 4, IMMED); + + /* Load confidentiality key */ + KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key, + cipherdata->keylen, INLINE_KEY(cipherdata)); + + /* Load the IV for ciphering */ + if (cipherdata->algtype == PDCP_CIPHER_TYPE_AES) { + MOVEB(p, MATH2, 0, CONTEXT1, 16, 8, IMMED); + cipher_alg_op = OP_ALG_ALGSEL_AES; + cipher_alg_aai = OP_ALG_AAI_CTR; + } else if (cipherdata->algtype == PDCP_CIPHER_TYPE_ZUC) { + /* Set the IV for the confidentiality CHA */ + MOVEB(p, MATH2, 0, CONTEXT1, 0, 8, IMMED); + cipher_alg_op = OP_ALG_ALGSEL_ZUCE; + cipher_alg_aai = OP_ALG_AAI_F8; + } else if (cipherdata->algtype == PDCP_CIPHER_TYPE_SNOW) { + /* Set the IV for the confidentiality CHA */ + MOVEB(p, MATH2, 0, CONTEXT1, 0, 8, IMMED); + cipher_alg_op = OP_ALG_ALGSEL_SNOW_F8; + cipher_alg_aai = OP_ALG_AAI_F8; + } + + /* Rewind the pointer on input data to reread it */ + SEQINPTR(p, 0, PDCP_NULL_MAX_FRAME_LEN, RTO); + + /* Define the ciphering operation */ + ALG_OPERATION(p, cipher_alg_op, cipher_alg_aai, + OP_ALG_AS_INITFINAL, ICV_CHECK_DISABLE, DIR_ENC); + + /* Define the data to write */ + SEQFIFOSTORE(p, MSG, 0, 0, VLF); + + /* Skip the header which does not need to be encrypted */ + SEQFIFOLOAD(p, SKIP, length, 0); + + /* Read the rest of the data */ + SEQFIFOLOAD(p, MSG1, 0, VLF); + + /* Send the ICV stored in MATH3 fro encryption */ + MOVEB(p, MATH3, 0, IFIFOAB1, 0, 4, LAST1 | FLUSH1 | IMMED); + } else { + /* Load the IV for ciphering */ + if (cipherdata->algtype == PDCP_CIPHER_TYPE_AES) { + MOVEB(p, MATH2, 0, CONTEXT1, 16, 8, IMMED); + cipher_alg_op = OP_ALG_ALGSEL_AES; + cipher_alg_aai = OP_ALG_AAI_CTR; + } else if (cipherdata->algtype == PDCP_CIPHER_TYPE_ZUC) { + /* Set the IV for the confidentiality CHA */ + MOVEB(p, MATH2, 0, CONTEXT1, 0, 8, IMMED); + cipher_alg_op = OP_ALG_ALGSEL_ZUCE; + cipher_alg_aai = OP_ALG_AAI_F8; + } else if (cipherdata->algtype == PDCP_CIPHER_TYPE_SNOW) { + /* Set the IV for the confidentiality CHA */ + MOVEB(p, MATH2, 0, CONTEXT1, 0, 8, IMMED); + cipher_alg_op = OP_ALG_ALGSEL_SNOW_F8; + cipher_alg_aai = OP_ALG_AAI_F8; + } + MOVEB(p, MATH2, 0, CONTEXT2, 0, 8, IMMED); + + /* Read all the data */ + MATHB(p, SEQINSZ, SUB, ZERO, VSEQINSZ, 4, 0); + + /* Do not write back the ICV */ + MATHB(p, SEQINSZ, SUB, PDCP_MAC_I_LEN, VSEQOUTSZ, 4, IMMED2); + + /* Load the key for ciphering */ + KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key, + cipherdata->keylen, INLINE_KEY(cipherdata)); + + /* Write all the data */ + SEQFIFOSTORE(p, MSG, 0, 0, VLF | CONT); + + /* Define the ciphering algorithm */ + ALG_OPERATION(p, cipher_alg_op, cipher_alg_aai, + OP_ALG_AS_INITFINAL, ICV_CHECK_DISABLE, DIR_DEC); + + /* Read all the data */ + SEQFIFOLOAD(p, MSG1, 0, VLF | LAST1 | FLUSH1); + + /* Save the ICV which is stalling in output FIFO to MATH3 */ + MOVEB(p, OFIFO, 0, MATH3, 0, 4, IMMED); + + /* Reset class 1 CHA */ + LOAD(p, CLRW_RESET_CLS1_CHA | + CLRW_CLR_C1KEY | + CLRW_CLR_C1CTX | + CLRW_CLR_C1ICV | + CLRW_CLR_C1DATAS | + CLRW_CLR_C1MODE, + CLRW, 0, 4, IMMED); + + /* Load the key for authentcation */ + KEY(p, KEY1, authdata->key_enc_flags, authdata->key, + authdata->keylen, INLINE_KEY(authdata)); + + /* Start a new sequence */ + SEQINPTR(p, 0, 0, SOP); + + /* Define the operation to verify the ICV */ + ALG_OPERATION(p, OP_ALG_ALGSEL_AES, OP_ALG_AAI_CMAC, + OP_ALG_AS_INITFINAL, ICV_CHECK_ENABLE, DIR_DEC); + + /* Set the variable size input */ + MATHB(p, SEQINSZ, SUB, ZERO, VSEQINSZ, 4, 0); + + MOVE(p, CONTEXT2, 0, IFIFOAB1, 0, 8, IMMED); + + SEQFIFOLOAD(p, MSG1, 0, VLF | LAST1 | FLUSH1); + + /* Define an NFIFO entry to load the ICV saved */ + LOAD(p, NFIFOENTRY_STYPE_ALTSOURCE | + NFIFOENTRY_DEST_CLASS1 | + NFIFOENTRY_DTYPE_ICV | + NFIFOENTRY_LC1 | + NFIFOENTRY_FC1 | 4, NFIFO_SZL, 0, 4, IMMED); + + /* Load the ICV */ + MOVEB(p, MATH3, 0, ALTSOURCE, 0, 4, IMMED); + } + + return 0; +} + +static int pdcp_sdap_insert_with_int_op( + struct program *p, bool swap __maybe_unused, struct alginfo *cipherdata, + struct alginfo *authdata, enum pdcp_sn_size sn_size, + unsigned char era_2_sw_hfn_ovrd, unsigned int dir) +{ + static int ( + *pdcp_cp_fp[PDCP_CIPHER_TYPE_INVALID][PDCP_AUTH_TYPE_INVALID])( + struct program *, bool swap, struct alginfo *, struct alginfo *, + unsigned int, enum pdcp_sn_size, + unsigned char __maybe_unused) = { + { + /* NULL */ + pdcp_insert_cplane_null_op, /* NULL */ + pdcp_insert_cplane_int_only_op, /* SNOW f9 */ + pdcp_insert_cplane_int_only_op, /* AES CMAC */ + pdcp_insert_cplane_int_only_op /* ZUC-I */ + }, + { + /* SNOW f8 */ + pdcp_sdap_insert_enc_only_op, /* NULL */ + pdcp_sdap_insert_snoop_op, /* SNOW f9 */ + pdcp_sdap_insert_no_snoop_op, /* AES CMAC */ + pdcp_sdap_insert_snoop_op /* ZUC-I */ + }, + { + /* AES CTR */ + pdcp_sdap_insert_enc_only_op, /* NULL */ + pdcp_sdap_insert_snoop_op, /* SNOW f9 */ + pdcp_sdap_insert_no_snoop_op, /* AES CMAC */ + pdcp_sdap_insert_snoop_op /* ZUC-I */ + }, + { + /* ZUC-E */ + pdcp_sdap_insert_enc_only_op, /* NULL */ + pdcp_sdap_insert_snoop_op, /* SNOW f9 */ + pdcp_sdap_insert_no_snoop_op, /* AES CMAC */ + pdcp_sdap_insert_snoop_op /* ZUC-I */ + }, + }; + int err; + + err = pdcp_cp_fp[cipherdata->algtype] + [authdata->algtype](p, swap, cipherdata, authdata, dir, + sn_size, era_2_sw_hfn_ovrd); + if (err) + return err; + + return 0; +} + +static inline int +cnstr_shdsc_pdcp_sdap_u_plane(uint32_t *descbuf, + bool ps, + bool swap, + enum pdcp_sn_size sn_size, + uint32_t hfn, + unsigned short bearer, + unsigned short direction, + uint32_t hfn_threshold, + struct alginfo *cipherdata, + struct alginfo *authdata, + unsigned char era_2_sw_hfn_ovrd, + uint32_t caps_mode) +{ + struct program prg; + struct program *p = &prg; + int err; + enum pdb_type_e pdb_type; + static enum rta_share_type + desc_share[PDCP_CIPHER_TYPE_INVALID][PDCP_AUTH_TYPE_INVALID] = { + { + /* NULL */ + SHR_WAIT, /* NULL */ + SHR_ALWAYS, /* SNOW f9 */ + SHR_ALWAYS, /* AES CMAC */ + SHR_ALWAYS /* ZUC-I */ + }, + { + /* SNOW f8 */ + SHR_ALWAYS, /* NULL */ + SHR_ALWAYS, /* SNOW f9 */ + SHR_WAIT, /* AES CMAC */ + SHR_WAIT /* ZUC-I */ + }, + { + /* AES CTR */ + SHR_ALWAYS, /* NULL */ + SHR_ALWAYS, /* SNOW f9 */ + SHR_ALWAYS, /* AES CMAC */ + SHR_WAIT /* ZUC-I */ + }, + { + /* ZUC-E */ + SHR_ALWAYS, /* NULL */ + SHR_WAIT, /* SNOW f9 */ + SHR_WAIT, /* AES CMAC */ + SHR_WAIT /* ZUC-I */ + }, + }; + + LABEL(pdb_end); + + /* Check HFN override for ERA 2 */ + if (rta_sec_era != RTA_SEC_ERA_2 && era_2_sw_hfn_ovrd) { + pr_err("Cannot select SW HFN ovrd for other era than 2"); + return -EINVAL; + } + + /* Check the confidentiality algorithm is supported by the code */ + switch (cipherdata->algtype) { + case PDCP_CIPHER_TYPE_NULL: + case PDCP_CIPHER_TYPE_SNOW: + case PDCP_CIPHER_TYPE_AES: + case PDCP_CIPHER_TYPE_ZUC: + break; + default: + pr_err("Cipher algorithm not supported: %d\n", + cipherdata->algtype); + return -ENOTSUP; + } + + /* Check the authentication algorithm is supported by the code */ + if (authdata) { + switch (authdata->algtype) { + case PDCP_AUTH_TYPE_NULL: + case PDCP_AUTH_TYPE_SNOW: + case PDCP_AUTH_TYPE_AES: + case PDCP_AUTH_TYPE_ZUC: + break; + default: + pr_err("Auth algorithm not supported: %d\n", + authdata->algtype); + return -ENOTSUP; + } + } + + /* Check the Sequence Number size is supported by the code */ + switch (sn_size) { + case PDCP_SN_SIZE_5: + case PDCP_SN_SIZE_7: + case PDCP_SN_SIZE_12: + case PDCP_SN_SIZE_15: + case PDCP_SN_SIZE_18: + break; + default: + pr_err("SN size not supported: %d\n", sn_size); + return -ENOTSUP; + } + + /* Check that we are not performing ZUC algo on old platforms */ + if (cipherdata->algtype == PDCP_CIPHER_TYPE_ZUC && + rta_sec_era < RTA_SEC_ERA_5) { + pr_err("ZUC algorithm not supported for era: %d\n", + rta_sec_era); + return -ENOTSUP; + } + + /* Initialize the program */ + PROGRAM_CNTXT_INIT(p, descbuf, 0); + + if (swap) + PROGRAM_SET_BSWAP(p); + + if (ps) + PROGRAM_SET_36BIT_ADDR(p); + + /* Select the shared descriptor sharing mode */ + if (authdata) + SHR_HDR(p, desc_share[cipherdata->algtype][authdata->algtype], + 0, 0); + else + SHR_HDR(p, SHR_ALWAYS, 0, 0); + + /* Construct the PDB */ + pdb_type = cnstr_pdcp_u_plane_pdb(p, sn_size, hfn, bearer, direction, + hfn_threshold, cipherdata, authdata); + if (pdb_type == PDCP_PDB_TYPE_INVALID) { + pr_err("Error creating PDCP UPlane PDB\n"); + return -EINVAL; + } + SET_LABEL(p, pdb_end); + + /* Inser the HFN override operation */ + err = insert_hfn_ov_op(p, sn_size, pdb_type, era_2_sw_hfn_ovrd); + if (err) + return err; + + /* Create the descriptor */ + if (!authdata) { + if (cipherdata->algtype == PDCP_CIPHER_TYPE_NULL) { + insert_copy_frame_op(p, cipherdata, + OP_TYPE_ENCAP_PROTOCOL); + } else { + err = pdcp_sdap_insert_no_int_op(p, swap, cipherdata, + caps_mode, + sn_size); + if (err) { + pr_err("Fail pdcp_sdap_insert_no_int_op\n"); + return err; + } + } + } else { + err = pdcp_sdap_insert_with_int_op(p, swap, cipherdata, + authdata, sn_size, + era_2_sw_hfn_ovrd, + caps_mode); + if (err) { + pr_err("Fail pdcp_sdap_insert_with_int_op\n"); + return err; + } + } + + PATCH_HDR(p, 0, pdb_end); + + return PROGRAM_FINALIZE(p); +} + +/** + * cnstr_shdsc_pdcp_sdap_u_plane_encap - Function for creating a PDCP-SDAP + * User Plane encapsulation descriptor. + * @descbuf: pointer to buffer for descriptor construction + * @ps: if 36/40bit addressing is desired, this parameter must be true + * @swap: must be true when core endianness doesn't match SEC endianness + * @sn_size: selects Sequence Number Size: 7/12/15 bits + * @hfn: starting Hyper Frame Number to be used together with the SN from the + * PDCP frames. + * @bearer: radio bearer ID + * @direction: the direction of the PDCP frame (UL/DL) + * @hfn_threshold: HFN value that once reached triggers a warning from SEC that + * keys should be renegotiated at the earliest convenience. + * @cipherdata: pointer to block cipher transform definitions + * Valid algorithm values are those from cipher_type_pdcp enum. + * @era_2_sw_hfn_ovrd: if software HFN override mechanism is desired for + * this descriptor. Note: Can only be used for + * SEC ERA 2. + * + * Return: size of descriptor written in words or negative number on error. + * Once the function returns, the value of this parameter can be used + * for reclaiming the space that wasn't used for the descriptor. + * + * Note: descbuf must be large enough to contain a full 256 byte long + * descriptor; after the function returns, by subtracting the actual number of + * bytes used, the user can reuse the remaining buffer space for other purposes. + */ +static inline int +cnstr_shdsc_pdcp_sdap_u_plane_encap(uint32_t *descbuf, + bool ps, + bool swap, + enum pdcp_sn_size sn_size, + uint32_t hfn, + unsigned short bearer, + unsigned short direction, + uint32_t hfn_threshold, + struct alginfo *cipherdata, + struct alginfo *authdata, + unsigned char era_2_sw_hfn_ovrd) +{ + return cnstr_shdsc_pdcp_sdap_u_plane(descbuf, ps, swap, sn_size, + hfn, bearer, direction, hfn_threshold, cipherdata, + authdata, era_2_sw_hfn_ovrd, OP_TYPE_ENCAP_PROTOCOL); +} + +/** + * cnstr_shdsc_pdcp_sdap_u_plane_decap - Function for creating a PDCP-SDAP + * User Plane decapsulation descriptor. + * @descbuf: pointer to buffer for descriptor construction + * @ps: if 36/40bit addressing is desired, this parameter must be true + * @swap: must be true when core endianness doesn't match SEC endianness + * @sn_size: selects Sequence Number Size: 7/12/15 bits + * @hfn: starting Hyper Frame Number to be used together with the SN from the + * PDCP frames. + * @bearer: radio bearer ID + * @direction: the direction of the PDCP frame (UL/DL) + * @hfn_threshold: HFN value that once reached triggers a warning from SEC that + * keys should be renegotiated at the earliest convenience. + * @cipherdata: pointer to block cipher transform definitions + * Valid algorithm values are those from cipher_type_pdcp enum. + * @era_2_sw_hfn_ovrd: if software HFN override mechanism is desired for + * this descriptor. Note: Can only be used for + * SEC ERA 2. + * + * Return: size of descriptor written in words or negative number on error. + * Once the function returns, the value of this parameter can be used + * for reclaiming the space that wasn't used for the descriptor. + * + * Note: descbuf must be large enough to contain a full 256 byte long + * descriptor; after the function returns, by subtracting the actual number of + * bytes used, the user can reuse the remaining buffer space for other purposes. + */ +static inline int +cnstr_shdsc_pdcp_sdap_u_plane_decap(uint32_t *descbuf, + bool ps, + bool swap, + enum pdcp_sn_size sn_size, + uint32_t hfn, + unsigned short bearer, + unsigned short direction, + uint32_t hfn_threshold, + struct alginfo *cipherdata, + struct alginfo *authdata, + unsigned char era_2_sw_hfn_ovrd) +{ + return cnstr_shdsc_pdcp_sdap_u_plane(descbuf, ps, swap, sn_size, hfn, + bearer, direction, hfn_threshold, cipherdata, authdata, + era_2_sw_hfn_ovrd, OP_TYPE_DECAP_PROTOCOL); +} + +#endif /* __DESC_SDAP_H__ */ From patchwork Thu Sep 3 16:06:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 76450 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 65DA5A04BF; Thu, 3 Sep 2020 18:07:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D7211C0CE; Thu, 3 Sep 2020 18:07:04 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id A3F1E1C0C0 for ; Thu, 3 Sep 2020 18:07:02 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 760C21A0EDA; Thu, 3 Sep 2020 18:07:02 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B27281A0405; Thu, 3 Sep 2020 18:06:59 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 469EC402D9; Thu, 3 Sep 2020 18:06:56 +0200 (CEST) From: akhil.goyal@nxp.com To: dev@dpdk.org Cc: hemant.agrawal@nxp.com, anoobj@marvell.com, declan.doherty@intel.com, david.coyle@intel.com, Akhil Goyal Date: Thu, 3 Sep 2020 21:36:47 +0530 Message-Id: <20200903160652.31654-3-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903160652.31654-1-akhil.goyal@nxp.com> References: <20200903160652.31654-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/7] security: modify PDCP xform to support SDAP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Akhil Goyal The SDAP is a protocol in the LTE stack on top of PDCP for QOS. A particular PDCP session may or may not have SDAP enabled. But if it is enabled, SDAP header should be authenticated but not encrypted if both confidentiality and integrity is enabled. Hence, the driver should be intimated from the xform so that it skip the SDAP header while encryption. A new field is added in the PDCP xform to specify SDAP is enabled. The overall size of the xform is not changed, as hfn_ovrd is just a flag and does not need uint32. Hence, it is converted to uint8_t and a 16 bit reserved field is added for future. Signed-off-by: Akhil Goyal --- doc/guides/prog_guide/rte_security.rst | 19 ++++++++++++++++++- lib/librte_security/rte_security.h | 12 ++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/doc/guides/prog_guide/rte_security.rst b/doc/guides/prog_guide/rte_security.rst index 127da2e4f..ab535d1cd 100644 --- a/doc/guides/prog_guide/rte_security.rst +++ b/doc/guides/prog_guide/rte_security.rst @@ -1,5 +1,5 @@ .. SPDX-License-Identifier: BSD-3-Clause - Copyright 2017 NXP + Copyright 2017,2020 NXP @@ -693,6 +693,23 @@ PDCP related configuration parameters are defined in ``rte_security_pdcp_xform`` uint32_t hfn; /** HFN Threshold for key renegotiation */ uint32_t hfn_threshold; + /** HFN can be given as a per packet value also. + * As we do not have IV in case of PDCP, and HFN is + * used to generate IV. IV field can be used to get the + * per packet HFN while enq/deq. + * If hfn_ovrd field is set, user is expected to set the + * per packet HFN in place of IV. PMDs will extract the HFN + * and perform operations accordingly. + */ + uint8_t hfn_ovrd; + /** In case of 5G NR, a new protocol(SDAP) header may be set + * inside PDCP payload which should be authenticated but not + * encrypted. Hence, driver should be notified if SDAP is + * enabled or not, so that SDAP header is not encrypted. + */ + uint8_t sdap_enabled; + /** Reserved for future */ + uint16_t reserved; }; DOCSIS related configuration parameters are defined in ``rte_security_docsis_xform`` diff --git a/lib/librte_security/rte_security.h b/lib/librte_security/rte_security.h index 16839e539..48b377b20 100644 --- a/lib/librte_security/rte_security.h +++ b/lib/librte_security/rte_security.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2017,2019 NXP + * Copyright 2017,2019-2020 NXP * Copyright(c) 2017-2020 Intel Corporation. */ @@ -290,7 +290,15 @@ struct rte_security_pdcp_xform { * per packet HFN in place of IV. PMDs will extract the HFN * and perform operations accordingly. */ - uint32_t hfn_ovrd; + uint8_t hfn_ovrd; + /** In case of 5G NR, a new protocol(SDAP) header may be set + * inside PDCP payload which should be authenticated but not + * encrypted. Hence, driver should be notified if SDAP is + * enabled or not, so that SDAP header is not encrypted. + */ + uint8_t sdap_enabled; + /** Reserved for future */ + uint16_t reserved; }; /** DOCSIS direction */ From patchwork Thu Sep 3 16:06:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 76452 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F74FA04BF; Thu, 3 Sep 2020 18:07:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 634201C116; Thu, 3 Sep 2020 18:07:07 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 5BE681C0D4 for ; Thu, 3 Sep 2020 18:07:04 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3D2A81A0C67; Thu, 3 Sep 2020 18:07:04 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 87C461A0BB6; Thu, 3 Sep 2020 18:07:01 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id B4F7E402EB; Thu, 3 Sep 2020 18:06:56 +0200 (CEST) From: akhil.goyal@nxp.com To: dev@dpdk.org Cc: hemant.agrawal@nxp.com, anoobj@marvell.com, declan.doherty@intel.com, david.coyle@intel.com, Akhil Goyal Date: Thu, 3 Sep 2020 21:36:48 +0530 Message-Id: <20200903160652.31654-4-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903160652.31654-1-akhil.goyal@nxp.com> References: <20200903160652.31654-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 3/7] crypto/dpaa2_sec: enable PDCP-SDAP sessions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Akhil Goyal Based on the new field in PDCP xform, a decision is made to create a PDCP session with or without SDAP enabled. Signed-off-by: Akhil Goyal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 30 ++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 109e61ae1..6aa2a36f3 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -36,6 +36,7 @@ /* RTA header files */ #include #include +#include #include /* Minimum job descriptor consists of a oneword job descriptor HEADER and @@ -3186,8 +3187,9 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, &cipherdata, &authdata, 0); } else { - if (session->dir == DIR_ENC) - bufsize = cnstr_shdsc_pdcp_u_plane_encap( + if (session->dir == DIR_ENC) { + if (pdcp_xform->sdap_enabled) + bufsize = cnstr_shdsc_pdcp_sdap_u_plane_encap( priv->flc_desc[0].desc, 1, swap, session->pdcp.sn_size, pdcp_xform->hfn, @@ -3195,8 +3197,18 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, pdcp_xform->pkt_dir, pdcp_xform->hfn_threshold, &cipherdata, p_authdata, 0); - else if (session->dir == DIR_DEC) - bufsize = cnstr_shdsc_pdcp_u_plane_decap( + else + bufsize = cnstr_shdsc_pdcp_u_plane_encap( + priv->flc_desc[0].desc, 1, swap, + session->pdcp.sn_size, + pdcp_xform->hfn, + pdcp_xform->bearer, + pdcp_xform->pkt_dir, + pdcp_xform->hfn_threshold, + &cipherdata, p_authdata, 0); + } else if (session->dir == DIR_DEC) { + if (pdcp_xform->sdap_enabled) + bufsize = cnstr_shdsc_pdcp_sdap_u_plane_decap( priv->flc_desc[0].desc, 1, swap, session->pdcp.sn_size, pdcp_xform->hfn, @@ -3204,6 +3216,16 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, pdcp_xform->pkt_dir, pdcp_xform->hfn_threshold, &cipherdata, p_authdata, 0); + else + bufsize = cnstr_shdsc_pdcp_u_plane_decap( + priv->flc_desc[0].desc, 1, swap, + session->pdcp.sn_size, + pdcp_xform->hfn, + pdcp_xform->bearer, + pdcp_xform->pkt_dir, + pdcp_xform->hfn_threshold, + &cipherdata, p_authdata, 0); + } } if (bufsize < 0) { From patchwork Thu Sep 3 16:06:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 76453 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 41070A04BF; Thu, 3 Sep 2020 18:07:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 955B21C11D; Thu, 3 Sep 2020 18:07:08 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 8C5EA1C0D5 for ; Thu, 3 Sep 2020 18:07:04 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 68CF91A0BB6; Thu, 3 Sep 2020 18:07:04 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 87C761A0D53; Thu, 3 Sep 2020 18:07:01 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2F268402F0; Thu, 3 Sep 2020 18:06:57 +0200 (CEST) From: akhil.goyal@nxp.com To: dev@dpdk.org Cc: hemant.agrawal@nxp.com, anoobj@marvell.com, declan.doherty@intel.com, david.coyle@intel.com, Akhil Goyal Date: Thu, 3 Sep 2020 21:36:49 +0530 Message-Id: <20200903160652.31654-5-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903160652.31654-1-akhil.goyal@nxp.com> References: <20200903160652.31654-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 4/7] crypto/dpaa_sec: enable PDCP-SDAP sessions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Akhil Goyal Based on the new field in PDCP xform, a decision is made to create a PDCP session with or without SDAP enabled. Signed-off-by: Akhil Goyal --- drivers/crypto/dpaa_sec/dpaa_sec.c | 63 +++++++++++++++++++++--------- drivers/crypto/dpaa_sec/dpaa_sec.h | 3 +- 2 files changed, 47 insertions(+), 19 deletions(-) diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index c4339336d..192dba064 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -293,24 +294,49 @@ dpaa_sec_prep_pdcp_cdb(dpaa_sec_session *ses) &cipherdata, &authdata, 0); } else { - if (ses->dir == DIR_ENC) - shared_desc_len = cnstr_shdsc_pdcp_u_plane_encap( - cdb->sh_desc, 1, swap, - ses->pdcp.sn_size, - ses->pdcp.hfn, - ses->pdcp.bearer, - ses->pdcp.pkt_dir, - ses->pdcp.hfn_threshold, - &cipherdata, p_authdata, 0); - else if (ses->dir == DIR_DEC) - shared_desc_len = cnstr_shdsc_pdcp_u_plane_decap( - cdb->sh_desc, 1, swap, - ses->pdcp.sn_size, - ses->pdcp.hfn, - ses->pdcp.bearer, - ses->pdcp.pkt_dir, - ses->pdcp.hfn_threshold, - &cipherdata, p_authdata, 0); + if (ses->dir == DIR_ENC) { + if (ses->pdcp.sdap_enabled) + shared_desc_len = + cnstr_shdsc_pdcp_sdap_u_plane_encap( + cdb->sh_desc, 1, swap, + ses->pdcp.sn_size, + ses->pdcp.hfn, + ses->pdcp.bearer, + ses->pdcp.pkt_dir, + ses->pdcp.hfn_threshold, + &cipherdata, p_authdata, 0); + else + shared_desc_len = + cnstr_shdsc_pdcp_u_plane_encap( + cdb->sh_desc, 1, swap, + ses->pdcp.sn_size, + ses->pdcp.hfn, + ses->pdcp.bearer, + ses->pdcp.pkt_dir, + ses->pdcp.hfn_threshold, + &cipherdata, p_authdata, 0); + } else if (ses->dir == DIR_DEC) { + if (ses->pdcp.sdap_enabled) + shared_desc_len = + cnstr_shdsc_pdcp_sdap_u_plane_decap( + cdb->sh_desc, 1, swap, + ses->pdcp.sn_size, + ses->pdcp.hfn, + ses->pdcp.bearer, + ses->pdcp.pkt_dir, + ses->pdcp.hfn_threshold, + &cipherdata, p_authdata, 0); + else + shared_desc_len = + cnstr_shdsc_pdcp_u_plane_decap( + cdb->sh_desc, 1, swap, + ses->pdcp.sn_size, + ses->pdcp.hfn, + ses->pdcp.bearer, + ses->pdcp.pkt_dir, + ses->pdcp.hfn_threshold, + &cipherdata, p_authdata, 0); + } } return shared_desc_len; } @@ -2950,6 +2976,7 @@ dpaa_sec_set_pdcp_session(struct rte_cryptodev *dev, session->pdcp.hfn_threshold = pdcp_xform->hfn_threshold; session->pdcp.hfn_ovd = pdcp_xform->hfn_ovrd; session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset; + session->pdcp.sdap_enabled = pdcp_xform->sdap_enabled; rte_spinlock_lock(&dev_priv->lock); for (i = 0; i < MAX_DPAA_CORES; i++) { diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index 2cd50cc8d..ddba52982 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -109,7 +109,8 @@ struct sec_pdcp_ctxt { int8_t pkt_dir;/*!< PDCP Frame Direction 0:UL 1:DL*/ int8_t hfn_ovd;/*!< Overwrite HFN per packet*/ uint8_t sn_size; /*!< Sequence number size, 5/7/12/15/18 */ - uint32_t hfn_ovd_offset;/*!< offset from rte_crypto_op at which + uint8_t sdap_enabled; /*!< SDAP header is enabled */ + uint16_t hfn_ovd_offset;/*!< offset from rte_crypto_op at which * per packet hfn is stored */ uint32_t hfn; /*!< Hyper Frame Number */ From patchwork Thu Sep 3 16:06:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 76455 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 57FA3A04BF; Thu, 3 Sep 2020 18:08:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 121C11C129; Thu, 3 Sep 2020 18:07:11 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 9E2421C11A for ; Thu, 3 Sep 2020 18:07:07 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 777AD200F24; Thu, 3 Sep 2020 18:07:07 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 210282002BF; Thu, 3 Sep 2020 18:07:03 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 9DBFD402F2; Thu, 3 Sep 2020 18:06:57 +0200 (CEST) From: akhil.goyal@nxp.com To: dev@dpdk.org Cc: hemant.agrawal@nxp.com, anoobj@marvell.com, declan.doherty@intel.com, david.coyle@intel.com, Franck LENORMAND , Akhil Goyal Date: Thu, 3 Sep 2020 21:36:50 +0530 Message-Id: <20200903160652.31654-6-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903160652.31654-1-akhil.goyal@nxp.com> References: <20200903160652.31654-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 5/7] test/crypto: Add test vectors for PDCP-SDAP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Franck LENORMAND The test vectors are structured in a more readable way compared to test vector for PDCP. This structure allows to have all the information about a test vector at the same place. Signed-off-by: Franck LENORMAND Signed-off-by: Akhil Goyal --- ...ryptodev_security_pdcp_sdap_test_vectors.h | 3619 +++++++++++++++++ 1 file changed, 3619 insertions(+) create mode 100644 app/test/test_cryptodev_security_pdcp_sdap_test_vectors.h diff --git a/app/test/test_cryptodev_security_pdcp_sdap_test_vectors.h b/app/test/test_cryptodev_security_pdcp_sdap_test_vectors.h new file mode 100644 index 000000000..f43f693ed --- /dev/null +++ b/app/test/test_cryptodev_security_pdcp_sdap_test_vectors.h @@ -0,0 +1,3619 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2020 NXP + */ + +#ifndef SECURITY_PDCP_SDAP_TEST_VECTOR_H_ +#define SECURITY_PDCP_SDAP_TEST_VECTOR_H_ + +#include + +struct pdcp_sdap_test { + uint32_t test_idx; + struct pdcp_sdap_test_param { + uint8_t type; + enum rte_security_pdcp_domain domain; + enum rte_crypto_cipher_algorithm cipher_alg; + uint8_t cipher_key_len; + enum rte_crypto_auth_algorithm auth_alg; + uint8_t auth_key_len; + const char *name; + } param; + const uint8_t *cipher_key; + const uint8_t *auth_key; + const uint8_t *data_in; + uint32_t in_len; + const uint8_t *data_out; + uint8_t sn_size; + uint32_t hfn; + uint32_t hfn_threshold; + uint8_t bearer; + uint8_t packet_direction; +}; + +static const struct pdcp_sdap_test list_pdcp_sdap_tests[] = { + /**************************** 7bit ************************************/ + + /************************ null + null ****************************/ + + { + .test_idx = 1, + .param = {.name = "PDCP-SDAP Uplane: 7b SN, NULL_ENC Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0xad, 0x9c, 0x44, 0x1f, 0x89, + 0x0b, 0x38, 0xc4, 0x57, 0xa4, 0x9d, + 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 16, + .data_out = (uint8_t[]){ 0x8b, 0xad, 0x9c, 0x44, 0x1f, 0x89, + 0x0b, 0x38, 0xc4, 0x57, 0xa4, 0x9d, + 0x42, 0x14, 0x07, 0xe8 }, + .sn_size = 7, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 0, + }, + + /**************************** null + null ****************************/ + + { + .test_idx = 2, + .param = {.name = "PDCP-SDAP Uplane: 7b SN, NULL_ENC Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0xad, 0x9c, 0x44, 0x1f, 0x89, + 0x0b, 0x38, 0xc4, 0x57, 0xa4, 0x9d, + 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 16, + .data_out = (uint8_t[]){ 0x8b, 0xad, 0x9c, 0x44, 0x1f, 0x89, + 0x0b, 0x38, 0xc4, 0x57, 0xa4, 0x9d, + 0x42, 0x14, 0x07, 0xe8 }, + .sn_size = 7, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 1, + }, + + /************************ aes-ctr + null ****************************/ + + { + .test_idx = 3, + .param = {.name = "PDCP-SDAP Uplane: 7b SN, AES-CTR_ENC Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0xad, 0x9c, 0x44, 0x1f, 0x89, + 0x0b, 0x38, 0xc4, 0x57, 0xa4, 0x9d, + 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 16, + .data_out = (uint8_t[]){ 0x8b, 0xad, 0x3e, 0x79, 0xa9, 0xc0, + 0xec, 0xdd, 0x9e, 0x8f, 0x91, 0x3f, + 0xa1, 0x6e, 0x59, 0xed }, + .sn_size = 7, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 0, + }, + + /************************ aes-ctr + null ****************************/ + + { + .test_idx = 4, + .param = {.name = + "PDCP-SDAP Uplane: 7b SN, AES-CTR_ENC Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0xad, 0x9c, 0x44, 0x1f, 0x89, + 0x0b, 0x38, 0xc4, 0x57, 0xa4, 0x9d, + 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 16, + .data_out = (uint8_t[]){ 0x8b, 0xad, 0x31, 0x55, 0x0b, 0x16, + 0xb2, 0xe9, 0x3b, 0x87, 0x36, 0xd9, + 0x17, 0xad, 0x90, 0x3f }, + .sn_size = 7, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 1, + }, + + /**************************** snow + null ****************************/ + + { + .test_idx = 5, + .param = {.name = "PDCP-SDAP Uplane: 7b SN, SNOW-f8_ENC Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0xad, 0x9c, 0x44, 0x1f, 0x89, + 0x0b, 0x38, 0xc4, 0x57, 0xa4, 0x9d, + 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 16, + .data_out = (uint8_t[]){ 0x8b, 0xad, 0xb1, 0x17, 0xbe, 0xb1, + 0x60, 0xbb, 0xd6, 0x3f, 0x36, 0x96, + 0x96, 0xcd, 0x2d, 0xa7 }, + .sn_size = 7, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 0, + }, + + /**************************** snow + null ****************************/ + + { + .test_idx = 6, + .param = {.name = + "PDCP-SDAP Uplane: 7b SN, SNOW-f8_ENC Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0xad, 0x9c, 0x44, 0x1f, 0x89, + 0x0b, 0x38, 0xc4, 0x57, 0xa4, 0x9d, + 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 16, + .data_out = (uint8_t[]){ 0x8b, 0xad, 0xd3, 0x89, 0x03, 0x1e, + 0x7d, 0x29, 0xfc, 0x77, 0x94, 0x3c, + 0x99, 0x72, 0x3c, 0xe8 }, + .sn_size = 7, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 1, + }, + + /**************************** zuc + null ****************************/ + + { + .test_idx = 7, + .param = {.name = "PDCP-SDAP Uplane: 7b SN, ZUC_ENC Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0xad, 0x9c, 0x44, 0x1f, 0x89, + 0x0b, 0x38, 0xc4, 0x57, 0xa4, 0x9d, + 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 16, + .data_out = (uint8_t[]){ 0x8b, 0xad, 0xfa, 0xad, 0x58, 0x43, + 0x6f, 0xd9, 0x8f, 0xaa, 0x06, 0x3e, + 0xdc, 0x52, 0x42, 0x26 }, + .sn_size = 7, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 0, + }, + + /**************************** zuc + null ****************************/ + + { + .test_idx = 8, + .param = {.name = "PDCP-SDAP Uplane: 7b SN, ZUC_ENC Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0xad, 0x9c, 0x44, 0x1f, 0x89, + 0x0b, 0x38, 0xc4, 0x57, 0xa4, 0x9d, + 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 16, + .data_out = (uint8_t[]){ 0x8b, 0xad, 0xd8, 0x0a, 0x12, 0xe9, + 0x7f, 0xab, 0x63, 0x57, 0x99, 0xf2, + 0x39, 0x18, 0x32, 0xdc }, + .sn_size = 7, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 1, + }, + + /***************************** 12bit **********************************/ + + /**************************** null + null ****************************/ + + { + .test_idx = 9, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, NULL_ENC and NULL_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** null + null ****************************/ + + { + .test_idx = 10, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, NULL_ENC and NULL_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /************************ null + aes-cmac ****************************/ + + { + .test_idx = 11, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, NULL_ENC and AES-CMAC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd, 0x3f, 0x71, 0x26, 0x2e }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /************************ null + aes-cmac ****************************/ + + { + .test_idx = 12, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, NULL_ENC and AES-CMAC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd, 0x92, 0xae, 0xfe, 0xf8 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** null + snow ****************************/ + + { + .test_idx = 13, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, NULL_ENC and SNOW-f9_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd, 0x74, 0xb8, 0x27, 0x96 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** null + snow ****************************/ + + { + .test_idx = 14, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, NULL_ENC and SNOW-f9_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd, 0x3d, 0x8b, 0x0d, 0xa8 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** null + zuc ****************************/ + + { + .test_idx = 15, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, NULL_ENC and ZUC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd, 0x54, 0xef, 0x25, 0xc3 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** null + zuc ****************************/ + + { + .test_idx = 16, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, NULL_ENC and ZUC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd, 0xf7, 0x16, 0xd4, 0x94 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** aes-ctr + null *************************/ + + { + .test_idx = 17, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, AES-CTR_ENC and NULL_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x69, 0xf2, 0x5d, 0xd7, + 0xf5, 0xc1, 0xf7, 0x1e, 0x47, 0x5d, 0xce, + 0xbe, 0x48, 0xb5, 0x0b, 0x6a, 0x73, 0x9a, + 0x5a, 0xa3, 0x06, 0x47, 0x40, 0x96, 0xcf, + 0x86, 0x98, 0x3d, 0x6f, 0xcf, 0x17, 0x41, + 0xa5, 0x13, 0xa5, 0x35, 0x9a, 0xa6, 0x24, + 0xc9, 0x7f, 0x11, 0x79, 0x24, 0x44, 0xe8, + 0x39, 0x11, 0x03, 0x0a, 0x9d, 0x4f, 0xe2, + 0x95, 0x9f, 0x47, 0x73, 0x37, 0x83, 0x8c, + 0x23, 0xfa, 0x16, 0x06, 0x86, 0x33, 0x3f }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /************************* aes-ctr + null ****************************/ + + { + .test_idx = 18, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, AES-CTR_ENC and NULL_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x22, 0x2a, 0x8f, 0x86, + 0x25, 0x92, 0xcd, 0xa9, 0xa1, 0xa0, 0xf5, + 0x86, 0x0d, 0xe8, 0xe4, 0xef, 0xe0, 0x78, + 0x45, 0x7c, 0x0c, 0x41, 0x5c, 0x8f, 0x07, + 0x6f, 0xec, 0x2f, 0x99, 0x8b, 0xfd, 0x9c, + 0x4a, 0x6a, 0xe4, 0x5d, 0xd3, 0x3c, 0x40, + 0x35, 0xff, 0x7a, 0x42, 0xac, 0x94, 0x21, + 0x60, 0x1c, 0x13, 0xcc, 0x7e, 0x6b, 0x2f, + 0x6f, 0x91, 0x89, 0xc6, 0xd4, 0xe6, 0x17, + 0xae, 0xde, 0xfb, 0x02, 0xcc, 0xa7, 0x33 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /********************* aes-ctr + aes-cmac ****************************/ + + { + .test_idx = 19, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, AES-CTR_ENC and AES-CMAC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x69, 0xf2, 0x5d, 0xd7, + 0xf5, 0xc1, 0xf7, 0x1e, 0x47, 0x5d, 0xce, + 0xbe, 0x48, 0xb5, 0x0b, 0x6a, 0x73, 0x9a, + 0x5a, 0xa3, 0x06, 0x47, 0x40, 0x96, 0xcf, + 0x86, 0x98, 0x3d, 0x6f, 0xcf, 0x17, 0x41, + 0xa5, 0x13, 0xa5, 0x35, 0x9a, 0xa6, 0x24, + 0xc9, 0x7f, 0x11, 0x79, 0x24, 0x44, 0xe8, + 0x39, 0x11, 0x03, 0x0a, 0x9d, 0x4f, 0xe2, + 0x95, 0x9f, 0x47, 0x73, 0x37, 0x83, 0x8c, + 0x23, 0xfa, 0x16, 0x39, 0xf7, 0x15, 0x11 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /********************* aes-ctr + aes-cmac ****************************/ + + { + .test_idx = 20, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, AES-CTR_ENC and AES-CMAC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x22, 0x2a, 0x8f, 0x86, + 0x25, 0x92, 0xcd, 0xa9, 0xa1, 0xa0, 0xf5, + 0x86, 0x0d, 0xe8, 0xe4, 0xef, 0xe0, 0x78, + 0x45, 0x7c, 0x0c, 0x41, 0x5c, 0x8f, 0x07, + 0x6f, 0xec, 0x2f, 0x99, 0x8b, 0xfd, 0x9c, + 0x4a, 0x6a, 0xe4, 0x5d, 0xd3, 0x3c, 0x40, + 0x35, 0xff, 0x7a, 0x42, 0xac, 0x94, 0x21, + 0x60, 0x1c, 0x13, 0xcc, 0x7e, 0x6b, 0x2f, + 0x6f, 0x91, 0x89, 0xc6, 0xd4, 0xe6, 0x17, + 0xae, 0xde, 0xfb, 0x90, 0x62, 0x59, 0xcb }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /************************* aes-ctr + snow ****************************/ + + { + .test_idx = 21, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, AES-CTR_ENC and SNOW-f9_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x69, 0xf2, 0x5d, 0xd7, + 0xf5, 0xc1, 0xf7, 0x1e, 0x47, 0x5d, 0xce, + 0xbe, 0x48, 0xb5, 0x0b, 0x6a, 0x73, 0x9a, + 0x5a, 0xa3, 0x06, 0x47, 0x40, 0x96, 0xcf, + 0x86, 0x98, 0x3d, 0x6f, 0xcf, 0x17, 0x41, + 0xa5, 0x13, 0xa5, 0x35, 0x9a, 0xa6, 0x24, + 0xc9, 0x7f, 0x11, 0x79, 0x24, 0x44, 0xe8, + 0x39, 0x11, 0x03, 0x0a, 0x9d, 0x4f, 0xe2, + 0x95, 0x9f, 0x47, 0x73, 0x37, 0x83, 0x8c, + 0x23, 0xfa, 0x16, 0x72, 0x3e, 0x14, 0xa9 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /************************* aes-ctr + snow ****************************/ + + { + .test_idx = 22, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, AES-CTR_ENC and SNOW-f9_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x22, 0x2a, 0x8f, 0x86, + 0x25, 0x92, 0xcd, 0xa9, 0xa1, 0xa0, 0xf5, + 0x86, 0x0d, 0xe8, 0xe4, 0xef, 0xe0, 0x78, + 0x45, 0x7c, 0x0c, 0x41, 0x5c, 0x8f, 0x07, + 0x6f, 0xec, 0x2f, 0x99, 0x8b, 0xfd, 0x9c, + 0x4a, 0x6a, 0xe4, 0x5d, 0xd3, 0x3c, 0x40, + 0x35, 0xff, 0x7a, 0x42, 0xac, 0x94, 0x21, + 0x60, 0x1c, 0x13, 0xcc, 0x7e, 0x6b, 0x2f, + 0x6f, 0x91, 0x89, 0xc6, 0xd4, 0xe6, 0x17, + 0xae, 0xde, 0xfb, 0x3f, 0x47, 0xaa, 0x9b }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** aes-ctr + zuc **************************/ + + { + .test_idx = 23, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, AES-CTR_ENC and ZUC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ + 0x50, 0x01, 0x86, 0x69, 0xf2, 0x5d, 0xd7, 0xf5, + 0xc1, 0xf7, 0x1e, 0x47, 0x5d, 0xce, 0xbe, 0x48, + 0xb5, 0x0b, 0x6a, 0x73, 0x9a, 0x5a, 0xa3, 0x06, + 0x47, 0x40, 0x96, 0xcf, 0x86, 0x98, 0x3d, 0x6f, + 0xcf, 0x17, 0x41, 0xa5, 0x13, 0xa5, 0x35, 0x9a, + 0xa6, 0x24, 0xc9, 0x7f, 0x11, 0x79, 0x24, 0x44, + 0xe8, 0x39, 0x11, 0x03, 0x0a, 0x9d, 0x4f, 0xe2, + 0x95, 0x9f, 0x47, 0x73, 0x37, 0x83, 0x8c, 0x23, + 0xfa, 0x16, 0x52, 0x69, 0x16, 0xfc, + }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** aes-ctr + zuc **************************/ + + { + .test_idx = 24, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, AES-CTR_ENC and ZUC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x22, 0x2a, 0x8f, 0x86, + 0x25, 0x92, 0xcd, 0xa9, 0xa1, 0xa0, 0xf5, + 0x86, 0x0d, 0xe8, 0xe4, 0xef, 0xe0, 0x78, + 0x45, 0x7c, 0x0c, 0x41, 0x5c, 0x8f, 0x07, + 0x6f, 0xec, 0x2f, 0x99, 0x8b, 0xfd, 0x9c, + 0x4a, 0x6a, 0xe4, 0x5d, 0xd3, 0x3c, 0x40, + 0x35, 0xff, 0x7a, 0x42, 0xac, 0x94, 0x21, + 0x60, 0x1c, 0x13, 0xcc, 0x7e, 0x6b, 0x2f, + 0x6f, 0x91, 0x89, 0xc6, 0xd4, 0xe6, 0x17, + 0xae, 0xde, 0xfb, 0xf5, 0xda, 0x73, 0xa7 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** snow + null ****************************/ + + { + .test_idx = 25, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, SNOW-f8_ENC and NULL_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xe8, 0x8c, 0x96, 0x38, + 0x6e, 0xe4, 0x1f, 0xb9, 0x85, 0x61, 0x2e, + 0x64, 0x31, 0x22, 0x97, 0x5b, 0xf6, 0x40, + 0x08, 0x65, 0xc3, 0xfa, 0x72, 0xd2, 0x22, + 0x37, 0x8e, 0x4d, 0xc1, 0xac, 0x7c, 0x7d, + 0x03, 0xf1, 0x50, 0x9f, 0x97, 0x67, 0x4e, + 0x23, 0x80, 0xcc, 0x5f, 0xfd, 0x74, 0xb1, + 0xfb, 0xe1, 0xea, 0x6f, 0xf9, 0x9d, 0xf3, + 0x90, 0x02, 0x6e, 0xf1, 0xf8, 0x95, 0x97, + 0xbd, 0xba, 0x08, 0x06, 0x12, 0x07, 0xac }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** snow + null ****************************/ + + { + .test_idx = 26, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, SNOW-f8_ENC and NULL_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xd2, 0xc0, 0x3a, 0x41, + 0xbc, 0x0b, 0x95, 0xa4, 0x57, 0x3e, 0x36, + 0x10, 0xb2, 0xff, 0x48, 0x1f, 0x10, 0xa8, + 0x06, 0x42, 0xc5, 0xa2, 0x33, 0xed, 0x2e, + 0x37, 0x23, 0x04, 0x06, 0x84, 0xb9, 0x4c, + 0x1b, 0x17, 0xf3, 0x16, 0xc4, 0xd1, 0xa8, + 0x35, 0xd2, 0x31, 0x1a, 0xb8, 0x33, 0xc7, + 0x9c, 0xa4, 0xa4, 0x9b, 0x20, 0xc6, 0x47, + 0xdd, 0xe5, 0xa3, 0x4b, 0x9e, 0x66, 0xde, + 0xc9, 0x0a, 0x64, 0x1c, 0xd7, 0x20, 0x52 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** snow + aes-cmac ************************/ + + { + .test_idx = 27, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, SNOW-f8_ENC and AES-CMAC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xe8, 0x8c, 0x96, 0x38, + 0x6e, 0xe4, 0x1f, 0xb9, 0x85, 0x61, 0x2e, + 0x64, 0x31, 0x22, 0x97, 0x5b, 0xf6, 0x40, + 0x08, 0x65, 0xc3, 0xfa, 0x72, 0xd2, 0x22, + 0x37, 0x8e, 0x4d, 0xc1, 0xac, 0x7c, 0x7d, + 0x03, 0xf1, 0x50, 0x9f, 0x97, 0x67, 0x4e, + 0x23, 0x80, 0xcc, 0x5f, 0xfd, 0x74, 0xb1, + 0xfb, 0xe1, 0xea, 0x6f, 0xf9, 0x9d, 0xf3, + 0x90, 0x02, 0x6e, 0xf1, 0xf8, 0x95, 0x97, + 0xbd, 0xba, 0x08, 0x39, 0x63, 0x21, 0x82 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** snow + aes-cmac ************************/ + + { + .test_idx = 28, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, SNOW-f8_ENC and AES-CMAC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xd2, 0xc0, 0x3a, 0x41, + 0xbc, 0x0b, 0x95, 0xa4, 0x57, 0x3e, 0x36, + 0x10, 0xb2, 0xff, 0x48, 0x1f, 0x10, 0xa8, + 0x06, 0x42, 0xc5, 0xa2, 0x33, 0xed, 0x2e, + 0x37, 0x23, 0x04, 0x06, 0x84, 0xb9, 0x4c, + 0x1b, 0x17, 0xf3, 0x16, 0xc4, 0xd1, 0xa8, + 0x35, 0xd2, 0x31, 0x1a, 0xb8, 0x33, 0xc7, + 0x9c, 0xa4, 0xa4, 0x9b, 0x20, 0xc6, 0x47, + 0xdd, 0xe5, 0xa3, 0x4b, 0x9e, 0x66, 0xde, + 0xc9, 0x0a, 0x64, 0x8e, 0x79, 0xde, 0xaa }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** snow + snow ****************************/ + + { + .test_idx = 29, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, SNOW-f8_ENC and SNOW-f9_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xe8, 0x8c, 0x96, 0x38, + 0x6e, 0xe4, 0x1f, 0xb9, 0x85, 0x61, 0x2e, + 0x64, 0x31, 0x22, 0x97, 0x5b, 0xf6, 0x40, + 0x08, 0x65, 0xc3, 0xfa, 0x72, 0xd2, 0x22, + 0x37, 0x8e, 0x4d, 0xc1, 0xac, 0x7c, 0x7d, + 0x03, 0xf1, 0x50, 0x9f, 0x97, 0x67, 0x4e, + 0x23, 0x80, 0xcc, 0x5f, 0xfd, 0x74, 0xb1, + 0xfb, 0xe1, 0xea, 0x6f, 0xf9, 0x9d, 0xf3, + 0x90, 0x02, 0x6e, 0xf1, 0xf8, 0x95, 0x97, + 0xbd, 0xba, 0x08, 0x72, 0xaa, 0x20, 0x3a }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** snow + snow ****************************/ + + { + .test_idx = 30, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, SNOW-f8_ENC and SNOW-f9_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xd2, 0xc0, 0x3a, 0x41, + 0xbc, 0x0b, 0x95, 0xa4, 0x57, 0x3e, 0x36, + 0x10, 0xb2, 0xff, 0x48, 0x1f, 0x10, 0xa8, + 0x06, 0x42, 0xc5, 0xa2, 0x33, 0xed, 0x2e, + 0x37, 0x23, 0x04, 0x06, 0x84, 0xb9, 0x4c, + 0x1b, 0x17, 0xf3, 0x16, 0xc4, 0xd1, 0xa8, + 0x35, 0xd2, 0x31, 0x1a, 0xb8, 0x33, 0xc7, + 0x9c, 0xa4, 0xa4, 0x9b, 0x20, 0xc6, 0x47, + 0xdd, 0xe5, 0xa3, 0x4b, 0x9e, 0x66, 0xde, + 0xc9, 0x0a, 0x64, 0x21, 0x5c, 0x2d, 0xfa }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** snow + zuc ****************************/ + + { + .test_idx = 31, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, SNOW-f8_ENC and ZUC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xe8, 0x8c, 0x96, 0x38, + 0x6e, 0xe4, 0x1f, 0xb9, 0x85, 0x61, 0x2e, + 0x64, 0x31, 0x22, 0x97, 0x5b, 0xf6, 0x40, + 0x08, 0x65, 0xc3, 0xfa, 0x72, 0xd2, 0x22, + 0x37, 0x8e, 0x4d, 0xc1, 0xac, 0x7c, 0x7d, + 0x03, 0xf1, 0x50, 0x9f, 0x97, 0x67, 0x4e, + 0x23, 0x80, 0xcc, 0x5f, 0xfd, 0x74, 0xb1, + 0xfb, 0xe1, 0xea, 0x6f, 0xf9, 0x9d, 0xf3, + 0x90, 0x02, 0x6e, 0xf1, 0xf8, 0x95, 0x97, + 0xbd, 0xba, 0x08, 0x52, 0xfd, 0x22, 0x6f }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** snow + zuc ****************************/ + + { + .test_idx = 32, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, SNOW-f8_ENC and ZUC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xd2, 0xc0, 0x3a, 0x41, + 0xbc, 0x0b, 0x95, 0xa4, 0x57, 0x3e, 0x36, + 0x10, 0xb2, 0xff, 0x48, 0x1f, 0x10, 0xa8, + 0x06, 0x42, 0xc5, 0xa2, 0x33, 0xed, 0x2e, + 0x37, 0x23, 0x04, 0x06, 0x84, 0xb9, 0x4c, + 0x1b, 0x17, 0xf3, 0x16, 0xc4, 0xd1, 0xa8, + 0x35, 0xd2, 0x31, 0x1a, 0xb8, 0x33, 0xc7, + 0x9c, 0xa4, 0xa4, 0x9b, 0x20, 0xc6, 0x47, + 0xdd, 0xe5, 0xa3, 0x4b, 0x9e, 0x66, 0xde, + 0xc9, 0x0a, 0x64, 0xeb, 0xc1, 0xf4, 0xc6 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** zuc + null ****************************/ + + { + .test_idx = 33, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, ZUC_ENC and NULL_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x79, 0xdb, 0x02, 0x27, + 0xa0, 0x85, 0x82, 0x87, 0x6b, 0x35, 0x2b, + 0xe1, 0x96, 0x5b, 0xfd, 0x67, 0xe1, 0x67, + 0x69, 0x17, 0x5b, 0x0a, 0x8f, 0xb8, 0x37, + 0xeb, 0xb8, 0x3f, 0x13, 0x7b, 0x88, 0x40, + 0x29, 0x67, 0x21, 0xf9, 0xc0, 0xaf, 0xca, + 0xda, 0x94, 0x61, 0x8e, 0x2d, 0x7a, 0x5d, + 0x64, 0x0f, 0x4a, 0xc7, 0x7c, 0x9d, 0x56, + 0x5a, 0x2a, 0xcb, 0xff, 0x79, 0x07, 0xa5, + 0xaf, 0x96, 0x5c, 0x89, 0x1d, 0xcd, 0x3a }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** zuc + null ****************************/ + + { + .test_idx = 34, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, ZUC_ENC and NULL_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x2c, 0x0f, 0xc1, 0x08, + 0x2e, 0xa7, 0x97, 0xd2, 0x6c, 0x17, 0x8f, + 0x22, 0x1f, 0x99, 0x1b, 0x48, 0x04, 0x29, + 0x54, 0x3f, 0x07, 0x01, 0xda, 0x19, 0x59, + 0x74, 0x17, 0x45, 0x46, 0x7e, 0x6c, 0x0b, + 0xc5, 0x6e, 0x90, 0xa7, 0x1e, 0x8d, 0x01, + 0x04, 0xf4, 0xfe, 0xe6, 0xf7, 0x53, 0x51, + 0x70, 0x10, 0x56, 0x83, 0x59, 0xb5, 0x64, + 0x0b, 0xa6, 0x2e, 0xa5, 0x03, 0x62, 0x13, + 0x91, 0xaf, 0x24, 0x20, 0x2c, 0x05, 0xdf }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** zuc + aes-cmac *************************/ + + { + .test_idx = 35, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, ZUC_ENC and AES-CMAC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x79, 0xdb, 0x02, 0x27, + 0xa0, 0x85, 0x82, 0x87, 0x6b, 0x35, 0x2b, + 0xe1, 0x96, 0x5b, 0xfd, 0x67, 0xe1, 0x67, + 0x69, 0x17, 0x5b, 0x0a, 0x8f, 0xb8, 0x37, + 0xeb, 0xb8, 0x3f, 0x13, 0x7b, 0x88, 0x40, + 0x29, 0x67, 0x21, 0xf9, 0xc0, 0xaf, 0xca, + 0xda, 0x94, 0x61, 0x8e, 0x2d, 0x7a, 0x5d, + 0x64, 0x0f, 0x4a, 0xc7, 0x7c, 0x9d, 0x56, + 0x5a, 0x2a, 0xcb, 0xff, 0x79, 0x07, 0xa5, + 0xaf, 0x96, 0x5c, 0xb6, 0x6c, 0xeb, 0x14 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** zuc + aes-cmac *************************/ + + { + .test_idx = 36, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, ZUC_ENC and AES-CMAC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x2c, 0x0f, 0xc1, 0x08, + 0x2e, 0xa7, 0x97, 0xd2, 0x6c, 0x17, 0x8f, + 0x22, 0x1f, 0x99, 0x1b, 0x48, 0x04, 0x29, + 0x54, 0x3f, 0x07, 0x01, 0xda, 0x19, 0x59, + 0x74, 0x17, 0x45, 0x46, 0x7e, 0x6c, 0x0b, + 0xc5, 0x6e, 0x90, 0xa7, 0x1e, 0x8d, 0x01, + 0x04, 0xf4, 0xfe, 0xe6, 0xf7, 0x53, 0x51, + 0x70, 0x10, 0x56, 0x83, 0x59, 0xb5, 0x64, + 0x0b, 0xa6, 0x2e, 0xa5, 0x03, 0x62, 0x13, + 0x91, 0xaf, 0x24, 0xb2, 0x82, 0xfb, 0x27 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** zuc + snow ****************************/ + + { + .test_idx = 37, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, ZUC_ENC and SNOW-f9_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x79, 0xdb, 0x02, 0x27, + 0xa0, 0x85, 0x82, 0x87, 0x6b, 0x35, 0x2b, + 0xe1, 0x96, 0x5b, 0xfd, 0x67, 0xe1, 0x67, + 0x69, 0x17, 0x5b, 0x0a, 0x8f, 0xb8, 0x37, + 0xeb, 0xb8, 0x3f, 0x13, 0x7b, 0x88, 0x40, + 0x29, 0x67, 0x21, 0xf9, 0xc0, 0xaf, 0xca, + 0xda, 0x94, 0x61, 0x8e, 0x2d, 0x7a, 0x5d, + 0x64, 0x0f, 0x4a, 0xc7, 0x7c, 0x9d, 0x56, + 0x5a, 0x2a, 0xcb, 0xff, 0x79, 0x07, 0xa5, + 0xaf, 0x96, 0x5c, 0xfd, 0xa5, 0xea, 0xac }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** zuc + snow ****************************/ + + { + .test_idx = 38, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, ZUC_ENC and SNOW-f9_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x2c, 0x0f, 0xc1, 0x08, + 0x2e, 0xa7, 0x97, 0xd2, 0x6c, 0x17, 0x8f, + 0x22, 0x1f, 0x99, 0x1b, 0x48, 0x04, 0x29, + 0x54, 0x3f, 0x07, 0x01, 0xda, 0x19, 0x59, + 0x74, 0x17, 0x45, 0x46, 0x7e, 0x6c, 0x0b, + 0xc5, 0x6e, 0x90, 0xa7, 0x1e, 0x8d, 0x01, + 0x04, 0xf4, 0xfe, 0xe6, 0xf7, 0x53, 0x51, + 0x70, 0x10, 0x56, 0x83, 0x59, 0xb5, 0x64, + 0x0b, 0xa6, 0x2e, 0xa5, 0x03, 0x62, 0x13, + 0x91, 0xaf, 0x24, 0x1d, 0xa7, 0x08, 0x77 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** zuc + zuc ****************************/ + + { + .test_idx = 39, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, ZUC_ENC and ZUC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x79, 0xdb, 0x02, 0x27, + 0xa0, 0x85, 0x82, 0x87, 0x6b, 0x35, 0x2b, + 0xe1, 0x96, 0x5b, 0xfd, 0x67, 0xe1, 0x67, + 0x69, 0x17, 0x5b, 0x0a, 0x8f, 0xb8, 0x37, + 0xeb, 0xb8, 0x3f, 0x13, 0x7b, 0x88, 0x40, + 0x29, 0x67, 0x21, 0xf9, 0xc0, 0xaf, 0xca, + 0xda, 0x94, 0x61, 0x8e, 0x2d, 0x7a, 0x5d, + 0x64, 0x0f, 0x4a, 0xc7, 0x7c, 0x9d, 0x56, + 0x5a, 0x2a, 0xcb, 0xff, 0x79, 0x07, 0xa5, + 0xaf, 0x96, 0x5c, 0xdd, 0xf2, 0xe8, 0xf9 }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** zuc + zuc ****************************/ + + { + .test_idx = 40, + .param = {.name = + "PDCP-SDAP Uplane: 12b SN, ZUC_ENC and ZUC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x40, 0x19, 0xe2, 0x99, 0x16, 0xc3, + 0x7e, 0x9b, 0xa6, 0x8f, 0x57, 0xbe, + 0x97, 0xfd, 0x02, 0xcb }, + .auth_key = (uint8_t[]){ 0x4d, 0x4b, 0x2b, 0x1e, 0x39, 0x60, + 0x0a, 0x98, 0xc1, 0x3c, 0x98, 0x82, + 0xdc, 0xb6, 0xc2, 0x36 }, + .data_in = + (uint8_t[]){ 0x50, 0x01, 0x86, 0xb8, 0xf8, 0xdb, 0x2d, + 0x3f, 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, + 0x88, 0x63, 0x08, 0x4f, 0xd3, 0x71, 0xfb, + 0xeb, 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, + 0x3f, 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, + 0x9c, 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, + 0x15, 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, + 0x2c, 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, + 0x01, 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, + 0x7a, 0xf9, 0xdd }, + .in_len = 66, + .data_out = + (uint8_t[]){ 0x50, 0x01, 0x86, 0x2c, 0x0f, 0xc1, 0x08, + 0x2e, 0xa7, 0x97, 0xd2, 0x6c, 0x17, 0x8f, + 0x22, 0x1f, 0x99, 0x1b, 0x48, 0x04, 0x29, + 0x54, 0x3f, 0x07, 0x01, 0xda, 0x19, 0x59, + 0x74, 0x17, 0x45, 0x46, 0x7e, 0x6c, 0x0b, + 0xc5, 0x6e, 0x90, 0xa7, 0x1e, 0x8d, 0x01, + 0x04, 0xf4, 0xfe, 0xe6, 0xf7, 0x53, 0x51, + 0x70, 0x10, 0x56, 0x83, 0x59, 0xb5, 0x64, + 0x0b, 0xa6, 0x2e, 0xa5, 0x03, 0x62, 0x13, + 0x91, 0xaf, 0x24, 0xd7, 0x3a, 0xd1, 0x4b }, + .sn_size = 12, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /***************************** 15bit **********************************/ + + /**************************** null + null ****************************/ + + { + .test_idx = 41, + .param = {.name = "PDCP-SDAP Uplane: 15b SN, NULL_ENC Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x9c, 0x44, 0x1f, + 0x89, 0x0b, 0x38, 0xc4, 0x57, 0xa4, + 0x9d, 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 17, + .data_out = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x9c, 0x44, 0x1f, + 0x89, 0x0b, 0x38, 0xc4, 0x57, 0xa4, + 0x9d, 0x42, 0x14, 0x07, 0xe8 }, + .sn_size = 15, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 0, + }, + + /**************************** null + null ****************************/ + + { + .test_idx = 42, + .param = {.name = + "PDCP-SDAP Uplane: 15b SN, NULL_ENC Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x9c, 0x44, 0x1f, + 0x89, 0x0b, 0x38, 0xc4, 0x57, 0xa4, + 0x9d, 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 17, + .data_out = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x9c, 0x44, 0x1f, + 0x89, 0x0b, 0x38, 0xc4, 0x57, 0xa4, + 0x9d, 0x42, 0x14, 0x07, 0xe8 }, + .sn_size = 15, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 1, + }, + + /**************************** aes-ctr + null *************************/ + + { + .test_idx = 43, + .param = {.name = + "PDCP-SDAP Uplane: 15b SN, AES-CTR_ENC Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x9c, 0x44, 0x1f, + 0x89, 0x0b, 0x38, 0xc4, 0x57, 0xa4, + 0x9d, 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 17, + .data_out = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x90, 0xf6, 0xf8, + 0xf2, 0x2b, 0xb2, 0x40, 0x40, 0x9c, + 0xd6, 0x31, 0x66, 0x62, 0xcc }, + .sn_size = 15, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 0, + }, + + /**************************** aes-ctr + null *************************/ + + { + .test_idx = 44, + .param = {.name = + "PDCP-SDAP Uplane: 15b SN, AES-CTR_ENC Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x9c, 0x44, 0x1f, + 0x89, 0x0b, 0x38, 0xc4, 0x57, 0xa4, + 0x9d, 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 17, + .data_out = (uint8_t[]){ 0x8b, 0x26, 0xad, 0xf6, 0x2a, 0x78, + 0x25, 0x3c, 0xf3, 0x23, 0x56, 0x1e, + 0x0e, 0xea, 0x2a, 0x75, 0x4c }, + .sn_size = 15, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 1, + }, + + /**************************** snow + null ****************************/ + + { + .test_idx = 45, + .param = {.name = + "PDCP-SDAP Uplane: 15b SN, SNOW-f8_ENC Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x9c, 0x44, 0x1f, + 0x89, 0x0b, 0x38, 0xc4, 0x57, 0xa4, + 0x9d, 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 17, + .data_out = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x8f, 0xaa, 0x5e, + 0xee, 0x10, 0xdf, 0x4d, 0xdc, 0x2e, + 0x64, 0x23, 0x36, 0x3f, 0x75 }, + .sn_size = 15, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 0, + }, + + /**************************** snow + null ****************************/ + + { + .test_idx = 46, + .param = {.name = + "PDCP-SDAP Uplane: 15b SN, SNOW-f8_ENC Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x9c, 0x44, 0x1f, + 0x89, 0x0b, 0x38, 0xc4, 0x57, 0xa4, + 0x9d, 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 17, + .data_out = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x3a, 0x88, 0xa8, + 0x69, 0xb5, 0xd0, 0x97, 0x3c, 0xfb, + 0xe1, 0x29, 0x49, 0xd9, 0x80 }, + .sn_size = 15, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 1, + }, + + /**************************** zuc + null ****************************/ + + { + .test_idx = 47, + .param = {.name = "PDCP-SDAP Uplane: 15b SN, ZUC_ENC Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x9c, 0x44, 0x1f, + 0x89, 0x0b, 0x38, 0xc4, 0x57, 0xa4, + 0x9d, 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 17, + .data_out = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x30, 0xd2, 0xe1, + 0xef, 0x7a, 0xd6, 0x63, 0xb1, 0xc4, + 0x92, 0x83, 0x28, 0xbe, 0x39 }, + .sn_size = 15, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 0, + }, + + /**************************** zuc + null ****************************/ + + { + .test_idx = 48, + .param = {.name = + "PDCP-SDAP Uplane: 15b SN, ZUC_ENC Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = 0, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x5a, 0xcb, 0x1d, 0x64, 0x4c, 0x0d, + 0x51, 0x20, 0x4e, 0xa5, 0xf1, 0x45, + 0x10, 0x10, 0xd8, 0x52 }, + .auth_key = NULL, + .data_in = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x9c, 0x44, 0x1f, + 0x89, 0x0b, 0x38, 0xc4, 0x57, 0xa4, + 0x9d, 0x42, 0x14, 0x07, 0xe8 }, + .in_len = 17, + .data_out = (uint8_t[]){ 0x8b, 0x26, 0xad, 0x92, 0xc2, 0x45, + 0xb4, 0x75, 0x24, 0x76, 0x26, 0xaa, + 0xe1, 0xf4, 0x45, 0xce, 0xfd }, + .sn_size = 15, + .hfn = 0xfa557, + .hfn_threshold = 0xfa558, + .bearer = 0x3, + .packet_direction = 1, + }, + + /***************************** 18bit **********************************/ + + /**************************** null + null ****************************/ + + { + .test_idx = 49, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, NULL_ENC and NULL_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xF8, 0x00, 0x00, 0xF8, 0xDB, 0x2D, 0x3F, + 0x23, 0x82, 0x53, 0xFD, 0x37, 0xDE, 0x88, + 0x63, 0x08, 0x4F, 0xD3, 0x71, 0xFB, 0xEB, + 0x35, 0xF3, 0x64, 0xD3, 0x5E, 0xAF, 0x3F, + 0x57, 0xC2, 0xE2, 0x91, 0x91, 0xA3, 0x9C, + 0xE6, 0x30, 0x69, 0x70, 0x33, 0x8A, 0x15, + 0xD0, 0x36, 0x47, 0x0E, 0x8F, 0xEE, 0x2C, + 0x96, 0x0C, 0xD7, 0x7D, 0x70, 0x1B, 0x01, + 0x7F, 0x96, 0x46, 0x53, 0xB0, 0xA4, 0x7A, + 0xF9, 0xDD, 0xCC, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xF8, 0x00, 0x00, 0xF8, 0xDB, 0x2D, 0x3F, + 0x23, 0x82, 0x53, 0xFD, 0x37, 0xDE, 0x88, + 0x63, 0x08, 0x4F, 0xD3, 0x71, 0xFB, 0xEB, + 0x35, 0xF3, 0x64, 0xD3, 0x5E, 0xAF, 0x3F, + 0x57, 0xC2, 0xE2, 0x91, 0x91, 0xA3, 0x9C, + 0xE6, 0x30, 0x69, 0x70, 0x33, 0x8A, 0x15, + 0xD0, 0x36, 0x47, 0x0E, 0x8F, 0xEE, 0x2C, + 0x96, 0x0C, 0xD7, 0x7D, 0x70, 0x1B, 0x01, + 0x7F, 0x96, 0x46, 0x53, 0xB0, 0xA4, 0x7A, + 0xF9, 0xDD, 0xCC, 0x69 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** null + null ****************************/ + + { + .test_idx = 50, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, NULL_ENC and NULL_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** null + aes-cmac ************************/ + + { + .test_idx = 51, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, NULL_ENC and AES-CMAC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69, 0x70, 0x3e, 0x09, + 0xc7 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** null + aes-cmac ************************/ + + { + .test_idx = 52, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, NULL_ENC and AES-CMAC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69, 0x55, 0x89, 0xe3, + 0x52 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** null + snow ****************************/ + + { + .test_idx = 53, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, NULL_ENC and SNOW-f9_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69, 0x00, 0x45, 0x13, + 0x4c }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** null + snow ****************************/ + + { + .test_idx = 54, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, NULL_ENC and SNOW-f9_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69, 0x73, 0x53, 0x85, + 0x5c }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** null + zuc ****************************/ + + { + .test_idx = 55, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, NULL_ENC and ZUC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69, 0x00, 0x8b, 0x37, + 0x29 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** null + zuc ****************************/ + + { + .test_idx = 56, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, NULL_ENC and ZUC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_NULL, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69, 0xa5, 0xd4, 0xca, + 0xc5 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** aes-ctr + null ************************/ + + { + .test_idx = 57, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, AES-CTR_ENC and NULL_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x78, 0xee, 0x01, + 0x4c, 0x79, 0xc7, 0x14, 0x79, 0x2c, 0x1b, + 0x8a, 0xd0, 0x17, 0xb4, 0xb4, 0xfe, 0xa7, + 0x17, 0x9a, 0x93, 0x5d, 0xad, 0x27, 0x8a, + 0x56, 0xd7, 0x36, 0xec, 0x8d, 0x74, 0xff, + 0x7c, 0x93, 0x4d, 0x89, 0x00, 0x30, 0x40, + 0x37, 0xfb, 0x98, 0x1b, 0x06, 0x1a, 0x76, + 0xf8, 0x07, 0x72, 0xe9, 0xa2, 0x89, 0x47, + 0x95, 0x8f, 0x8f, 0x4e, 0x45, 0x55, 0xd6, + 0x0e, 0xf4, 0xe7, 0xe8, 0x08, 0xe3, 0xc8, + 0x55 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** aes-ctr + null *************************/ + + { + .test_idx = 58, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, AES-CTR_ENC and NULL_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xbf, 0x21, 0xc9, + 0x7d, 0x02, 0x8d, 0xf7, 0xf7, 0x80, 0x50, + 0x60, 0x32, 0x09, 0xb8, 0x69, 0x48, 0xab, + 0x58, 0xf0, 0xd9, 0x63, 0x63, 0x36, 0x01, + 0x3f, 0x95, 0xc3, 0xfa, 0xe1, 0xc7, 0x95, + 0x1f, 0x66, 0x1a, 0xd6, 0x8e, 0xec, 0x0e, + 0x4c, 0x00, 0xd0, 0x0e, 0x31, 0x1c, 0x87, + 0xee, 0x1c, 0xc3, 0x81, 0xb4, 0xb6, 0x09, + 0xb5, 0x3c, 0x85, 0xb9, 0xcc, 0x2d, 0x2e, + 0x9c, 0x85, 0x0b, 0xf7, 0xe4, 0x09, 0xd3, + 0xf7 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** aes-ctr + aes-cmac *********************/ + + { + .test_idx = 59, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, AES-CTR_ENC and AES-CMAC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x78, 0xee, 0x01, + 0x4c, 0x79, 0xc7, 0x14, 0x79, 0x2c, 0x1b, + 0x8a, 0xd0, 0x17, 0xb4, 0xb4, 0xfe, 0xa7, + 0x17, 0x9a, 0x93, 0x5d, 0xad, 0x27, 0x8a, + 0x56, 0xd7, 0x36, 0xec, 0x8d, 0x74, 0xff, + 0x7c, 0x93, 0x4d, 0x89, 0x00, 0x30, 0x40, + 0x37, 0xfb, 0x98, 0x1b, 0x06, 0x1a, 0x76, + 0xf8, 0x07, 0x72, 0xe9, 0xa2, 0x89, 0x47, + 0x95, 0x8f, 0x8f, 0x4e, 0x45, 0x55, 0xd6, + 0x0e, 0xf4, 0xe7, 0xe8, 0x78, 0xdd, 0xc1, + 0x92 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** aes-ctr + aes-cmac *********************/ + + { + .test_idx = 60, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, AES-CTR_ENC and AES-CMAC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xbf, 0x21, 0xc9, + 0x7d, 0x02, 0x8d, 0xf7, 0xf7, 0x80, 0x50, + 0x60, 0x32, 0x09, 0xb8, 0x69, 0x48, 0xab, + 0x58, 0xf0, 0xd9, 0x63, 0x63, 0x36, 0x01, + 0x3f, 0x95, 0xc3, 0xfa, 0xe1, 0xc7, 0x95, + 0x1f, 0x66, 0x1a, 0xd6, 0x8e, 0xec, 0x0e, + 0x4c, 0x00, 0xd0, 0x0e, 0x31, 0x1c, 0x87, + 0xee, 0x1c, 0xc3, 0x81, 0xb4, 0xb6, 0x09, + 0xb5, 0x3c, 0x85, 0xb9, 0xcc, 0x2d, 0x2e, + 0x9c, 0x85, 0x0b, 0xf7, 0xb1, 0x80, 0x30, + 0xa5 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** aes-ctr + snow ************************/ + + { + .test_idx = 61, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, AES-CTR_ENC and SNOW-f9_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x78, 0xee, 0x01, + 0x4c, 0x79, 0xc7, 0x14, 0x79, 0x2c, 0x1b, + 0x8a, 0xd0, 0x17, 0xb4, 0xb4, 0xfe, 0xa7, + 0x17, 0x9a, 0x93, 0x5d, 0xad, 0x27, 0x8a, + 0x56, 0xd7, 0x36, 0xec, 0x8d, 0x74, 0xff, + 0x7c, 0x93, 0x4d, 0x89, 0x00, 0x30, 0x40, + 0x37, 0xfb, 0x98, 0x1b, 0x06, 0x1a, 0x76, + 0xf8, 0x07, 0x72, 0xe9, 0xa2, 0x89, 0x47, + 0x95, 0x8f, 0x8f, 0x4e, 0x45, 0x55, 0xd6, + 0x0e, 0xf4, 0xe7, 0xe8, 0x08, 0xa6, 0xdb, + 0x19 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** aes-ctr + snow ************************/ + + { + .test_idx = 62, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, AES-CTR_ENC and SNOW-f9_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xbf, 0x21, 0xc9, + 0x7d, 0x02, 0x8d, 0xf7, 0xf7, 0x80, 0x50, + 0x60, 0x32, 0x09, 0xb8, 0x69, 0x48, 0xab, + 0x58, 0xf0, 0xd9, 0x63, 0x63, 0x36, 0x01, + 0x3f, 0x95, 0xc3, 0xfa, 0xe1, 0xc7, 0x95, + 0x1f, 0x66, 0x1a, 0xd6, 0x8e, 0xec, 0x0e, + 0x4c, 0x00, 0xd0, 0x0e, 0x31, 0x1c, 0x87, + 0xee, 0x1c, 0xc3, 0x81, 0xb4, 0xb6, 0x09, + 0xb5, 0x3c, 0x85, 0xb9, 0xcc, 0x2d, 0x2e, + 0x9c, 0x85, 0x0b, 0xf7, 0x97, 0x5a, 0x56, + 0xab }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** aes-ctr + zuc **************************/ + + { + .test_idx = 63, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, AES-CTR_ENC and ZUC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x78, 0xee, 0x01, + 0x4c, 0x79, 0xc7, 0x14, 0x79, 0x2c, 0x1b, + 0x8a, 0xd0, 0x17, 0xb4, 0xb4, 0xfe, 0xa7, + 0x17, 0x9a, 0x93, 0x5d, 0xad, 0x27, 0x8a, + 0x56, 0xd7, 0x36, 0xec, 0x8d, 0x74, 0xff, + 0x7c, 0x93, 0x4d, 0x89, 0x00, 0x30, 0x40, + 0x37, 0xfb, 0x98, 0x1b, 0x06, 0x1a, 0x76, + 0xf8, 0x07, 0x72, 0xe9, 0xa2, 0x89, 0x47, + 0x95, 0x8f, 0x8f, 0x4e, 0x45, 0x55, 0xd6, + 0x0e, 0xf4, 0xe7, 0xe8, 0x08, 0x68, 0xff, + 0x7c }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** aes-ctr + zuc **************************/ + + { + .test_idx = 64, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, AES-CTR_ENC and ZUC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xbf, 0x21, 0xc9, + 0x7d, 0x02, 0x8d, 0xf7, 0xf7, 0x80, 0x50, + 0x60, 0x32, 0x09, 0xb8, 0x69, 0x48, 0xab, + 0x58, 0xf0, 0xd9, 0x63, 0x63, 0x36, 0x01, + 0x3f, 0x95, 0xc3, 0xfa, 0xe1, 0xc7, 0x95, + 0x1f, 0x66, 0x1a, 0xd6, 0x8e, 0xec, 0x0e, + 0x4c, 0x00, 0xd0, 0x0e, 0x31, 0x1c, 0x87, + 0xee, 0x1c, 0xc3, 0x81, 0xb4, 0xb6, 0x09, + 0xb5, 0x3c, 0x85, 0xb9, 0xcc, 0x2d, 0x2e, + 0x9c, 0x85, 0x0b, 0xf7, 0x41, 0xdd, 0x19, + 0x32 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** snow + null ****************************/ + + { + .test_idx = 65, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, SNOW-f8_ENC and NULL_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x0c, 0xa8, 0x9d, + 0x9e, 0xcc, 0xf0, 0x1a, 0xc0, 0xf2, 0x9f, + 0x8c, 0xc9, 0x57, 0xc7, 0x99, 0x4d, 0xde, + 0xc5, 0x19, 0x69, 0x58, 0x5b, 0x1a, 0x51, + 0x40, 0xa8, 0xc4, 0x93, 0x4b, 0x47, 0xb8, + 0xc4, 0x2a, 0x19, 0x07, 0x80, 0x45, 0xbb, + 0xb3, 0x24, 0x88, 0x68, 0x5f, 0x78, 0x3a, + 0xd2, 0x6c, 0xcc, 0xa0, 0xb5, 0xf0, 0x95, + 0x3e, 0xf1, 0xf4, 0x3e, 0x43, 0x8f, 0x6c, + 0xae, 0x22, 0x59, 0x11, 0x86, 0xa9, 0x02, + 0xbc }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** snow + null ****************************/ + + { + .test_idx = 66, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, SNOW-f8_ENC and NULL_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x5a, 0xa9, 0xb5, + 0x61, 0x8b, 0x8a, 0xb7, 0x6a, 0x98, 0x30, + 0x6c, 0xed, 0x84, 0x69, 0xff, 0x6b, 0x7e, + 0x30, 0x59, 0x55, 0x80, 0x32, 0xd0, 0x0f, + 0x73, 0x43, 0x7c, 0xc3, 0x2e, 0xf4, 0xc3, + 0x3a, 0x60, 0xe3, 0x7c, 0xf0, 0x31, 0xa2, + 0x0e, 0x2e, 0x33, 0xe6, 0xa4, 0xea, 0x17, + 0xd6, 0x56, 0xa2, 0x3b, 0x5f, 0x56, 0x3a, + 0xa7, 0x6f, 0x4c, 0xc1, 0xca, 0xbd, 0x5f, + 0xad, 0x3d, 0x99, 0x4a, 0xf6, 0x22, 0x36, + 0x2e }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** snow + aes-cmac ************************/ + + { + .test_idx = 67, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, SNOW-f8_ENC and AES-CMAC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x0c, 0xa8, 0x9d, + 0x9e, 0xcc, 0xf0, 0x1a, 0xc0, 0xf2, 0x9f, + 0x8c, 0xc9, 0x57, 0xc7, 0x99, 0x4d, 0xde, + 0xc5, 0x19, 0x69, 0x58, 0x5b, 0x1a, 0x51, + 0x40, 0xa8, 0xc4, 0x93, 0x4b, 0x47, 0xb8, + 0xc4, 0x2a, 0x19, 0x07, 0x80, 0x45, 0xbb, + 0xb3, 0x24, 0x88, 0x68, 0x5f, 0x78, 0x3a, + 0xd2, 0x6c, 0xcc, 0xa0, 0xb5, 0xf0, 0x95, + 0x3e, 0xf1, 0xf4, 0x3e, 0x43, 0x8f, 0x6c, + 0xae, 0x22, 0x59, 0x11, 0xf6, 0x97, 0x0b, + 0x7b }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** snow + aes-cmac ************************/ + + { + .test_idx = 68, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, SNOW-f8_ENC and AES-CMAC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x5a, 0xa9, 0xb5, + 0x61, 0x8b, 0x8a, 0xb7, 0x6a, 0x98, 0x30, + 0x6c, 0xed, 0x84, 0x69, 0xff, 0x6b, 0x7e, + 0x30, 0x59, 0x55, 0x80, 0x32, 0xd0, 0x0f, + 0x73, 0x43, 0x7c, 0xc3, 0x2e, 0xf4, 0xc3, + 0x3a, 0x60, 0xe3, 0x7c, 0xf0, 0x31, 0xa2, + 0x0e, 0x2e, 0x33, 0xe6, 0xa4, 0xea, 0x17, + 0xd6, 0x56, 0xa2, 0x3b, 0x5f, 0x56, 0x3a, + 0xa7, 0x6f, 0x4c, 0xc1, 0xca, 0xbd, 0x5f, + 0xad, 0x3d, 0x99, 0x4a, 0xa3, 0xab, 0xd5, + 0x7c }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** snow + snow ****************************/ + + { + .test_idx = 69, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, SNOW-f8_ENC and SNOW-f9_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x0c, 0xa8, 0x9d, + 0x9e, 0xcc, 0xf0, 0x1a, 0xc0, 0xf2, 0x9f, + 0x8c, 0xc9, 0x57, 0xc7, 0x99, 0x4d, 0xde, + 0xc5, 0x19, 0x69, 0x58, 0x5b, 0x1a, 0x51, + 0x40, 0xa8, 0xc4, 0x93, 0x4b, 0x47, 0xb8, + 0xc4, 0x2a, 0x19, 0x07, 0x80, 0x45, 0xbb, + 0xb3, 0x24, 0x88, 0x68, 0x5f, 0x78, 0x3a, + 0xd2, 0x6c, 0xcc, 0xa0, 0xb5, 0xf0, 0x95, + 0x3e, 0xf1, 0xf4, 0x3e, 0x43, 0x8f, 0x6c, + 0xae, 0x22, 0x59, 0x11, 0x86, 0xec, 0x11, + 0xf0 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** snow + snow ****************************/ + + { + .test_idx = 70, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, SNOW-f8_ENC and SNOW-f9_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x5a, 0xa9, 0xb5, + 0x61, 0x8b, 0x8a, 0xb7, 0x6a, 0x98, 0x30, + 0x6c, 0xed, 0x84, 0x69, 0xff, 0x6b, 0x7e, + 0x30, 0x59, 0x55, 0x80, 0x32, 0xd0, 0x0f, + 0x73, 0x43, 0x7c, 0xc3, 0x2e, 0xf4, 0xc3, + 0x3a, 0x60, 0xe3, 0x7c, 0xf0, 0x31, 0xa2, + 0x0e, 0x2e, 0x33, 0xe6, 0xa4, 0xea, 0x17, + 0xd6, 0x56, 0xa2, 0x3b, 0x5f, 0x56, 0x3a, + 0xa7, 0x6f, 0x4c, 0xc1, 0xca, 0xbd, 0x5f, + 0xad, 0x3d, 0x99, 0x4a, 0x85, 0x71, 0xb3, + 0x72 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** snow + zuc ****************************/ + + { + .test_idx = 71, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, SNOW-f8_ENC and ZUC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x0c, 0xa8, 0x9d, + 0x9e, 0xcc, 0xf0, 0x1a, 0xc0, 0xf2, 0x9f, + 0x8c, 0xc9, 0x57, 0xc7, 0x99, 0x4d, 0xde, + 0xc5, 0x19, 0x69, 0x58, 0x5b, 0x1a, 0x51, + 0x40, 0xa8, 0xc4, 0x93, 0x4b, 0x47, 0xb8, + 0xc4, 0x2a, 0x19, 0x07, 0x80, 0x45, 0xbb, + 0xb3, 0x24, 0x88, 0x68, 0x5f, 0x78, 0x3a, + 0xd2, 0x6c, 0xcc, 0xa0, 0xb5, 0xf0, 0x95, + 0x3e, 0xf1, 0xf4, 0x3e, 0x43, 0x8f, 0x6c, + 0xae, 0x22, 0x59, 0x11, 0x86, 0x22, 0x35, + 0x95 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** snow + zuc ****************************/ + + { + .test_idx = 72, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, SNOW-f8_ENC and ZUC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x5a, 0xa9, 0xb5, + 0x61, 0x8b, 0x8a, 0xb7, 0x6a, 0x98, 0x30, + 0x6c, 0xed, 0x84, 0x69, 0xff, 0x6b, 0x7e, + 0x30, 0x59, 0x55, 0x80, 0x32, 0xd0, 0x0f, + 0x73, 0x43, 0x7c, 0xc3, 0x2e, 0xf4, 0xc3, + 0x3a, 0x60, 0xe3, 0x7c, 0xf0, 0x31, 0xa2, + 0x0e, 0x2e, 0x33, 0xe6, 0xa4, 0xea, 0x17, + 0xd6, 0x56, 0xa2, 0x3b, 0x5f, 0x56, 0x3a, + 0xa7, 0x6f, 0x4c, 0xc1, 0xca, 0xbd, 0x5f, + 0xad, 0x3d, 0x99, 0x4a, 0x53, 0xf6, 0xfc, + 0xeb }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** zuc + null ****************************/ + + { + .test_idx = 73, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, ZUC_ENC and NULL_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x9b, 0x9c, 0xde, + 0xa1, 0x69, 0x9b, 0x27, 0xd3, 0x38, 0x93, + 0xf2, 0x12, 0xb1, 0xc6, 0x60, 0xac, 0xb7, + 0xf2, 0x37, 0xf3, 0x72, 0xaf, 0x50, 0x9d, + 0x97, 0x37, 0x9f, 0xba, 0x25, 0xc8, 0xfc, + 0xa9, 0x85, 0x42, 0x18, 0x09, 0x12, 0xcb, + 0xbb, 0x15, 0xf3, 0x6a, 0x5d, 0x61, 0x12, + 0x6e, 0x6d, 0x1b, 0x92, 0xd8, 0x42, 0x60, + 0x3e, 0x1f, 0xe0, 0x6c, 0x28, 0x89, 0xf7, + 0x0c, 0x61, 0x76, 0xdc, 0x55, 0xb4, 0x38, + 0x2a }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** zuc + null ****************************/ + + { + .test_idx = 74, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, ZUC_ENC and NULL_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_NULL, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x0c, 0xef, 0x82, + 0x59, 0x6b, 0x6b, 0x61, 0xbe, 0x54, 0x23, + 0x7d, 0x29, 0x6d, 0xa7, 0xd2, 0xfa, 0x26, + 0xcc, 0x1d, 0x18, 0x39, 0x99, 0xea, 0xac, + 0xf3, 0x97, 0xb3, 0x18, 0x23, 0x59, 0x5f, + 0xcb, 0x01, 0x9f, 0x0a, 0x0c, 0x9b, 0xa1, + 0x7a, 0x8a, 0xe5, 0x00, 0x35, 0x4d, 0x0e, + 0x69, 0x9f, 0x4b, 0x72, 0x94, 0x8a, 0x25, + 0x69, 0x43, 0x28, 0xdc, 0x40, 0x60, 0x4f, + 0x6c, 0xed, 0x6a, 0x50, 0xa6, 0xd7, 0x73, + 0x10 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** zuc + aes-cmac *************************/ + + { + .test_idx = 75, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, ZUC_ENC and AES-CMAC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x9b, 0x9c, 0xde, + 0xa1, 0x69, 0x9b, 0x27, 0xd3, 0x38, 0x93, + 0xf2, 0x12, 0xb1, 0xc6, 0x60, 0xac, 0xb7, + 0xf2, 0x37, 0xf3, 0x72, 0xaf, 0x50, 0x9d, + 0x97, 0x37, 0x9f, 0xba, 0x25, 0xc8, 0xfc, + 0xa9, 0x85, 0x42, 0x18, 0x09, 0x12, 0xcb, + 0xbb, 0x15, 0xf3, 0x6a, 0x5d, 0x61, 0x12, + 0x6e, 0x6d, 0x1b, 0x92, 0xd8, 0x42, 0x60, + 0x3e, 0x1f, 0xe0, 0x6c, 0x28, 0x89, 0xf7, + 0x0c, 0x61, 0x76, 0xdc, 0x25, 0x8a, 0x31, + 0xed }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** zuc + aes-cmac *************************/ + + { + .test_idx = 76, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, ZUC_ENC and AES-CMAC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_AES_CMAC, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x0c, 0xef, 0x82, + 0x59, 0x6b, 0x6b, 0x61, 0xbe, 0x54, 0x23, + 0x7d, 0x29, 0x6d, 0xa7, 0xd2, 0xfa, 0x26, + 0xcc, 0x1d, 0x18, 0x39, 0x99, 0xea, 0xac, + 0xf3, 0x97, 0xb3, 0x18, 0x23, 0x59, 0x5f, + 0xcb, 0x01, 0x9f, 0x0a, 0x0c, 0x9b, 0xa1, + 0x7a, 0x8a, 0xe5, 0x00, 0x35, 0x4d, 0x0e, + 0x69, 0x9f, 0x4b, 0x72, 0x94, 0x8a, 0x25, + 0x69, 0x43, 0x28, 0xdc, 0x40, 0x60, 0x4f, + 0x6c, 0xed, 0x6a, 0x50, 0xf3, 0x5e, 0x90, + 0x42 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** zuc + snow ****************************/ + + { + .test_idx = 77, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, ZUC_ENC and SNOW-f9_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x9b, 0x9c, 0xde, + 0xa1, 0x69, 0x9b, 0x27, 0xd3, 0x38, 0x93, + 0xf2, 0x12, 0xb1, 0xc6, 0x60, 0xac, 0xb7, + 0xf2, 0x37, 0xf3, 0x72, 0xaf, 0x50, 0x9d, + 0x97, 0x37, 0x9f, 0xba, 0x25, 0xc8, 0xfc, + 0xa9, 0x85, 0x42, 0x18, 0x09, 0x12, 0xcb, + 0xbb, 0x15, 0xf3, 0x6a, 0x5d, 0x61, 0x12, + 0x6e, 0x6d, 0x1b, 0x92, 0xd8, 0x42, 0x60, + 0x3e, 0x1f, 0xe0, 0x6c, 0x28, 0x89, 0xf7, + 0x0c, 0x61, 0x76, 0xdc, 0x55, 0xf1, 0x2b, + 0x66 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** zuc + snow ****************************/ + + { + .test_idx = 78, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, ZUC_ENC and SNOW-f9_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x0c, 0xef, 0x82, + 0x59, 0x6b, 0x6b, 0x61, 0xbe, 0x54, 0x23, + 0x7d, 0x29, 0x6d, 0xa7, 0xd2, 0xfa, 0x26, + 0xcc, 0x1d, 0x18, 0x39, 0x99, 0xea, 0xac, + 0xf3, 0x97, 0xb3, 0x18, 0x23, 0x59, 0x5f, + 0xcb, 0x01, 0x9f, 0x0a, 0x0c, 0x9b, 0xa1, + 0x7a, 0x8a, 0xe5, 0x00, 0x35, 0x4d, 0x0e, + 0x69, 0x9f, 0x4b, 0x72, 0x94, 0x8a, 0x25, + 0x69, 0x43, 0x28, 0xdc, 0x40, 0x60, 0x4f, + 0x6c, 0xed, 0x6a, 0x50, 0xd5, 0x84, 0xf6, + 0x4c }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, + + /**************************** zuc + zuc ****************************/ + + { + .test_idx = 79, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, ZUC_ENC and ZUC_AUTH Uplink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x9b, 0x9c, 0xde, + 0xa1, 0x69, 0x9b, 0x27, 0xd3, 0x38, 0x93, + 0xf2, 0x12, 0xb1, 0xc6, 0x60, 0xac, 0xb7, + 0xf2, 0x37, 0xf3, 0x72, 0xaf, 0x50, 0x9d, + 0x97, 0x37, 0x9f, 0xba, 0x25, 0xc8, 0xfc, + 0xa9, 0x85, 0x42, 0x18, 0x09, 0x12, 0xcb, + 0xbb, 0x15, 0xf3, 0x6a, 0x5d, 0x61, 0x12, + 0x6e, 0x6d, 0x1b, 0x92, 0xd8, 0x42, 0x60, + 0x3e, 0x1f, 0xe0, 0x6c, 0x28, 0x89, 0xf7, + 0x0c, 0x61, 0x76, 0xdc, 0x55, 0x3f, 0x0f, + 0x03 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 0, + }, + + /**************************** zuc + zuc ****************************/ + + { + .test_idx = 80, + .param = {.name = + "PDCP-SDAP Uplane: 18b SN, ZUC_ENC and ZUC_AUTH Downlink", + .cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3, + .domain = RTE_SECURITY_PDCP_MODE_DATA, + .cipher_key_len = 16, + .auth_key_len = 16, + }, + .cipher_key = (uint8_t[]){ 0x60, 0x4c, 0x8a, 0x22, 0x89, 0x56, + 0x13, 0x51, 0x7d, 0x61, 0xe5, 0xe0, + 0x7b, 0x2b, 0xd0, 0x9e }, + .auth_key = (uint8_t[]){ 0x1a, 0xef, 0xbb, 0xff, 0x00, 0xf5, + 0x4b, 0x32, 0x87, 0xf9, 0xdb, 0xe0, + 0x31, 0x5f, 0x3a, 0x15 }, + .data_in = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0xdb, 0x2d, 0x3f, + 0x23, 0x82, 0x53, 0xfd, 0x37, 0xde, 0x88, + 0x63, 0x08, 0x4f, 0xD3, 0x71, 0xfb, 0xeb, + 0x35, 0xf3, 0x64, 0xd3, 0x5e, 0xaf, 0x3f, + 0x57, 0xc2, 0xe2, 0x91, 0x91, 0xa3, 0x9c, + 0xe6, 0x30, 0x69, 0x70, 0x33, 0x8a, 0x15, + 0xd0, 0x36, 0x47, 0x0e, 0x8f, 0xee, 0x2c, + 0x96, 0x0c, 0xd7, 0x7d, 0x70, 0x1b, 0x01, + 0x7f, 0x96, 0x46, 0x53, 0xb0, 0xa4, 0x7a, + 0xf9, 0xdd, 0xcc, 0x69 }, + .in_len = 67, + .data_out = + (uint8_t[]){ 0xf8, 0x00, 0x00, 0xf8, 0x0c, 0xef, 0x82, + 0x59, 0x6b, 0x6b, 0x61, 0xbe, 0x54, 0x23, + 0x7d, 0x29, 0x6d, 0xa7, 0xd2, 0xfa, 0x26, + 0xcc, 0x1d, 0x18, 0x39, 0x99, 0xea, 0xac, + 0xf3, 0x97, 0xb3, 0x18, 0x23, 0x59, 0x5f, + 0xcb, 0x01, 0x9f, 0x0a, 0x0c, 0x9b, 0xa1, + 0x7a, 0x8a, 0xe5, 0x00, 0x35, 0x4d, 0x0e, + 0x69, 0x9f, 0x4b, 0x72, 0x94, 0x8a, 0x25, + 0x69, 0x43, 0x28, 0xdc, 0x40, 0x60, 0x4f, + 0x6c, 0xed, 0x6a, 0x50, 0x03, 0x03, 0xb9, + 0xd5 }, + .sn_size = 18, + .hfn = 0x1, + .hfn_threshold = 0xfa558, + .bearer = 0x16, + .packet_direction = 1, + }, +}; + +#endif From patchwork Thu Sep 3 16:06:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 76454 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 858F0A04BF; Thu, 3 Sep 2020 18:08:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C17841C124; Thu, 3 Sep 2020 18:07:09 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id C33321C0DB for ; Thu, 3 Sep 2020 18:07:05 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9E1D4200F3C; Thu, 3 Sep 2020 18:07:05 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BF6D4200F24; Thu, 3 Sep 2020 18:07:02 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 392B9402FC; Thu, 3 Sep 2020 18:06:58 +0200 (CEST) From: akhil.goyal@nxp.com To: dev@dpdk.org Cc: hemant.agrawal@nxp.com, anoobj@marvell.com, declan.doherty@intel.com, david.coyle@intel.com, Franck LENORMAND Date: Thu, 3 Sep 2020 21:36:51 +0530 Message-Id: <20200903160652.31654-7-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903160652.31654-1-akhil.goyal@nxp.com> References: <20200903160652.31654-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 6/7] test/crypto: Modify test_pdcp_proto to take parameters X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Franck LENORMAND The function test_pdcp_proto was relying to heavily on the structure of test vectors for PDCP making it difficult to be reusable. The function is changed to take all the test parameters as input and does not need access to the tests vectors anymore. Signed-off-by: Franck LENORMAND --- app/test/test_cryptodev.c | 183 ++++++++++++++++++++++---------------- 1 file changed, 104 insertions(+), 79 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 70bf6fe2c..d6bc07696 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -7121,14 +7121,18 @@ security_proto_supported(enum rte_security_session_action_type action, * on input_vec. Checks the output of the crypto operation against * output_vec. */ -static int -test_pdcp_proto(int i, int oop, - enum rte_crypto_cipher_operation opc, - enum rte_crypto_auth_operation opa, - uint8_t *input_vec, - unsigned int input_vec_len, - uint8_t *output_vec, - unsigned int output_vec_len) +static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc, + enum rte_crypto_auth_operation opa, + const uint8_t *input_vec, unsigned int input_vec_len, + const uint8_t *output_vec, + unsigned int output_vec_len, + enum rte_crypto_cipher_algorithm cipher_alg, + const uint8_t *cipher_key, uint32_t cipher_key_len, + enum rte_crypto_auth_algorithm auth_alg, + const uint8_t *auth_key, uint32_t auth_key_len, + uint8_t bearer, enum rte_security_pdcp_domain domain, + uint8_t packet_direction, uint8_t sn_size, + uint32_t hfn, uint32_t hfn_threshold, uint8_t sdap) { struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; @@ -7143,7 +7147,7 @@ test_pdcp_proto(int i, int oop, sec_cap_idx.action = ut_params->type; sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_PDCP; - sec_cap_idx.pdcp.domain = pdcp_test_params[i].domain; + sec_cap_idx.pdcp.domain = domain; if (rte_security_capability_get(ctx, &sec_cap_idx) == NULL) return -ENOTSUP; @@ -7169,24 +7173,22 @@ test_pdcp_proto(int i, int oop, /* Setup Cipher Parameters */ ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; - ut_params->cipher_xform.cipher.algo = pdcp_test_params[i].cipher_alg; + ut_params->cipher_xform.cipher.algo = cipher_alg; ut_params->cipher_xform.cipher.op = opc; - ut_params->cipher_xform.cipher.key.data = pdcp_test_crypto_key[i]; - ut_params->cipher_xform.cipher.key.length = - pdcp_test_params[i].cipher_key_len; + ut_params->cipher_xform.cipher.key.data = cipher_key; + ut_params->cipher_xform.cipher.key.length = cipher_key_len; ut_params->cipher_xform.cipher.iv.length = - pdcp_test_packet_direction[i] ? 4 : 0; + packet_direction ? 4 : 0; ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; /* Setup HMAC Parameters if ICV header is required */ - if (pdcp_test_params[i].auth_alg != 0) { + if (auth_alg != 0) { ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; ut_params->auth_xform.next = NULL; - ut_params->auth_xform.auth.algo = pdcp_test_params[i].auth_alg; + ut_params->auth_xform.auth.algo = auth_alg; ut_params->auth_xform.auth.op = opa; - ut_params->auth_xform.auth.key.data = pdcp_test_auth_key[i]; - ut_params->auth_xform.auth.key.length = - pdcp_test_params[i].auth_key_len; + ut_params->auth_xform.auth.key.data = auth_key; + ut_params->auth_xform.auth.key.length = auth_key_len; ut_params->cipher_xform.next = &ut_params->auth_xform; } else { @@ -7197,22 +7199,22 @@ test_pdcp_proto(int i, int oop, .action_type = ut_params->type, .protocol = RTE_SECURITY_PROTOCOL_PDCP, {.pdcp = { - .bearer = pdcp_test_bearer[i], - .domain = pdcp_test_params[i].domain, - .pkt_dir = pdcp_test_packet_direction[i], - .sn_size = pdcp_test_data_sn_size[i], - .hfn = pdcp_test_packet_direction[i] ? - 0 : pdcp_test_hfn[i], - /** - * hfn can be set as pdcp_test_hfn[i] - * if hfn_ovrd is not set. Here, PDCP - * packet direction is just used to - * run half of the cases with session - * HFN and other half with per packet - * HFN. - */ - .hfn_threshold = pdcp_test_hfn_threshold[i], - .hfn_ovrd = pdcp_test_packet_direction[i] ? 1 : 0, + .bearer = bearer, + .domain = domain, + .pkt_dir = packet_direction, + .sn_size = sn_size, + .hfn = packet_direction ? 0 : hfn, + /** + * hfn can be set as pdcp_test_hfn[i] + * if hfn_ovrd is not set. Here, PDCP + * packet direction is just used to + * run half of the cases with session + * HFN and other half with per packet + * HFN. + */ + .hfn_threshold = hfn_threshold, + .hfn_ovrd = packet_direction ? 1 : 0, + .sdap_enabled = sdap, } }, .crypto_xform = &ut_params->cipher_xform }; @@ -7241,7 +7243,7 @@ test_pdcp_proto(int i, int oop, uint32_t *per_pkt_hfn = rte_crypto_op_ctod_offset(ut_params->op, uint32_t *, IV_OFFSET); - *per_pkt_hfn = pdcp_test_packet_direction[i] ? pdcp_test_hfn[i] : 0; + *per_pkt_hfn = packet_direction ? hfn : 0; rte_security_attach_session(ut_params->op, ut_params->sec_session); @@ -7582,74 +7584,97 @@ test_pdcp_proto_SGL(int i, int oop, int test_pdcp_proto_cplane_encap(int i) { - return test_pdcp_proto(i, 0, - RTE_CRYPTO_CIPHER_OP_ENCRYPT, - RTE_CRYPTO_AUTH_OP_GENERATE, - pdcp_test_data_in[i], - pdcp_test_data_in_len[i], - pdcp_test_data_out[i], - pdcp_test_data_in_len[i]+4); + return test_pdcp_proto( + i, 0, RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_AUTH_OP_GENERATE, + pdcp_test_data_in[i], pdcp_test_data_in_len[i], + pdcp_test_data_out[i], pdcp_test_data_in_len[i] + 4, + pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i], + pdcp_test_params[i].cipher_key_len, + pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i], + pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i], + pdcp_test_params[i].domain, pdcp_test_packet_direction[i], + pdcp_test_data_sn_size[i], pdcp_test_hfn[i], + pdcp_test_hfn_threshold[i], SDAP_DISABLED); } int test_pdcp_proto_uplane_encap(int i) { - return test_pdcp_proto(i, 0, - RTE_CRYPTO_CIPHER_OP_ENCRYPT, - RTE_CRYPTO_AUTH_OP_GENERATE, - pdcp_test_data_in[i], - pdcp_test_data_in_len[i], - pdcp_test_data_out[i], - pdcp_test_data_in_len[i]); - + return test_pdcp_proto( + i, 0, RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_AUTH_OP_GENERATE, + pdcp_test_data_in[i], pdcp_test_data_in_len[i], + pdcp_test_data_out[i], pdcp_test_data_in_len[i], + pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i], + pdcp_test_params[i].cipher_key_len, + pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i], + pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i], + pdcp_test_params[i].domain, pdcp_test_packet_direction[i], + pdcp_test_data_sn_size[i], pdcp_test_hfn[i], + pdcp_test_hfn_threshold[i], SDAP_DISABLED); } int test_pdcp_proto_uplane_encap_with_int(int i) { - return test_pdcp_proto(i, 0, - RTE_CRYPTO_CIPHER_OP_ENCRYPT, - RTE_CRYPTO_AUTH_OP_GENERATE, - pdcp_test_data_in[i], - pdcp_test_data_in_len[i], - pdcp_test_data_out[i], - pdcp_test_data_in_len[i] + 4); + return test_pdcp_proto( + i, 0, RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_AUTH_OP_GENERATE, + pdcp_test_data_in[i], pdcp_test_data_in_len[i], + pdcp_test_data_out[i], pdcp_test_data_in_len[i] + 4, + pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i], + pdcp_test_params[i].cipher_key_len, + pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i], + pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i], + pdcp_test_params[i].domain, pdcp_test_packet_direction[i], + pdcp_test_data_sn_size[i], pdcp_test_hfn[i], + pdcp_test_hfn_threshold[i], SDAP_DISABLED); } int test_pdcp_proto_cplane_decap(int i) { - return test_pdcp_proto(i, 0, - RTE_CRYPTO_CIPHER_OP_DECRYPT, - RTE_CRYPTO_AUTH_OP_VERIFY, - pdcp_test_data_out[i], - pdcp_test_data_in_len[i] + 4, - pdcp_test_data_in[i], - pdcp_test_data_in_len[i]); + return test_pdcp_proto( + i, 0, RTE_CRYPTO_CIPHER_OP_DECRYPT, RTE_CRYPTO_AUTH_OP_VERIFY, + pdcp_test_data_out[i], pdcp_test_data_in_len[i] + 4, + pdcp_test_data_in[i], pdcp_test_data_in_len[i], + pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i], + pdcp_test_params[i].cipher_key_len, + pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i], + pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i], + pdcp_test_params[i].domain, pdcp_test_packet_direction[i], + pdcp_test_data_sn_size[i], pdcp_test_hfn[i], + pdcp_test_hfn_threshold[i], SDAP_DISABLED); } int test_pdcp_proto_uplane_decap(int i) { - return test_pdcp_proto(i, 0, - RTE_CRYPTO_CIPHER_OP_DECRYPT, - RTE_CRYPTO_AUTH_OP_VERIFY, - pdcp_test_data_out[i], - pdcp_test_data_in_len[i], - pdcp_test_data_in[i], - pdcp_test_data_in_len[i]); + return test_pdcp_proto( + i, 0, RTE_CRYPTO_CIPHER_OP_DECRYPT, RTE_CRYPTO_AUTH_OP_VERIFY, + pdcp_test_data_out[i], pdcp_test_data_in_len[i], + pdcp_test_data_in[i], pdcp_test_data_in_len[i], + pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i], + pdcp_test_params[i].cipher_key_len, + pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i], + pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i], + pdcp_test_params[i].domain, pdcp_test_packet_direction[i], + pdcp_test_data_sn_size[i], pdcp_test_hfn[i], + pdcp_test_hfn_threshold[i], SDAP_DISABLED); } int test_pdcp_proto_uplane_decap_with_int(int i) { - return test_pdcp_proto(i, 0, - RTE_CRYPTO_CIPHER_OP_DECRYPT, - RTE_CRYPTO_AUTH_OP_VERIFY, - pdcp_test_data_out[i], - pdcp_test_data_in_len[i] + 4, - pdcp_test_data_in[i], - pdcp_test_data_in_len[i]); + return test_pdcp_proto( + i, 0, RTE_CRYPTO_CIPHER_OP_DECRYPT, RTE_CRYPTO_AUTH_OP_VERIFY, + pdcp_test_data_out[i], pdcp_test_data_in_len[i] + 4, + pdcp_test_data_in[i], pdcp_test_data_in_len[i], + pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i], + pdcp_test_params[i].cipher_key_len, + pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i], + pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i], + pdcp_test_params[i].domain, pdcp_test_packet_direction[i], + pdcp_test_data_sn_size[i], pdcp_test_hfn[i], + pdcp_test_hfn_threshold[i], SDAP_DISABLED); } static int From patchwork Thu Sep 3 16:06:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil Goyal X-Patchwork-Id: 76456 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 70BB7A04BF; Thu, 3 Sep 2020 18:08:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5240F1C12F; Thu, 3 Sep 2020 18:07:12 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 352471C11B for ; Thu, 3 Sep 2020 18:07:08 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1AB221A0C4C; Thu, 3 Sep 2020 18:07:08 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id DB17D1A0D3F; Thu, 3 Sep 2020 18:07:04 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id A7A6F402AE; Thu, 3 Sep 2020 18:06:58 +0200 (CEST) From: akhil.goyal@nxp.com To: dev@dpdk.org Cc: hemant.agrawal@nxp.com, anoobj@marvell.com, declan.doherty@intel.com, david.coyle@intel.com, Franck LENORMAND , Akhil Goyal Date: Thu, 3 Sep 2020 21:36:52 +0530 Message-Id: <20200903160652.31654-8-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903160652.31654-1-akhil.goyal@nxp.com> References: <20200903160652.31654-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 7/7] test/crypto: Add PDCP-SDAP cases X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Franck LENORMAND A new functions which uses the structure of the test vectors for SDAP is added and call a functions responsible to call the test_pdcp_proto with the test vector both for encapsulation and decapsulation. Signed-off-by: Franck LENORMAND Signed-off-by: Akhil Goyal --- app/test/test_cryptodev.c | 95 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index d6bc07696..5a0b0b1aa 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2015-2020 Intel Corporation + * Copyright 2020 NXP */ #include @@ -42,8 +43,12 @@ #include "test_cryptodev_mixed_test_vectors.h" #ifdef RTE_LIBRTE_SECURITY #include "test_cryptodev_security_pdcp_test_vectors.h" +#include "test_cryptodev_security_pdcp_sdap_test_vectors.h" #include "test_cryptodev_security_pdcp_test_func.h" #include "test_cryptodev_security_docsis_test_vectors.h" + +#define SDAP_DISABLED 0 +#define SDAP_ENABLED 1 #endif #define VDEV_ARGS_SIZE 100 @@ -52,6 +57,10 @@ #define IN_PLACE 0 #define OUT_OF_PLACE 1 +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#endif + static int gbl_driver_id; static enum rte_security_session_action_type gbl_action_type = @@ -7743,6 +7752,90 @@ test_PDCP_PROTO_SGL_oop_128B_32B(void) 128, 32); } +static int +test_PDCP_SDAP_PROTO_encap_all(void) +{ + int i = 0, size = 0; + int err, all_err = TEST_SUCCESS; + const struct pdcp_sdap_test *cur_test; + + size = ARRAY_SIZE(list_pdcp_sdap_tests); + + for (i = 0; i < size; i++) { + cur_test = &list_pdcp_sdap_tests[i]; + err = test_pdcp_proto( + i, 0, RTE_CRYPTO_CIPHER_OP_ENCRYPT, + RTE_CRYPTO_AUTH_OP_GENERATE, cur_test->data_in, + cur_test->in_len, cur_test->data_out, + cur_test->in_len + ((cur_test->auth_key) ? 4 : 0), + cur_test->param.cipher_alg, cur_test->cipher_key, + cur_test->param.cipher_key_len, + cur_test->param.auth_alg, + cur_test->auth_key, cur_test->param.auth_key_len, + cur_test->bearer, cur_test->param.domain, + cur_test->packet_direction, cur_test->sn_size, + cur_test->hfn, + cur_test->hfn_threshold, SDAP_ENABLED); + if (err) { + printf("\t%d) %s: Encapsulation failed\n", + cur_test->test_idx, + cur_test->param.name); + err = TEST_FAILED; + } else { + printf("\t%d) %s: Encap PASS\n", cur_test->test_idx, + cur_test->param.name); + err = TEST_SUCCESS; + } + all_err += err; + } + + printf("Success: %d, Failure: %d\n", size + all_err, -all_err); + + return (all_err == TEST_SUCCESS) ? TEST_SUCCESS : TEST_FAILED; +} + +static int +test_PDCP_SDAP_PROTO_decap_all(void) +{ + int i = 0, size = 0; + int err, all_err = TEST_SUCCESS; + const struct pdcp_sdap_test *cur_test; + + size = ARRAY_SIZE(list_pdcp_sdap_tests); + + for (i = 0; i < size; i++) { + cur_test = &list_pdcp_sdap_tests[i]; + err = test_pdcp_proto( + i, 0, RTE_CRYPTO_CIPHER_OP_DECRYPT, + RTE_CRYPTO_AUTH_OP_VERIFY, + cur_test->data_out, + cur_test->in_len + ((cur_test->auth_key) ? 4 : 0), + cur_test->data_in, cur_test->in_len, + cur_test->param.cipher_alg, + cur_test->cipher_key, cur_test->param.cipher_key_len, + cur_test->param.auth_alg, cur_test->auth_key, + cur_test->param.auth_key_len, cur_test->bearer, + cur_test->param.domain, cur_test->packet_direction, + cur_test->sn_size, cur_test->hfn, + cur_test->hfn_threshold, SDAP_ENABLED); + if (err) { + printf("\t%d) %s: Decapsulation failed\n", + cur_test->test_idx, + cur_test->param.name); + err = TEST_FAILED; + } else { + printf("\t%d) %s: Decap PASS\n", cur_test->test_idx, + cur_test->param.name); + err = TEST_SUCCESS; + } + all_err += err; + } + + printf("Success: %d, Failure: %d\n", size + all_err, -all_err); + + return (all_err == TEST_SUCCESS) ? TEST_SUCCESS : TEST_FAILED; +} + static int test_PDCP_PROTO_all(void) { @@ -7774,6 +7867,8 @@ test_PDCP_PROTO_all(void) status += test_PDCP_PROTO_SGL_oop_32B_128B(); status += test_PDCP_PROTO_SGL_oop_32B_40B(); status += test_PDCP_PROTO_SGL_oop_128B_32B(); + status += test_PDCP_SDAP_PROTO_encap_all(); + status += test_PDCP_SDAP_PROTO_decap_all(); if (status) return TEST_FAILED;