MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_blockcipher_one_case

Function test_blockcipher_one_case

dpdk/app/test/test_cryptodev_blockcipher.c:67–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67static int
68test_blockcipher_one_case(const struct blockcipher_test_case *t,
69 struct rte_mempool *mbuf_pool,
70 struct rte_mempool *op_mpool,
71 struct rte_mempool *sess_mpool,
72 uint8_t dev_id,
73 char *test_msg)
74{
75 struct rte_mbuf *ibuf = NULL;
76 struct rte_mbuf *obuf = NULL;
77 struct rte_mbuf *iobuf;
78 struct rte_crypto_sym_xform *cipher_xform = NULL;
79 struct rte_crypto_sym_xform *auth_xform = NULL;
80 struct rte_crypto_sym_xform *init_xform = NULL;
81 struct rte_crypto_sym_op *sym_op = NULL;
82 struct rte_crypto_op *op = NULL;
83 struct rte_cryptodev_info dev_info;
84 void *sess = NULL;
85
86 int status = TEST_SUCCESS;
87 const struct blockcipher_test_data *tdata = t->test_data;
88 uint8_t cipher_key[tdata->cipher_key.len];
89 uint8_t auth_key[tdata->auth_key.len];
90 uint32_t buf_len = tdata->ciphertext.len;
91 uint32_t digest_len = tdata->digest.len;
92 char *buf_p = NULL;
93 uint8_t src_pattern = 0xa5;
94 uint8_t dst_pattern = 0xb6;
95 uint8_t tmp_src_buf[MBUF_SIZE];
96 uint8_t tmp_dst_buf[MBUF_SIZE];
97 uint32_t pad_len;
98
99 int nb_segs_in = 1;
100 int nb_segs_out = 1;
101 uint64_t sgl_type = t->sgl_flag;
102 uint32_t nb_iterates = 0;
103
104 rte_cryptodev_info_get(dev_id, &dev_info);
105 uint64_t feat_flags = dev_info.feature_flags;
106
107 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SESSIONLESS) {
108 if (!(feat_flags & RTE_CRYPTODEV_FF_SYM_SESSIONLESS)) {
109 printf("Device doesn't support sessionless operations "
110 "Test Skipped.\n");
111 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
112 "SKIPPED");
113 return TEST_SKIPPED;
114 }
115 }
116 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_DIGEST_ENCRYPTED) {
117 if (!(feat_flags & RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED)) {
118 printf("Device doesn't support encrypted digest "
119 "Test Skipped.\n");
120 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
121 "SKIPPED");
122 return TEST_SKIPPED;
123 }
124 }

Callers 1

Calls 15

rte_cryptodev_info_getFunction · 0.85
snprintfFunction · 0.85
verify_algo_supportFunction · 0.85
create_segmented_mbufFunction · 0.85
pktmbuf_writeFunction · 0.85
rte_pktmbuf_appendFunction · 0.85
memsetFunction · 0.85
rte_crypto_op_allocFunction · 0.85
rte_pktmbuf_resetFunction · 0.85
rte_zmallocFunction · 0.85
pktmbuf_mtod_offsetFunction · 0.85

Tested by

no test coverage detected