Lines Matching refs:ut_params

120 		struct crypto_unittest_params *ut_params, uint8_t *cipher_key,
125 struct crypto_unittest_params *ut_params,
872 struct crypto_unittest_params *ut_params = &unittest_params; in dev_configure_and_start() local
877 memset(ut_params, 0, sizeof(*ut_params)); in dev_configure_and_start()
929 struct crypto_unittest_params *ut_params = &unittest_params; in ut_teardown() local
934 if (ut_params->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) { in ut_teardown()
935 if (ut_params->sec_session) { in ut_teardown()
938 ut_params->sec_session); in ut_teardown()
939 ut_params->sec_session = NULL; in ut_teardown()
944 if (ut_params->sess) { in ut_teardown()
947 ut_params->sess); in ut_teardown()
948 rte_cryptodev_sym_session_free(ut_params->sess); in ut_teardown()
949 ut_params->sess = NULL; in ut_teardown()
954 if (ut_params->op) in ut_teardown()
955 rte_crypto_op_free(ut_params->op); in ut_teardown()
962 if (ut_params->obuf) { in ut_teardown()
963 rte_pktmbuf_free(ut_params->obuf); in ut_teardown()
964 if (ut_params->ibuf == ut_params->obuf) in ut_teardown()
965 ut_params->ibuf = 0; in ut_teardown()
966 ut_params->obuf = 0; in ut_teardown()
968 if (ut_params->ibuf) { in ut_teardown()
969 rte_pktmbuf_free(ut_params->ibuf); in ut_teardown()
970 ut_params->ibuf = 0; in ut_teardown()
1650 struct crypto_unittest_params *ut_params = &unittest_params; in test_AES_CBC_HMAC_SHA1_encrypt_digest() local
1666 ut_params->ibuf = setup_test_string(ts_params->mbuf_pool, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1669 ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1671 TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest"); in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1674 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1675 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1677 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1678 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1679 ut_params->cipher_xform.cipher.key.data = aes_cbc_key; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1680 ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1681 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1682 ut_params->cipher_xform.cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1685 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1687 ut_params->auth_xform.next = NULL; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1689 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1690 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1691 ut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA1; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1692 ut_params->auth_xform.auth.key.data = hmac_sha1_key; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1693 ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1695 ut_params->sess = rte_cryptodev_sym_session_create( in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1700 ut_params->sess, &ut_params->cipher_xform, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1702 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1705 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1707 TEST_ASSERT_NOT_NULL(ut_params->op, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1710 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1712 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1715 sym_op->m_src = ut_params->ibuf; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1718 sym_op->auth.digest.data = ut_params->digest; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1720 ut_params->ibuf, QUOTE_512_BYTES); in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1726 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1736 ut_params->op); in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1740 ut_params->op), in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1743 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1747 uint8_t *ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_src, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
1796 struct crypto_unittest_params *ut_params,
1802 struct crypto_unittest_params *ut_params,
1811 struct crypto_unittest_params *ut_params, in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params() argument
1817 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1818 ut_params->cipher_xform.next = NULL; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1820 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1821 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1822 ut_params->cipher_xform.cipher.key.data = cipher_key; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1823 ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1824 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1825 ut_params->cipher_xform.cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1828 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1829 ut_params->auth_xform.next = &ut_params->cipher_xform; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1831 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1832 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA512_HMAC; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1833 ut_params->auth_xform.auth.key.data = hmac_key; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1834 ut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA512; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1835 ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
1843 struct crypto_unittest_params *ut_params, in test_AES_CBC_HMAC_SHA512_decrypt_perform() argument
1850 ut_params->ibuf = setup_test_string(ts_params->mbuf_pool, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1855 ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1857 TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest"); in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1859 rte_memcpy(ut_params->digest, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1864 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1866 TEST_ASSERT_NOT_NULL(ut_params->op, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1869 rte_crypto_op_attach_sym_session(ut_params->op, sess); in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1871 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1874 sym_op->m_src = ut_params->ibuf; in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1876 sym_op->auth.digest.data = ut_params->digest; in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1878 ut_params->ibuf, QUOTE_512_BYTES); in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1884 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1893 ut_params->op); in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1896 ut_params->op, 1, 1, 0, 0); in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1900 ut_params->op), in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1903 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1906 ut_params->obuf = ut_params->op->sym->m_src; in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1910 rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), in test_AES_CBC_HMAC_SHA512_decrypt_perform()
1916 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2008 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_hash_session() local
2015 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_wireless_algo_hash_session()
2016 ut_params->auth_xform.next = NULL; in create_wireless_algo_hash_session()
2018 ut_params->auth_xform.auth.op = op; in create_wireless_algo_hash_session()
2019 ut_params->auth_xform.auth.algo = algo; in create_wireless_algo_hash_session()
2020 ut_params->auth_xform.auth.key.length = key_len; in create_wireless_algo_hash_session()
2021 ut_params->auth_xform.auth.key.data = hash_key; in create_wireless_algo_hash_session()
2022 ut_params->auth_xform.auth.digest_length = auth_len; in create_wireless_algo_hash_session()
2023 ut_params->auth_xform.auth.iv.offset = IV_OFFSET; in create_wireless_algo_hash_session()
2024 ut_params->auth_xform.auth.iv.length = iv_len; in create_wireless_algo_hash_session()
2025 ut_params->sess = rte_cryptodev_sym_session_create( in create_wireless_algo_hash_session()
2028 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_algo_hash_session()
2029 &ut_params->auth_xform, in create_wireless_algo_hash_session()
2032 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_wireless_algo_hash_session()
2046 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_cipher_session() local
2051 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in create_wireless_algo_cipher_session()
2052 ut_params->cipher_xform.next = NULL; in create_wireless_algo_cipher_session()
2054 ut_params->cipher_xform.cipher.algo = algo; in create_wireless_algo_cipher_session()
2055 ut_params->cipher_xform.cipher.op = op; in create_wireless_algo_cipher_session()
2056 ut_params->cipher_xform.cipher.key.data = cipher_key; in create_wireless_algo_cipher_session()
2057 ut_params->cipher_xform.cipher.key.length = key_len; in create_wireless_algo_cipher_session()
2058 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in create_wireless_algo_cipher_session()
2059 ut_params->cipher_xform.cipher.iv.length = iv_len; in create_wireless_algo_cipher_session()
2064 ut_params->sess = rte_cryptodev_sym_session_create( in create_wireless_algo_cipher_session()
2067 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_algo_cipher_session()
2068 &ut_params->cipher_xform, in create_wireless_algo_cipher_session()
2071 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_wireless_algo_cipher_session()
2081 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_cipher_operation() local
2084 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_algo_cipher_operation()
2086 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_algo_cipher_operation()
2090 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_algo_cipher_operation()
2092 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_algo_cipher_operation()
2095 sym_op->m_src = ut_params->ibuf; in create_wireless_algo_cipher_operation()
2098 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in create_wireless_algo_cipher_operation()
2111 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_cipher_operation_oop() local
2114 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_algo_cipher_operation_oop()
2116 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_algo_cipher_operation_oop()
2120 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_algo_cipher_operation_oop()
2122 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_algo_cipher_operation_oop()
2125 sym_op->m_src = ut_params->ibuf; in create_wireless_algo_cipher_operation_oop()
2126 sym_op->m_dst = ut_params->obuf; in create_wireless_algo_cipher_operation_oop()
2129 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in create_wireless_algo_cipher_operation_oop()
2151 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_cipher_auth_session() local
2156 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_wireless_algo_cipher_auth_session()
2157 ut_params->auth_xform.next = NULL; in create_wireless_algo_cipher_auth_session()
2159 ut_params->auth_xform.auth.op = auth_op; in create_wireless_algo_cipher_auth_session()
2160 ut_params->auth_xform.auth.algo = auth_algo; in create_wireless_algo_cipher_auth_session()
2161 ut_params->auth_xform.auth.key.length = key_len; in create_wireless_algo_cipher_auth_session()
2163 ut_params->auth_xform.auth.key.data = cipher_auth_key; in create_wireless_algo_cipher_auth_session()
2164 ut_params->auth_xform.auth.digest_length = auth_len; in create_wireless_algo_cipher_auth_session()
2166 ut_params->auth_xform.auth.iv.offset = IV_OFFSET + cipher_iv_len; in create_wireless_algo_cipher_auth_session()
2167 ut_params->auth_xform.auth.iv.length = auth_iv_len; in create_wireless_algo_cipher_auth_session()
2170 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in create_wireless_algo_cipher_auth_session()
2171 ut_params->cipher_xform.next = &ut_params->auth_xform; in create_wireless_algo_cipher_auth_session()
2173 ut_params->cipher_xform.cipher.algo = cipher_algo; in create_wireless_algo_cipher_auth_session()
2174 ut_params->cipher_xform.cipher.op = cipher_op; in create_wireless_algo_cipher_auth_session()
2175 ut_params->cipher_xform.cipher.key.data = cipher_auth_key; in create_wireless_algo_cipher_auth_session()
2176 ut_params->cipher_xform.cipher.key.length = key_len; in create_wireless_algo_cipher_auth_session()
2177 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in create_wireless_algo_cipher_auth_session()
2178 ut_params->cipher_xform.cipher.iv.length = cipher_iv_len; in create_wireless_algo_cipher_auth_session()
2183 ut_params->sess = rte_cryptodev_sym_session_create( in create_wireless_algo_cipher_auth_session()
2185 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_wireless_algo_cipher_auth_session()
2187 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_algo_cipher_auth_session()
2188 &ut_params->cipher_xform, in create_wireless_algo_cipher_auth_session()
2210 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_cipher_auth_session() local
2219 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_wireless_cipher_auth_session()
2220 ut_params->auth_xform.next = NULL; in create_wireless_cipher_auth_session()
2222 ut_params->auth_xform.auth.op = auth_op; in create_wireless_cipher_auth_session()
2223 ut_params->auth_xform.auth.algo = auth_algo; in create_wireless_cipher_auth_session()
2224 ut_params->auth_xform.auth.key.length = key_len; in create_wireless_cipher_auth_session()
2226 ut_params->auth_xform.auth.key.data = cipher_auth_key; in create_wireless_cipher_auth_session()
2227 ut_params->auth_xform.auth.digest_length = auth_len; in create_wireless_cipher_auth_session()
2229 ut_params->auth_xform.auth.iv.offset = IV_OFFSET + cipher_iv_len; in create_wireless_cipher_auth_session()
2230 ut_params->auth_xform.auth.iv.length = auth_iv_len; in create_wireless_cipher_auth_session()
2233 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in create_wireless_cipher_auth_session()
2234 ut_params->cipher_xform.next = &ut_params->auth_xform; in create_wireless_cipher_auth_session()
2236 ut_params->cipher_xform.cipher.algo = cipher_algo; in create_wireless_cipher_auth_session()
2237 ut_params->cipher_xform.cipher.op = cipher_op; in create_wireless_cipher_auth_session()
2238 ut_params->cipher_xform.cipher.key.data = cipher_auth_key; in create_wireless_cipher_auth_session()
2239 ut_params->cipher_xform.cipher.key.length = key_len; in create_wireless_cipher_auth_session()
2240 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in create_wireless_cipher_auth_session()
2241 ut_params->cipher_xform.cipher.iv.length = cipher_iv_len; in create_wireless_cipher_auth_session()
2247 ut_params->sess = rte_cryptodev_sym_session_create( in create_wireless_cipher_auth_session()
2250 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_cipher_auth_session()
2251 &ut_params->cipher_xform, in create_wireless_cipher_auth_session()
2257 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_wireless_cipher_auth_session()
2284 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_auth_cipher_session() local
2289 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_wireless_algo_auth_cipher_session()
2290 ut_params->auth_xform.auth.op = auth_op; in create_wireless_algo_auth_cipher_session()
2291 ut_params->auth_xform.next = &ut_params->cipher_xform; in create_wireless_algo_auth_cipher_session()
2292 ut_params->auth_xform.auth.algo = auth_algo; in create_wireless_algo_auth_cipher_session()
2293 ut_params->auth_xform.auth.key.length = key_len; in create_wireless_algo_auth_cipher_session()
2294 ut_params->auth_xform.auth.key.data = auth_cipher_key; in create_wireless_algo_auth_cipher_session()
2295 ut_params->auth_xform.auth.digest_length = auth_len; in create_wireless_algo_auth_cipher_session()
2297 ut_params->auth_xform.auth.iv.offset = IV_OFFSET + cipher_iv_len; in create_wireless_algo_auth_cipher_session()
2298 ut_params->auth_xform.auth.iv.length = auth_iv_len; in create_wireless_algo_auth_cipher_session()
2301 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in create_wireless_algo_auth_cipher_session()
2302 ut_params->cipher_xform.next = NULL; in create_wireless_algo_auth_cipher_session()
2303 ut_params->cipher_xform.cipher.algo = cipher_algo; in create_wireless_algo_auth_cipher_session()
2304 ut_params->cipher_xform.cipher.op = cipher_op; in create_wireless_algo_auth_cipher_session()
2305 ut_params->cipher_xform.cipher.key.data = auth_cipher_key; in create_wireless_algo_auth_cipher_session()
2306 ut_params->cipher_xform.cipher.key.length = key_len; in create_wireless_algo_auth_cipher_session()
2307 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in create_wireless_algo_auth_cipher_session()
2308 ut_params->cipher_xform.cipher.iv.length = cipher_iv_len; in create_wireless_algo_auth_cipher_session()
2313 ut_params->sess = rte_cryptodev_sym_session_create( in create_wireless_algo_auth_cipher_session()
2315 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_wireless_algo_auth_cipher_session()
2318 ut_params->auth_xform.next = NULL; in create_wireless_algo_auth_cipher_session()
2319 ut_params->cipher_xform.next = &ut_params->auth_xform; in create_wireless_algo_auth_cipher_session()
2320 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_algo_auth_cipher_session()
2321 &ut_params->cipher_xform, in create_wireless_algo_auth_cipher_session()
2325 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_algo_auth_cipher_session()
2326 &ut_params->auth_xform, in create_wireless_algo_auth_cipher_session()
2347 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_hash_operation() local
2350 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_algo_hash_operation()
2352 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_algo_hash_operation()
2356 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_algo_hash_operation()
2358 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_algo_hash_operation()
2361 sym_op->m_src = ut_params->ibuf; in create_wireless_algo_hash_operation()
2364 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in create_wireless_algo_hash_operation()
2368 ut_params->ibuf, auth_tag_len); in create_wireless_algo_hash_operation()
2372 ut_params->digest = sym_op->auth.digest.data; in create_wireless_algo_hash_operation()
2374 ut_params->ibuf, data_pad_len); in create_wireless_algo_hash_operation()
2395 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_cipher_hash_operation() local
2410 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_cipher_hash_operation()
2412 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_cipher_hash_operation()
2415 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_cipher_hash_operation()
2417 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_cipher_hash_operation()
2420 sym_op->m_src = ut_params->ibuf; in create_wireless_cipher_hash_operation()
2424 ut_params->ibuf, auth_tag_len); in create_wireless_cipher_hash_operation()
2428 ut_params->digest = sym_op->auth.digest.data; in create_wireless_cipher_hash_operation()
2430 ut_params->ibuf, data_pad_len); in create_wireless_cipher_hash_operation()
2441 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, in create_wireless_cipher_hash_operation()
2474 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_cipher_hash_operation() local
2477 ut_params->cipher_xform.cipher.algo; in create_wireless_algo_cipher_hash_operation()
2479 ut_params->auth_xform.auth.algo; in create_wireless_algo_cipher_hash_operation()
2482 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_algo_cipher_hash_operation()
2484 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_algo_cipher_hash_operation()
2487 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_algo_cipher_hash_operation()
2489 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_algo_cipher_hash_operation()
2492 sym_op->m_src = ut_params->ibuf; in create_wireless_algo_cipher_hash_operation()
2496 ut_params->ibuf, auth_tag_len); in create_wireless_algo_cipher_hash_operation()
2500 ut_params->digest = sym_op->auth.digest.data; in create_wireless_algo_cipher_hash_operation()
2502 if (rte_pktmbuf_is_contiguous(ut_params->ibuf)) { in create_wireless_algo_cipher_hash_operation()
2504 ut_params->ibuf, data_pad_len); in create_wireless_algo_cipher_hash_operation()
2506 struct rte_mbuf *m = ut_params->ibuf; in create_wireless_algo_cipher_hash_operation()
2527 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, in create_wireless_algo_cipher_hash_operation()
2567 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_auth_cipher_operation() local
2570 ut_params->cipher_xform.cipher.algo; in create_wireless_algo_auth_cipher_operation()
2572 ut_params->auth_xform.auth.algo; in create_wireless_algo_auth_cipher_operation()
2575 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_algo_auth_cipher_operation()
2577 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_algo_auth_cipher_operation()
2581 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_algo_auth_cipher_operation()
2583 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_algo_auth_cipher_operation()
2586 sym_op->m_src = ut_params->ibuf; in create_wireless_algo_auth_cipher_operation()
2588 sym_op->m_dst = ut_params->obuf; in create_wireless_algo_auth_cipher_operation()
2594 ut_params->ibuf : ut_params->obuf), in create_wireless_algo_auth_cipher_operation()
2598 ut_params->ibuf : ut_params->obuf), in create_wireless_algo_auth_cipher_operation()
2627 ut_params->op, uint8_t *, IV_OFFSET); in create_wireless_algo_auth_cipher_operation()
2660 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_authentication() local
2704 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_authentication()
2706 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_authentication()
2707 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_authentication()
2713 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_authentication()
2728 ut_params->op, 0, 1, 1, 0); in test_snow3g_authentication()
2730 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_authentication()
2731 ut_params->op); in test_snow3g_authentication()
2732 ut_params->obuf = ut_params->op->sym->m_src; in test_snow3g_authentication()
2733 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_authentication()
2734 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_snow3g_authentication()
2739 ut_params->digest, in test_snow3g_authentication()
2751 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_authentication_verify() local
2794 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_authentication_verify()
2796 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_authentication_verify()
2797 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_authentication_verify()
2803 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_authentication_verify()
2820 ut_params->op, 0, 1, 1, 0); in test_snow3g_authentication_verify()
2822 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_authentication_verify()
2823 ut_params->op); in test_snow3g_authentication_verify()
2824 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_authentication_verify()
2825 ut_params->obuf = ut_params->op->sym->m_src; in test_snow3g_authentication_verify()
2826 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_snow3g_authentication_verify()
2830 if (ut_params->op->status == RTE_CRYPTO_OP_STATUS_SUCCESS) in test_snow3g_authentication_verify()
2842 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_authentication() local
2880 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_authentication()
2882 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_authentication()
2883 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_authentication()
2889 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_authentication()
2904 ut_params->op); in test_kasumi_authentication()
2907 ut_params->op, 0, 1, 1, 0); in test_kasumi_authentication()
2909 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_authentication()
2910 ut_params->op); in test_kasumi_authentication()
2912 ut_params->obuf = ut_params->op->sym->m_src; in test_kasumi_authentication()
2913 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_authentication()
2914 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_kasumi_authentication()
2919 ut_params->digest, in test_kasumi_authentication()
2931 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_authentication_verify() local
2968 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_authentication_verify()
2970 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_authentication_verify()
2971 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_authentication_verify()
2977 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_authentication_verify()
2994 ut_params->op, 0, 1, 1, 0); in test_kasumi_authentication_verify()
2996 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_authentication_verify()
2997 ut_params->op); in test_kasumi_authentication_verify()
2998 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_authentication_verify()
2999 ut_params->obuf = ut_params->op->sym->m_src; in test_kasumi_authentication_verify()
3000 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_kasumi_authentication_verify()
3004 if (ut_params->op->status == RTE_CRYPTO_OP_STATUS_SUCCESS) in test_kasumi_authentication_verify()
3155 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_encryption() local
3192 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_encryption()
3195 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_encryption()
3196 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_encryption()
3202 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_encryption()
3218 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_kasumi_encryption()
3220 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_encryption()
3221 ut_params->op); in test_kasumi_encryption()
3222 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_encryption()
3224 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_encryption()
3225 if (ut_params->obuf) in test_kasumi_encryption()
3226 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_kasumi_encryption()
3247 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_encryption_sgl() local
3302 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_kasumi_encryption_sgl()
3305 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_kasumi_encryption_sgl()
3317 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_kasumi_encryption_sgl()
3319 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_encryption_sgl()
3320 ut_params->op); in test_kasumi_encryption_sgl()
3321 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_encryption_sgl()
3323 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_encryption_sgl()
3325 if (ut_params->obuf) in test_kasumi_encryption_sgl()
3326 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_kasumi_encryption_sgl()
3329 ciphertext = rte_pktmbuf_read(ut_params->ibuf, in test_kasumi_encryption_sgl()
3351 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_encryption_oop() local
3382 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_encryption_oop()
3383 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_encryption_oop()
3386 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_encryption_oop()
3387 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_encryption_oop()
3393 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_encryption_oop()
3395 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_kasumi_encryption_oop()
3408 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_encryption_oop()
3409 ut_params->op); in test_kasumi_encryption_oop()
3410 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_encryption_oop()
3412 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_encryption_oop()
3413 if (ut_params->obuf) in test_kasumi_encryption_oop()
3414 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_kasumi_encryption_oop()
3435 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_encryption_oop_sgl() local
3484 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_kasumi_encryption_oop_sgl()
3486 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_kasumi_encryption_oop_sgl()
3491 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_kasumi_encryption_oop_sgl()
3501 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_encryption_oop_sgl()
3502 ut_params->op); in test_kasumi_encryption_oop_sgl()
3503 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_encryption_oop_sgl()
3505 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_encryption_oop_sgl()
3506 if (ut_params->obuf) in test_kasumi_encryption_oop_sgl()
3507 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_kasumi_encryption_oop_sgl()
3510 ciphertext = rte_pktmbuf_read(ut_params->ibuf, in test_kasumi_encryption_oop_sgl()
3530 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_decryption_oop() local
3560 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_decryption_oop()
3561 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_decryption_oop()
3564 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_decryption_oop()
3565 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_decryption_oop()
3571 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_decryption_oop()
3573 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_kasumi_decryption_oop()
3586 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_decryption_oop()
3587 ut_params->op); in test_kasumi_decryption_oop()
3588 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_decryption_oop()
3590 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_decryption_oop()
3591 if (ut_params->obuf) in test_kasumi_decryption_oop()
3592 plaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_kasumi_decryption_oop()
3613 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_decryption() local
3650 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_decryption()
3653 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_decryption()
3654 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_decryption()
3660 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_decryption()
3676 ut_params->op, 1, 0, 1, 0); in test_kasumi_decryption()
3678 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_decryption()
3679 ut_params->op); in test_kasumi_decryption()
3680 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_decryption()
3682 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_decryption()
3683 if (ut_params->obuf) in test_kasumi_decryption()
3684 plaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_kasumi_decryption()
3705 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_encryption() local
3742 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_encryption()
3745 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_encryption()
3746 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_encryption()
3752 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_encryption()
3768 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_encryption()
3770 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_encryption()
3771 ut_params->op); in test_snow3g_encryption()
3772 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_encryption()
3774 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_encryption()
3775 if (ut_params->obuf) in test_snow3g_encryption()
3776 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_encryption()
3796 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_encryption_oop() local
3826 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_encryption_oop()
3827 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_encryption_oop()
3829 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_snow3g_encryption_oop()
3831 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_snow3g_encryption_oop()
3835 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_encryption_oop()
3836 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_encryption_oop()
3842 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_encryption_oop()
3844 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_snow3g_encryption_oop()
3857 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_encryption_oop()
3858 ut_params->op); in test_snow3g_encryption_oop()
3859 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_encryption_oop()
3861 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_encryption_oop()
3862 if (ut_params->obuf) in test_snow3g_encryption_oop()
3863 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_encryption_oop()
3882 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_encryption_oop_sgl() local
3931 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_snow3g_encryption_oop_sgl()
3933 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_snow3g_encryption_oop_sgl()
3936 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_snow3g_encryption_oop_sgl()
3938 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_snow3g_encryption_oop_sgl()
3941 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_snow3g_encryption_oop_sgl()
3951 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_encryption_oop_sgl()
3952 ut_params->op); in test_snow3g_encryption_oop_sgl()
3953 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_encryption_oop_sgl()
3955 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_encryption_oop_sgl()
3956 if (ut_params->obuf) in test_snow3g_encryption_oop_sgl()
3957 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_snow3g_encryption_oop_sgl()
3960 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_snow3g_encryption_oop_sgl()
3999 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_encryption_offset_oop() local
4040 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_encryption_offset_oop()
4041 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_encryption_offset_oop()
4043 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_snow3g_encryption_offset_oop()
4045 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_snow3g_encryption_offset_oop()
4049 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_encryption_offset_oop()
4050 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_encryption_offset_oop()
4059 plaintext = (uint8_t *) rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_encryption_offset_oop()
4062 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_snow3g_encryption_offset_oop()
4078 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_encryption_offset_oop()
4079 ut_params->op); in test_snow3g_encryption_offset_oop()
4080 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_encryption_offset_oop()
4082 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_encryption_offset_oop()
4083 if (ut_params->obuf) in test_snow3g_encryption_offset_oop()
4084 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_encryption_offset_oop()
4114 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_decryption() local
4152 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_decryption()
4155 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_decryption()
4156 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_decryption()
4162 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_decryption()
4178 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_decryption()
4180 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_decryption()
4181 ut_params->op); in test_snow3g_decryption()
4182 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_decryption()
4183 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_decryption()
4184 if (ut_params->obuf) in test_snow3g_decryption()
4185 plaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_decryption()
4202 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_decryption_oop() local
4233 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_decryption_oop()
4234 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_decryption_oop()
4236 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_snow3g_decryption_oop()
4238 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_snow3g_decryption_oop()
4242 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_decryption_oop()
4243 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_decryption_oop()
4245 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_snow3g_decryption_oop()
4246 rte_pktmbuf_tailroom(ut_params->obuf)); in test_snow3g_decryption_oop()
4252 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_decryption_oop()
4254 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_snow3g_decryption_oop()
4267 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_decryption_oop()
4268 ut_params->op); in test_snow3g_decryption_oop()
4269 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_decryption_oop()
4270 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_decryption_oop()
4271 if (ut_params->obuf) in test_snow3g_decryption_oop()
4272 plaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_decryption_oop()
4290 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_cipher_auth() local
4342 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_zuc_cipher_auth()
4345 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_zuc_cipher_auth()
4346 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_zuc_cipher_auth()
4352 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_zuc_cipher_auth()
4365 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_zuc_cipher_auth()
4367 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_cipher_auth()
4368 ut_params->op); in test_zuc_cipher_auth()
4369 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_cipher_auth()
4370 ut_params->obuf = ut_params->op->sym->m_src; in test_zuc_cipher_auth()
4371 if (ut_params->obuf) in test_zuc_cipher_auth()
4372 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_zuc_cipher_auth()
4384 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_zuc_cipher_auth()
4389 ut_params->digest, in test_zuc_cipher_auth()
4400 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_cipher_auth() local
4445 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_cipher_auth()
4448 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_cipher_auth()
4449 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_cipher_auth()
4455 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_cipher_auth()
4477 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_snow3g_cipher_auth()
4479 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_cipher_auth()
4480 ut_params->op); in test_snow3g_cipher_auth()
4481 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_cipher_auth()
4482 ut_params->obuf = ut_params->op->sym->m_src; in test_snow3g_cipher_auth()
4483 if (ut_params->obuf) in test_snow3g_cipher_auth()
4484 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_cipher_auth()
4496 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_snow3g_cipher_auth()
4501 ut_params->digest, in test_snow3g_cipher_auth()
4513 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_auth_cipher() local
4576 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_auth_cipher()
4578 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_auth_cipher()
4581 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_auth_cipher()
4582 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_auth_cipher()
4584 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_snow3g_auth_cipher()
4585 rte_pktmbuf_tailroom(ut_params->obuf)); in test_snow3g_auth_cipher()
4593 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_auth_cipher()
4597 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_snow3g_auth_cipher()
4601 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_auth_cipher()
4605 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_snow3g_auth_cipher()
4628 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_snow3g_auth_cipher()
4630 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_auth_cipher()
4631 ut_params->op); in test_snow3g_auth_cipher()
4633 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_auth_cipher()
4635 ut_params->obuf = (op_mode == IN_PLACE ? in test_snow3g_auth_cipher()
4636 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_snow3g_auth_cipher()
4639 if (ut_params->obuf) in test_snow3g_auth_cipher()
4640 plaintext = rte_pktmbuf_mtod(ut_params->obuf, in test_snow3g_auth_cipher()
4652 if (ut_params->obuf) in test_snow3g_auth_cipher()
4653 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, in test_snow3g_auth_cipher()
4663 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_snow3g_auth_cipher()
4667 debug_hexdump(stdout, "digest:", ut_params->digest, in test_snow3g_auth_cipher()
4688 ut_params->digest, in test_snow3g_auth_cipher()
4701 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_auth_cipher_sgl() local
4783 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_snow3g_auth_cipher_sgl()
4785 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_snow3g_auth_cipher_sgl()
4789 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_snow3g_auth_cipher_sgl()
4791 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_snow3g_auth_cipher_sgl()
4796 pktmbuf_write(ut_params->ibuf, 0, ciphertext_len, in test_snow3g_auth_cipher_sgl()
4798 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_snow3g_auth_cipher_sgl()
4803 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, in test_snow3g_auth_cipher_sgl()
4805 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_snow3g_auth_cipher_sgl()
4831 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_snow3g_auth_cipher_sgl()
4833 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_auth_cipher_sgl()
4834 ut_params->op); in test_snow3g_auth_cipher_sgl()
4836 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_auth_cipher_sgl()
4838 ut_params->obuf = (op_mode == IN_PLACE ? in test_snow3g_auth_cipher_sgl()
4839 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_snow3g_auth_cipher_sgl()
4842 if (ut_params->obuf) in test_snow3g_auth_cipher_sgl()
4843 plaintext = rte_pktmbuf_read(ut_params->obuf, 0, in test_snow3g_auth_cipher_sgl()
4846 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_snow3g_auth_cipher_sgl()
4855 if (ut_params->obuf) in test_snow3g_auth_cipher_sgl()
4856 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_snow3g_auth_cipher_sgl()
4859 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_snow3g_auth_cipher_sgl()
4867 if (ut_params->obuf) in test_snow3g_auth_cipher_sgl()
4868 digest = rte_pktmbuf_read(ut_params->obuf, in test_snow3g_auth_cipher_sgl()
4873 digest = rte_pktmbuf_read(ut_params->ibuf, in test_snow3g_auth_cipher_sgl()
4912 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_auth_cipher() local
4975 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_auth_cipher()
4977 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_auth_cipher()
4980 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_auth_cipher()
4981 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_auth_cipher()
4983 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_kasumi_auth_cipher()
4984 rte_pktmbuf_tailroom(ut_params->obuf)); in test_kasumi_auth_cipher()
4992 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_auth_cipher()
4996 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_kasumi_auth_cipher()
5000 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_auth_cipher()
5004 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_kasumi_auth_cipher()
5028 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_kasumi_auth_cipher()
5030 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_auth_cipher()
5031 ut_params->op); in test_kasumi_auth_cipher()
5033 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_auth_cipher()
5035 ut_params->obuf = (op_mode == IN_PLACE ? in test_kasumi_auth_cipher()
5036 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_kasumi_auth_cipher()
5040 if (ut_params->obuf) in test_kasumi_auth_cipher()
5041 plaintext = rte_pktmbuf_mtod(ut_params->obuf, in test_kasumi_auth_cipher()
5052 if (ut_params->obuf) in test_kasumi_auth_cipher()
5053 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, in test_kasumi_auth_cipher()
5063 ut_params->digest = rte_pktmbuf_mtod( in test_kasumi_auth_cipher()
5064 ut_params->obuf, uint8_t *) + in test_kasumi_auth_cipher()
5068 debug_hexdump(stdout, "digest:", ut_params->digest, in test_kasumi_auth_cipher()
5089 ut_params->digest, in test_kasumi_auth_cipher()
5102 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_auth_cipher_sgl() local
5184 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_kasumi_auth_cipher_sgl()
5186 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_kasumi_auth_cipher_sgl()
5190 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_kasumi_auth_cipher_sgl()
5192 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_kasumi_auth_cipher_sgl()
5197 pktmbuf_write(ut_params->ibuf, 0, ciphertext_len, in test_kasumi_auth_cipher_sgl()
5199 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_kasumi_auth_cipher_sgl()
5204 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, in test_kasumi_auth_cipher_sgl()
5206 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_kasumi_auth_cipher_sgl()
5232 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_kasumi_auth_cipher_sgl()
5234 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_auth_cipher_sgl()
5235 ut_params->op); in test_kasumi_auth_cipher_sgl()
5237 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_auth_cipher_sgl()
5239 ut_params->obuf = (op_mode == IN_PLACE ? in test_kasumi_auth_cipher_sgl()
5240 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_kasumi_auth_cipher_sgl()
5243 if (ut_params->obuf) in test_kasumi_auth_cipher_sgl()
5244 plaintext = rte_pktmbuf_read(ut_params->obuf, 0, in test_kasumi_auth_cipher_sgl()
5247 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_kasumi_auth_cipher_sgl()
5256 if (ut_params->obuf) in test_kasumi_auth_cipher_sgl()
5257 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_kasumi_auth_cipher_sgl()
5260 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_kasumi_auth_cipher_sgl()
5268 if (ut_params->obuf) in test_kasumi_auth_cipher_sgl()
5269 digest = rte_pktmbuf_read(ut_params->obuf, in test_kasumi_auth_cipher_sgl()
5274 digest = rte_pktmbuf_read(ut_params->ibuf, in test_kasumi_auth_cipher_sgl()
5312 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_cipher_auth() local
5359 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_cipher_auth()
5362 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_cipher_auth()
5363 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_cipher_auth()
5369 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_cipher_auth()
5390 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_kasumi_cipher_auth()
5392 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_cipher_auth()
5393 ut_params->op); in test_kasumi_cipher_auth()
5394 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_cipher_auth()
5396 if (ut_params->op->sym->m_dst) in test_kasumi_cipher_auth()
5397 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_cipher_auth()
5399 ut_params->obuf = ut_params->op->sym->m_src; in test_kasumi_cipher_auth()
5401 ciphertext = rte_pktmbuf_mtod_offset(ut_params->obuf, uint8_t *, in test_kasumi_cipher_auth()
5404 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_kasumi_cipher_auth()
5418 ut_params->digest, in test_kasumi_cipher_auth()
5429 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_encryption() local
5468 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_zuc_encryption()
5471 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_zuc_encryption()
5472 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_zuc_encryption()
5478 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_zuc_encryption()
5494 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_zuc_encryption()
5496 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_encryption()
5497 ut_params->op); in test_zuc_encryption()
5498 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_encryption()
5500 ut_params->obuf = ut_params->op->sym->m_dst; in test_zuc_encryption()
5501 if (ut_params->obuf) in test_zuc_encryption()
5502 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_zuc_encryption()
5521 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_encryption_sgl() local
5566 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_zuc_encryption_sgl()
5569 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, in test_zuc_encryption_sgl()
5583 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_zuc_encryption_sgl()
5594 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_zuc_encryption_sgl()
5596 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_encryption_sgl()
5597 ut_params->op); in test_zuc_encryption_sgl()
5598 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_encryption_sgl()
5600 ut_params->obuf = ut_params->op->sym->m_dst; in test_zuc_encryption_sgl()
5601 if (ut_params->obuf) in test_zuc_encryption_sgl()
5602 ciphertext = rte_pktmbuf_read(ut_params->obuf, in test_zuc_encryption_sgl()
5605 ciphertext = rte_pktmbuf_read(ut_params->ibuf, in test_zuc_encryption_sgl()
5625 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_authentication() local
5671 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_zuc_authentication()
5673 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_zuc_authentication()
5674 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_zuc_authentication()
5680 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_zuc_authentication()
5695 ut_params->op, 0, 1, 1, 0); in test_zuc_authentication()
5697 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_authentication()
5698 ut_params->op); in test_zuc_authentication()
5699 ut_params->obuf = ut_params->op->sym->m_src; in test_zuc_authentication()
5700 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_authentication()
5701 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_zuc_authentication()
5706 ut_params->digest, in test_zuc_authentication()
5719 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_auth_cipher() local
5786 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_zuc_auth_cipher()
5788 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_zuc_auth_cipher()
5791 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_zuc_auth_cipher()
5792 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_zuc_auth_cipher()
5794 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_zuc_auth_cipher()
5795 rte_pktmbuf_tailroom(ut_params->obuf)); in test_zuc_auth_cipher()
5803 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_zuc_auth_cipher()
5807 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_zuc_auth_cipher()
5811 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_zuc_auth_cipher()
5815 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_zuc_auth_cipher()
5839 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_zuc_auth_cipher()
5841 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_auth_cipher()
5842 ut_params->op); in test_zuc_auth_cipher()
5844 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_auth_cipher()
5846 ut_params->obuf = (op_mode == IN_PLACE ? in test_zuc_auth_cipher()
5847 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_zuc_auth_cipher()
5851 if (ut_params->obuf) in test_zuc_auth_cipher()
5852 plaintext = rte_pktmbuf_mtod(ut_params->obuf, in test_zuc_auth_cipher()
5863 if (ut_params->obuf) in test_zuc_auth_cipher()
5864 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, in test_zuc_auth_cipher()
5874 ut_params->digest = rte_pktmbuf_mtod( in test_zuc_auth_cipher()
5875 ut_params->obuf, uint8_t *) + in test_zuc_auth_cipher()
5879 debug_hexdump(stdout, "digest:", ut_params->digest, in test_zuc_auth_cipher()
5900 ut_params->digest, in test_zuc_auth_cipher()
5913 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_auth_cipher_sgl() local
5989 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_zuc_auth_cipher_sgl()
5991 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_zuc_auth_cipher_sgl()
5995 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_zuc_auth_cipher_sgl()
5997 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_zuc_auth_cipher_sgl()
6002 pktmbuf_write(ut_params->ibuf, 0, ciphertext_len, in test_zuc_auth_cipher_sgl()
6004 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_zuc_auth_cipher_sgl()
6009 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, in test_zuc_auth_cipher_sgl()
6011 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_zuc_auth_cipher_sgl()
6037 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_zuc_auth_cipher_sgl()
6039 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_auth_cipher_sgl()
6040 ut_params->op); in test_zuc_auth_cipher_sgl()
6042 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_auth_cipher_sgl()
6044 ut_params->obuf = (op_mode == IN_PLACE ? in test_zuc_auth_cipher_sgl()
6045 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_zuc_auth_cipher_sgl()
6048 if (ut_params->obuf) in test_zuc_auth_cipher_sgl()
6049 plaintext = rte_pktmbuf_read(ut_params->obuf, 0, in test_zuc_auth_cipher_sgl()
6052 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_zuc_auth_cipher_sgl()
6061 if (ut_params->obuf) in test_zuc_auth_cipher_sgl()
6062 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_zuc_auth_cipher_sgl()
6065 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_zuc_auth_cipher_sgl()
6073 if (ut_params->obuf) in test_zuc_auth_cipher_sgl()
6074 digest = rte_pktmbuf_read(ut_params->obuf, in test_zuc_auth_cipher_sgl()
6079 digest = rte_pktmbuf_read(ut_params->ibuf, in test_zuc_auth_cipher_sgl()
6746 struct crypto_unittest_params *ut_params = &unittest_params; in test_mixed_auth_cipher() local
6798 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_mixed_auth_cipher()
6800 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_mixed_auth_cipher()
6803 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_mixed_auth_cipher()
6804 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_mixed_auth_cipher()
6807 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_mixed_auth_cipher()
6808 rte_pktmbuf_tailroom(ut_params->obuf)); in test_mixed_auth_cipher()
6817 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_mixed_auth_cipher()
6821 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_mixed_auth_cipher()
6825 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_mixed_auth_cipher()
6829 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_mixed_auth_cipher()
6850 op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); in test_mixed_auth_cipher()
6854 if (op == NULL && ut_params->op->status == in test_mixed_auth_cipher()
6860 ut_params->op = op; in test_mixed_auth_cipher()
6862 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_mixed_auth_cipher()
6864 ut_params->obuf = (op_mode == IN_PLACE ? in test_mixed_auth_cipher()
6865 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_mixed_auth_cipher()
6868 if (ut_params->obuf) in test_mixed_auth_cipher()
6869 plaintext = rte_pktmbuf_mtod(ut_params->obuf, in test_mixed_auth_cipher()
6881 if (ut_params->obuf) in test_mixed_auth_cipher()
6882 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, in test_mixed_auth_cipher()
6893 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_mixed_auth_cipher()
6897 debug_hexdump(stdout, "digest:", ut_params->digest, in test_mixed_auth_cipher()
6919 ut_params->digest, in test_mixed_auth_cipher()
6925 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_mixed_auth_cipher()
6936 struct crypto_unittest_params *ut_params = &unittest_params; in test_mixed_auth_cipher_sgl() local
7010 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_mixed_auth_cipher_sgl()
7012 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_mixed_auth_cipher_sgl()
7016 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_mixed_auth_cipher_sgl()
7018 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_mixed_auth_cipher_sgl()
7023 pktmbuf_write(ut_params->ibuf, 0, ciphertext_len, in test_mixed_auth_cipher_sgl()
7025 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_mixed_auth_cipher_sgl()
7030 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, in test_mixed_auth_cipher_sgl()
7032 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_mixed_auth_cipher_sgl()
7056 op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); in test_mixed_auth_cipher_sgl()
7060 if (op == NULL && ut_params->op->status == in test_mixed_auth_cipher_sgl()
7066 ut_params->op = op; in test_mixed_auth_cipher_sgl()
7068 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_mixed_auth_cipher_sgl()
7070 ut_params->obuf = (op_mode == IN_PLACE ? in test_mixed_auth_cipher_sgl()
7071 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_mixed_auth_cipher_sgl()
7074 if (ut_params->obuf) in test_mixed_auth_cipher_sgl()
7075 plaintext = rte_pktmbuf_read(ut_params->obuf, 0, in test_mixed_auth_cipher_sgl()
7078 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_mixed_auth_cipher_sgl()
7089 if (ut_params->obuf) in test_mixed_auth_cipher_sgl()
7090 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_mixed_auth_cipher_sgl()
7093 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_mixed_auth_cipher_sgl()
7102 if (ut_params->obuf) in test_mixed_auth_cipher_sgl()
7103 digest = rte_pktmbuf_read(ut_params->obuf, in test_mixed_auth_cipher_sgl()
7109 digest = rte_pktmbuf_read(ut_params->ibuf, in test_mixed_auth_cipher_sgl()
7141 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_mixed_auth_cipher_sgl()
7387 struct crypto_unittest_params *ut_params = &unittest_params; in create_aead_session() local
7392 ut_params->aead_xform.type = RTE_CRYPTO_SYM_XFORM_AEAD; in create_aead_session()
7393 ut_params->aead_xform.next = NULL; in create_aead_session()
7394 ut_params->aead_xform.aead.algo = algo; in create_aead_session()
7395 ut_params->aead_xform.aead.op = op; in create_aead_session()
7396 ut_params->aead_xform.aead.key.data = aead_key; in create_aead_session()
7397 ut_params->aead_xform.aead.key.length = key_len; in create_aead_session()
7398 ut_params->aead_xform.aead.iv.offset = IV_OFFSET; in create_aead_session()
7399 ut_params->aead_xform.aead.iv.length = iv_len; in create_aead_session()
7400 ut_params->aead_xform.aead.digest_length = auth_len; in create_aead_session()
7401 ut_params->aead_xform.aead.aad_length = aad_len; in create_aead_session()
7406 ut_params->sess = rte_cryptodev_sym_session_create( in create_aead_session()
7409 rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_aead_session()
7410 &ut_params->aead_xform, in create_aead_session()
7413 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_aead_session()
7453 struct crypto_unittest_params *ut_params = &unittest_params; in create_aead_operation() local
7459 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_aead_operation()
7461 TEST_ASSERT_NOT_NULL(ut_params->op, in create_aead_operation()
7464 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_aead_operation()
7469 sym_op->aead.aad.data = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in create_aead_operation()
7475 rte_pktmbuf_iova(ut_params->ibuf); in create_aead_operation()
7482 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_aead_operation()
7491 sym_op->aead.aad.data = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in create_aead_operation()
7497 rte_pktmbuf_iova(ut_params->ibuf); in create_aead_operation()
7503 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_aead_operation()
7520 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in create_aead_operation()
7528 if (ut_params->obuf) { in create_aead_operation()
7530 ut_params->obuf, in create_aead_operation()
7540 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in create_aead_operation()
7550 if (ut_params->obuf) { in create_aead_operation()
7552 ut_params->obuf, in create_aead_operation()
7565 ut_params->obuf ? ut_params->obuf : in create_aead_operation()
7566 ut_params->ibuf, in create_aead_operation()
7572 ut_params->obuf ? ut_params->obuf : in create_aead_operation()
7573 ut_params->ibuf, in create_aead_operation()
7578 ut_params->ibuf, tdata->auth_tag.len); in create_aead_operation()
7582 ut_params->ibuf, in create_aead_operation()
7602 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_encryption() local
7644 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool); in test_authenticated_encryption()
7649 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption()
7652 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_encryption()
7653 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_encryption()
7660 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_authenticated_encryption()
7662 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_encryption()
7666 process_cpu_aead_op(ts_params->valid_devs[0], ut_params->op); in test_authenticated_encryption()
7669 ut_params->op, 0, 0, 0, 0); in test_authenticated_encryption()
7673 ut_params->op), "failed to process sym crypto op"); in test_authenticated_encryption()
7675 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_encryption()
7680 if (ut_params->op->sym->m_dst) { in test_authenticated_encryption()
7681 ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_dst, in test_authenticated_encryption()
7683 auth_tag = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_dst, in test_authenticated_encryption()
7686 ciphertext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_src, in test_authenticated_encryption()
7688 ut_params->op->sym->cipher.data.offset); in test_authenticated_encryption()
7762 struct crypto_unittest_params *ut_params = &unittest_params; in test_pdcp_proto() local
7772 sec_cap_idx.action = ut_params->type; in test_pdcp_proto()
7779 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_pdcp_proto()
7782 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_pdcp_proto()
7783 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_pdcp_proto()
7785 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_pdcp_proto()
7794 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_pdcp_proto()
7795 rte_pktmbuf_append(ut_params->obuf, output_vec_len); in test_pdcp_proto()
7799 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_pdcp_proto()
7800 ut_params->cipher_xform.cipher.algo = cipher_alg; in test_pdcp_proto()
7801 ut_params->cipher_xform.cipher.op = opc; in test_pdcp_proto()
7802 ut_params->cipher_xform.cipher.key.data = cipher_key; in test_pdcp_proto()
7803 ut_params->cipher_xform.cipher.key.length = cipher_key_len; in test_pdcp_proto()
7804 ut_params->cipher_xform.cipher.iv.length = in test_pdcp_proto()
7806 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_pdcp_proto()
7810 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_pdcp_proto()
7811 ut_params->auth_xform.next = NULL; in test_pdcp_proto()
7812 ut_params->auth_xform.auth.algo = auth_alg; in test_pdcp_proto()
7813 ut_params->auth_xform.auth.op = opa; in test_pdcp_proto()
7814 ut_params->auth_xform.auth.key.data = auth_key; in test_pdcp_proto()
7815 ut_params->auth_xform.auth.key.length = auth_key_len; in test_pdcp_proto()
7817 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_pdcp_proto()
7819 ut_params->cipher_xform.next = NULL; in test_pdcp_proto()
7823 .action_type = ut_params->type, in test_pdcp_proto()
7843 .crypto_xform = &ut_params->cipher_xform in test_pdcp_proto()
7847 ut_params->sec_session = rte_security_session_create(ctx, in test_pdcp_proto()
7851 if (!ut_params->sec_session) { in test_pdcp_proto()
7859 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_pdcp_proto()
7861 if (!ut_params->op) { in test_pdcp_proto()
7869 uint32_t *per_pkt_hfn = rte_crypto_op_ctod_offset(ut_params->op, in test_pdcp_proto()
7873 rte_security_attach_session(ut_params->op, ut_params->sec_session); in test_pdcp_proto()
7876 ut_params->op->sym->m_src = ut_params->ibuf; in test_pdcp_proto()
7878 ut_params->op->sym->m_dst = ut_params->obuf; in test_pdcp_proto()
7881 if (process_crypto_request(ts_params->valid_devs[0], ut_params->op) in test_pdcp_proto()
7890 if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { in test_pdcp_proto()
7898 uint8_t *ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_src, in test_pdcp_proto()
7901 ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_dst, in test_pdcp_proto()
7914 rte_crypto_op_free(ut_params->op); in test_pdcp_proto()
7915 ut_params->op = NULL; in test_pdcp_proto()
7917 if (ut_params->sec_session) in test_pdcp_proto()
7918 rte_security_session_destroy(ctx, ut_params->sec_session); in test_pdcp_proto()
7919 ut_params->sec_session = NULL; in test_pdcp_proto()
7921 rte_pktmbuf_free(ut_params->ibuf); in test_pdcp_proto()
7922 ut_params->ibuf = NULL; in test_pdcp_proto()
7924 rte_pktmbuf_free(ut_params->obuf); in test_pdcp_proto()
7925 ut_params->obuf = NULL; in test_pdcp_proto()
7943 struct crypto_unittest_params *ut_params = &unittest_params; in test_pdcp_proto_SGL() local
7958 sec_cap_idx.action = ut_params->type; in test_pdcp_proto_SGL()
7985 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_pdcp_proto_SGL()
7986 rte_pktmbuf_append(ut_params->obuf, frag_size_oop); in test_pdcp_proto_SGL()
7987 buf_oop = ut_params->obuf; in test_pdcp_proto_SGL()
7991 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_pdcp_proto_SGL()
7994 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_pdcp_proto_SGL()
7995 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_pdcp_proto_SGL()
7997 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_pdcp_proto_SGL()
8002 buf = ut_params->ibuf; in test_pdcp_proto_SGL()
8038 ut_params->ibuf->nb_segs = segs; in test_pdcp_proto_SGL()
8065 ut_params->obuf->nb_segs = segs; in test_pdcp_proto_SGL()
8069 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_pdcp_proto_SGL()
8070 ut_params->cipher_xform.cipher.algo = pdcp_test_params[i].cipher_alg; in test_pdcp_proto_SGL()
8071 ut_params->cipher_xform.cipher.op = opc; in test_pdcp_proto_SGL()
8072 ut_params->cipher_xform.cipher.key.data = pdcp_test_crypto_key[i]; in test_pdcp_proto_SGL()
8073 ut_params->cipher_xform.cipher.key.length = in test_pdcp_proto_SGL()
8075 ut_params->cipher_xform.cipher.iv.length = 0; in test_pdcp_proto_SGL()
8079 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_pdcp_proto_SGL()
8080 ut_params->auth_xform.next = NULL; in test_pdcp_proto_SGL()
8081 ut_params->auth_xform.auth.algo = pdcp_test_params[i].auth_alg; in test_pdcp_proto_SGL()
8082 ut_params->auth_xform.auth.op = opa; in test_pdcp_proto_SGL()
8083 ut_params->auth_xform.auth.key.data = pdcp_test_auth_key[i]; in test_pdcp_proto_SGL()
8084 ut_params->auth_xform.auth.key.length = in test_pdcp_proto_SGL()
8087 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_pdcp_proto_SGL()
8089 ut_params->cipher_xform.next = NULL; in test_pdcp_proto_SGL()
8093 .action_type = ut_params->type, in test_pdcp_proto_SGL()
8104 .crypto_xform = &ut_params->cipher_xform in test_pdcp_proto_SGL()
8108 ut_params->sec_session = rte_security_session_create(ctx, in test_pdcp_proto_SGL()
8112 if (!ut_params->sec_session) { in test_pdcp_proto_SGL()
8120 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_pdcp_proto_SGL()
8122 if (!ut_params->op) { in test_pdcp_proto_SGL()
8130 rte_security_attach_session(ut_params->op, ut_params->sec_session); in test_pdcp_proto_SGL()
8133 ut_params->op->sym->m_src = ut_params->ibuf; in test_pdcp_proto_SGL()
8135 ut_params->op->sym->m_dst = ut_params->obuf; in test_pdcp_proto_SGL()
8138 if (process_crypto_request(ts_params->valid_devs[0], ut_params->op) in test_pdcp_proto_SGL()
8147 if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { in test_pdcp_proto_SGL()
8155 uint8_t *ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_src, in test_pdcp_proto_SGL()
8158 ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_dst, in test_pdcp_proto_SGL()
8171 buf = ut_params->op->sym->m_src->next; in test_pdcp_proto_SGL()
8173 buf = ut_params->op->sym->m_dst->next; in test_pdcp_proto_SGL()
8193 rte_crypto_op_free(ut_params->op); in test_pdcp_proto_SGL()
8194 ut_params->op = NULL; in test_pdcp_proto_SGL()
8196 if (ut_params->sec_session) in test_pdcp_proto_SGL()
8197 rte_security_session_destroy(ctx, ut_params->sec_session); in test_pdcp_proto_SGL()
8198 ut_params->sec_session = NULL; in test_pdcp_proto_SGL()
8200 rte_pktmbuf_free(ut_params->ibuf); in test_pdcp_proto_SGL()
8201 ut_params->ibuf = NULL; in test_pdcp_proto_SGL()
8203 rte_pktmbuf_free(ut_params->obuf); in test_pdcp_proto_SGL()
8204 ut_params->obuf = NULL; in test_pdcp_proto_SGL()
8460 struct crypto_unittest_params *ut_params = &unittest_params; in test_PDCP_PROTO_all() local
8471 ut_params->type = gbl_action_type == RTE_SECURITY_ACTION_TYPE_NONE ? in test_PDCP_PROTO_all()
8475 if (security_proto_supported(ut_params->type, in test_PDCP_PROTO_all()
8500 struct crypto_unittest_params *ut_params = &unittest_params; in test_docsis_proto_uplink() local
8518 sec_cap_idx.action = ut_params->type; in test_docsis_proto_uplink()
8545 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_docsis_proto_uplink()
8546 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_docsis_proto_uplink()
8547 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_docsis_proto_uplink()
8549 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_docsis_proto_uplink()
8555 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_docsis_proto_uplink()
8556 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI; in test_docsis_proto_uplink()
8557 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT; in test_docsis_proto_uplink()
8558 ut_params->cipher_xform.cipher.key.data = d_td->key.data; in test_docsis_proto_uplink()
8559 ut_params->cipher_xform.cipher.key.length = d_td->key.len; in test_docsis_proto_uplink()
8560 ut_params->cipher_xform.cipher.iv.length = d_td->iv.len; in test_docsis_proto_uplink()
8561 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_docsis_proto_uplink()
8562 ut_params->cipher_xform.next = NULL; in test_docsis_proto_uplink()
8565 ut_params->docsis_xform.direction = RTE_SECURITY_DOCSIS_UPLINK; in test_docsis_proto_uplink()
8568 .action_type = ut_params->type, in test_docsis_proto_uplink()
8570 .docsis = ut_params->docsis_xform, in test_docsis_proto_uplink()
8571 .crypto_xform = &ut_params->cipher_xform, in test_docsis_proto_uplink()
8575 ut_params->sec_session = rte_security_session_create(ctx, &sess_conf, in test_docsis_proto_uplink()
8579 if (!ut_params->sec_session) { in test_docsis_proto_uplink()
8587 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_docsis_proto_uplink()
8589 if (!ut_params->op) { in test_docsis_proto_uplink()
8605 ut_params->op->sym->auth.data.length = crc_len; in test_docsis_proto_uplink()
8606 ut_params->op->sym->auth.data.offset = d_td->ciphertext.crc_offset; in test_docsis_proto_uplink()
8614 ut_params->op->sym->cipher.data.length = cipher_len; in test_docsis_proto_uplink()
8615 ut_params->op->sym->cipher.data.offset = d_td->ciphertext.cipher_offset; in test_docsis_proto_uplink()
8618 iv_ptr = (uint8_t *)ut_params->op + IV_OFFSET; in test_docsis_proto_uplink()
8622 rte_security_attach_session(ut_params->op, ut_params->sec_session); in test_docsis_proto_uplink()
8625 ut_params->op->sym->m_src = ut_params->ibuf; in test_docsis_proto_uplink()
8626 ut_params->op->sym->m_dst = NULL; in test_docsis_proto_uplink()
8629 if (process_crypto_request(ts_params->valid_devs[0], ut_params->op) == in test_docsis_proto_uplink()
8638 if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { in test_docsis_proto_uplink()
8660 rte_crypto_op_free(ut_params->op); in test_docsis_proto_uplink()
8661 ut_params->op = NULL; in test_docsis_proto_uplink()
8663 if (ut_params->sec_session) in test_docsis_proto_uplink()
8664 rte_security_session_destroy(ctx, ut_params->sec_session); in test_docsis_proto_uplink()
8665 ut_params->sec_session = NULL; in test_docsis_proto_uplink()
8667 rte_pktmbuf_free(ut_params->ibuf); in test_docsis_proto_uplink()
8668 ut_params->ibuf = NULL; in test_docsis_proto_uplink()
8677 struct crypto_unittest_params *ut_params = &unittest_params; in test_docsis_proto_downlink() local
8694 sec_cap_idx.action = ut_params->type; in test_docsis_proto_downlink()
8721 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_docsis_proto_downlink()
8722 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_docsis_proto_downlink()
8723 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_docsis_proto_downlink()
8725 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_docsis_proto_downlink()
8731 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_docsis_proto_downlink()
8732 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI; in test_docsis_proto_downlink()
8733 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; in test_docsis_proto_downlink()
8734 ut_params->cipher_xform.cipher.key.data = d_td->key.data; in test_docsis_proto_downlink()
8735 ut_params->cipher_xform.cipher.key.length = d_td->key.len; in test_docsis_proto_downlink()
8736 ut_params->cipher_xform.cipher.iv.length = d_td->iv.len; in test_docsis_proto_downlink()
8737 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_docsis_proto_downlink()
8738 ut_params->cipher_xform.next = NULL; in test_docsis_proto_downlink()
8741 ut_params->docsis_xform.direction = RTE_SECURITY_DOCSIS_DOWNLINK; in test_docsis_proto_downlink()
8744 .action_type = ut_params->type, in test_docsis_proto_downlink()
8746 .docsis = ut_params->docsis_xform, in test_docsis_proto_downlink()
8747 .crypto_xform = &ut_params->cipher_xform, in test_docsis_proto_downlink()
8751 ut_params->sec_session = rte_security_session_create(ctx, &sess_conf, in test_docsis_proto_downlink()
8755 if (!ut_params->sec_session) { in test_docsis_proto_downlink()
8763 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_docsis_proto_downlink()
8765 if (!ut_params->op) { in test_docsis_proto_downlink()
8780 ut_params->op->sym->auth.data.length = crc_len; in test_docsis_proto_downlink()
8781 ut_params->op->sym->auth.data.offset = d_td->plaintext.crc_offset; in test_docsis_proto_downlink()
8789 ut_params->op->sym->cipher.data.length = cipher_len; in test_docsis_proto_downlink()
8790 ut_params->op->sym->cipher.data.offset = d_td->plaintext.cipher_offset; in test_docsis_proto_downlink()
8793 iv_ptr = (uint8_t *)ut_params->op + IV_OFFSET; in test_docsis_proto_downlink()
8797 rte_security_attach_session(ut_params->op, ut_params->sec_session); in test_docsis_proto_downlink()
8800 ut_params->op->sym->m_src = ut_params->ibuf; in test_docsis_proto_downlink()
8801 ut_params->op->sym->m_dst = NULL; in test_docsis_proto_downlink()
8804 if (process_crypto_request(ts_params->valid_devs[0], ut_params->op) == in test_docsis_proto_downlink()
8813 if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { in test_docsis_proto_downlink()
8834 rte_crypto_op_free(ut_params->op); in test_docsis_proto_downlink()
8835 ut_params->op = NULL; in test_docsis_proto_downlink()
8837 if (ut_params->sec_session) in test_docsis_proto_downlink()
8838 rte_security_session_destroy(ctx, ut_params->sec_session); in test_docsis_proto_downlink()
8839 ut_params->sec_session = NULL; in test_docsis_proto_downlink()
8841 rte_pktmbuf_free(ut_params->ibuf); in test_docsis_proto_downlink()
8842 ut_params->ibuf = NULL; in test_docsis_proto_downlink()
8946 struct crypto_unittest_params *ut_params = &unittest_params; in test_DOCSIS_PROTO_all() local
8957 ut_params->type = gbl_action_type == RTE_SECURITY_ACTION_TYPE_NONE ? in test_DOCSIS_PROTO_all()
8961 if (security_proto_supported(ut_params->type, in test_DOCSIS_PROTO_all()
9228 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_decryption() local
9270 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool); in test_authenticated_decryption()
9275 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decryption()
9277 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_decryption()
9278 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_decryption()
9285 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_authenticated_decryption()
9287 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_decryption()
9291 process_cpu_aead_op(ts_params->valid_devs[0], ut_params->op); in test_authenticated_decryption()
9294 ut_params->op, 0, 0, 0, 0); in test_authenticated_decryption()
9298 ut_params->op), "failed to process sym crypto op"); in test_authenticated_decryption()
9300 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_decryption()
9303 if (ut_params->op->sym->m_dst) in test_authenticated_decryption()
9304 plaintext = rte_pktmbuf_mtod(ut_params->op->sym->m_dst, in test_authenticated_decryption()
9307 plaintext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_src, in test_authenticated_decryption()
9309 ut_params->op->sym->cipher.data.offset); in test_authenticated_decryption()
9320 TEST_ASSERT_EQUAL(ut_params->op->status, in test_authenticated_decryption()
9575 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_encryption_oop() local
9606 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption_oop()
9607 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption_oop()
9610 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_encryption_oop()
9611 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_encryption_oop()
9612 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_authenticated_encryption_oop()
9613 rte_pktmbuf_tailroom(ut_params->obuf)); in test_authenticated_encryption_oop()
9620 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_authenticated_encryption_oop()
9622 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_encryption_oop()
9623 ut_params->op->sym->m_dst = ut_params->obuf; in test_authenticated_encryption_oop()
9627 ut_params->op), "failed to process sym crypto op"); in test_authenticated_encryption_oop()
9629 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_encryption_oop()
9634 ciphertext = rte_pktmbuf_mtod_offset(ut_params->obuf, uint8_t *, in test_authenticated_encryption_oop()
9635 ut_params->op->sym->cipher.data.offset); in test_authenticated_encryption_oop()
9668 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_decryption_oop() local
9697 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decryption_oop()
9698 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decryption_oop()
9700 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_decryption_oop()
9701 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_decryption_oop()
9702 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_authenticated_decryption_oop()
9703 rte_pktmbuf_tailroom(ut_params->obuf)); in test_authenticated_decryption_oop()
9710 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_authenticated_decryption_oop()
9712 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_decryption_oop()
9713 ut_params->op->sym->m_dst = ut_params->obuf; in test_authenticated_decryption_oop()
9717 ut_params->op), "failed to process sym crypto op"); in test_authenticated_decryption_oop()
9719 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_decryption_oop()
9722 plaintext = rte_pktmbuf_mtod_offset(ut_params->obuf, uint8_t *, in test_authenticated_decryption_oop()
9723 ut_params->op->sym->cipher.data.offset); in test_authenticated_decryption_oop()
9734 TEST_ASSERT_EQUAL(ut_params->op->status, in test_authenticated_decryption_oop()
9751 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_encryption_sessionless() local
9779 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption_sessionless()
9782 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_encryption_sessionless()
9783 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_encryption_sessionless()
9792 retval = create_aead_xform(ut_params->op, in test_authenticated_encryption_sessionless()
9801 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_encryption_sessionless()
9803 TEST_ASSERT_EQUAL(ut_params->op->sess_type, in test_authenticated_encryption_sessionless()
9809 ut_params->op), "failed to process sym crypto op"); in test_authenticated_encryption_sessionless()
9811 TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process"); in test_authenticated_encryption_sessionless()
9813 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_encryption_sessionless()
9818 ciphertext = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *, in test_authenticated_encryption_sessionless()
9819 ut_params->op->sym->cipher.data.offset); in test_authenticated_encryption_sessionless()
9854 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_decryption_sessionless() local
9888 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decryption_sessionless()
9890 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_decryption_sessionless()
9891 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_decryption_sessionless()
9900 retval = create_aead_xform(ut_params->op, in test_authenticated_decryption_sessionless()
9909 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_decryption_sessionless()
9911 TEST_ASSERT_EQUAL(ut_params->op->sess_type, in test_authenticated_decryption_sessionless()
9918 ut_params->op, 0, 0, 0, 0); in test_authenticated_decryption_sessionless()
9921 ts_params->valid_devs[0], ut_params->op), in test_authenticated_decryption_sessionless()
9924 TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process"); in test_authenticated_decryption_sessionless()
9926 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_decryption_sessionless()
9929 plaintext = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *, in test_authenticated_decryption_sessionless()
9930 ut_params->op->sym->cipher.data.offset); in test_authenticated_decryption_sessionless()
9941 TEST_ASSERT_EQUAL(ut_params->op->status, in test_authenticated_decryption_sessionless()
10131 struct crypto_unittest_params *ut_params, in MD5_HMAC_create_session() argument
10139 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in MD5_HMAC_create_session()
10140 ut_params->auth_xform.next = NULL; in MD5_HMAC_create_session()
10141 ut_params->auth_xform.auth.op = op; in MD5_HMAC_create_session()
10143 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_MD5_HMAC; in MD5_HMAC_create_session()
10145 ut_params->auth_xform.auth.digest_length = MD5_DIGEST_LEN; in MD5_HMAC_create_session()
10146 ut_params->auth_xform.auth.key.length = test_case->key.len; in MD5_HMAC_create_session()
10147 ut_params->auth_xform.auth.key.data = key; in MD5_HMAC_create_session()
10149 ut_params->sess = rte_cryptodev_sym_session_create( in MD5_HMAC_create_session()
10153 ut_params->sess, &ut_params->auth_xform, in MD5_HMAC_create_session()
10156 if (ut_params->sess == NULL) in MD5_HMAC_create_session()
10159 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in MD5_HMAC_create_session()
10161 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in MD5_HMAC_create_session()
10162 rte_pktmbuf_tailroom(ut_params->ibuf)); in MD5_HMAC_create_session()
10167 static int MD5_HMAC_create_op(struct crypto_unittest_params *ut_params, in MD5_HMAC_create_op() argument
10173 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in MD5_HMAC_create_op()
10178 *plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in MD5_HMAC_create_op()
10184 ut_params->ibuf, MD5_DIGEST_LEN); in MD5_HMAC_create_op()
10188 ut_params->ibuf, plaintext_pad_len); in MD5_HMAC_create_op()
10190 if (ut_params->auth_xform.auth.op == RTE_CRYPTO_AUTH_OP_VERIFY) { in MD5_HMAC_create_op()
10198 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in MD5_HMAC_create_op()
10199 ut_params->op->sym->m_src = ut_params->ibuf; in MD5_HMAC_create_op()
10211 struct crypto_unittest_params *ut_params = &unittest_params; in test_MD5_HMAC_generate() local
10231 if (MD5_HMAC_create_session(ts_params, ut_params, in test_MD5_HMAC_generate()
10236 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_MD5_HMAC_generate()
10238 TEST_ASSERT_NOT_NULL(ut_params->op, in test_MD5_HMAC_generate()
10244 if (MD5_HMAC_create_op(ut_params, test_case, &plaintext)) in test_MD5_HMAC_generate()
10249 ut_params->op); in test_MD5_HMAC_generate()
10252 ut_params->op, 0, 1, 0, 0); in test_MD5_HMAC_generate()
10256 ut_params->op), in test_MD5_HMAC_generate()
10259 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_MD5_HMAC_generate()
10262 if (ut_params->op->sym->m_dst) { in test_MD5_HMAC_generate()
10263 auth_tag = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_dst, in test_MD5_HMAC_generate()
10284 struct crypto_unittest_params *ut_params = &unittest_params; in test_MD5_HMAC_verify() local
10304 if (MD5_HMAC_create_session(ts_params, ut_params, in test_MD5_HMAC_verify()
10310 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_MD5_HMAC_verify()
10312 TEST_ASSERT_NOT_NULL(ut_params->op, in test_MD5_HMAC_verify()
10315 if (MD5_HMAC_create_op(ut_params, test_case, &plaintext)) in test_MD5_HMAC_verify()
10320 ut_params->op); in test_MD5_HMAC_verify()
10323 ut_params->op, 0, 1, 0, 0); in test_MD5_HMAC_verify()
10327 ut_params->op), in test_MD5_HMAC_verify()
10330 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_MD5_HMAC_verify()
10364 struct crypto_unittest_params *ut_params = &unittest_params; in test_multi_session() local
10384 test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(ut_params, in test_multi_session()
10401 sessions[i], &ut_params->auth_xform, in test_multi_session()
10410 ut_params, in test_multi_session()
10417 if (ut_params->op) in test_multi_session()
10418 rte_crypto_op_free(ut_params->op); in test_multi_session()
10425 if (ut_params->obuf) { in test_multi_session()
10426 rte_pktmbuf_free(ut_params->obuf); in test_multi_session()
10427 if (ut_params->ibuf == ut_params->obuf) in test_multi_session()
10428 ut_params->ibuf = 0; in test_multi_session()
10429 ut_params->obuf = 0; in test_multi_session()
10431 if (ut_params->ibuf) { in test_multi_session()
10432 rte_pktmbuf_free(ut_params->ibuf); in test_multi_session()
10433 ut_params->ibuf = 0; in test_multi_session()
10439 sessions[i], &ut_params->auth_xform, in test_multi_session()
10456 struct crypto_unittest_params ut_params; member
10522 rte_memcpy(&ut_paramz[i].ut_params, &unittest_params, in test_multi_session_random_usage()
10526 &ut_paramz[i].ut_params, in test_multi_session_random_usage()
10533 &ut_paramz[i].ut_params.auth_xform, in test_multi_session_random_usage()
10550 &ut_paramz[j].ut_params, in test_multi_session_random_usage()
10556 if (ut_paramz[j].ut_params.op) in test_multi_session_random_usage()
10557 rte_crypto_op_free(ut_paramz[j].ut_params.op); in test_multi_session_random_usage()
10564 if (ut_paramz[j].ut_params.obuf) { in test_multi_session_random_usage()
10565 rte_pktmbuf_free(ut_paramz[j].ut_params.obuf); in test_multi_session_random_usage()
10566 if (ut_paramz[j].ut_params.ibuf in test_multi_session_random_usage()
10567 == ut_paramz[j].ut_params.obuf) in test_multi_session_random_usage()
10568 ut_paramz[j].ut_params.ibuf = 0; in test_multi_session_random_usage()
10569 ut_paramz[j].ut_params.obuf = 0; in test_multi_session_random_usage()
10571 if (ut_paramz[j].ut_params.ibuf) { in test_multi_session_random_usage()
10572 rte_pktmbuf_free(ut_paramz[j].ut_params.ibuf); in test_multi_session_random_usage()
10573 ut_paramz[j].ut_params.ibuf = 0; in test_multi_session_random_usage()
10597 struct crypto_unittest_params *ut_params = &unittest_params; in test_null_invalid_operation() local
10606 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_null_invalid_operation()
10607 ut_params->cipher_xform.next = NULL; in test_null_invalid_operation()
10609 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC; in test_null_invalid_operation()
10610 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; in test_null_invalid_operation()
10612 ut_params->sess = rte_cryptodev_sym_session_create( in test_null_invalid_operation()
10617 ut_params->sess, &ut_params->cipher_xform, in test_null_invalid_operation()
10624 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_null_invalid_operation()
10625 ut_params->auth_xform.next = NULL; in test_null_invalid_operation()
10627 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC; in test_null_invalid_operation()
10628 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; in test_null_invalid_operation()
10630 ut_params->sess = rte_cryptodev_sym_session_create( in test_null_invalid_operation()
10635 ut_params->sess, &ut_params->auth_xform, in test_null_invalid_operation()
10650 struct crypto_unittest_params *ut_params = &unittest_params; in test_null_burst_operation() local
10663 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_null_burst_operation()
10664 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_null_burst_operation()
10666 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL; in test_null_burst_operation()
10667 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; in test_null_burst_operation()
10670 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_null_burst_operation()
10671 ut_params->auth_xform.next = NULL; in test_null_burst_operation()
10673 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_NULL; in test_null_burst_operation()
10674 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; in test_null_burst_operation()
10676 ut_params->sess = rte_cryptodev_sym_session_create( in test_null_burst_operation()
10681 ut_params->sess, &ut_params->cipher_xform, in test_null_burst_operation()
10683 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in test_null_burst_operation()
10699 rte_crypto_op_attach_sym_session(burst[i], ut_params->sess); in test_null_burst_operation()
10744 struct crypto_unittest_params *ut_params = &unittest_params; in create_gmac_operation() local
10750 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_gmac_operation()
10752 TEST_ASSERT_NOT_NULL(ut_params->op, in create_gmac_operation()
10755 sym_op = ut_params->op->sym; in create_gmac_operation()
10758 ut_params->ibuf, tdata->gmac_tag.len); in create_gmac_operation()
10763 ut_params->ibuf, plaintext_pad_len); in create_gmac_operation()
10773 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_gmac_operation()
10795 struct crypto_unittest_params *ut_params = &unittest_params; in create_gmac_operation_sgl() local
10799 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_gmac_operation_sgl()
10801 TEST_ASSERT_NOT_NULL(ut_params->op, in create_gmac_operation_sgl()
10804 sym_op = ut_params->op->sym; in create_gmac_operation_sgl()
10820 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_gmac_operation_sgl()
10843 struct crypto_unittest_params *ut_params = &unittest_params; in create_gmac_session() local
10847 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_gmac_session()
10848 ut_params->auth_xform.next = NULL; in create_gmac_session()
10850 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_AES_GMAC; in create_gmac_session()
10851 ut_params->auth_xform.auth.op = auth_op; in create_gmac_session()
10852 ut_params->auth_xform.auth.digest_length = tdata->gmac_tag.len; in create_gmac_session()
10853 ut_params->auth_xform.auth.key.length = tdata->key.len; in create_gmac_session()
10854 ut_params->auth_xform.auth.key.data = auth_key; in create_gmac_session()
10855 ut_params->auth_xform.auth.iv.offset = IV_OFFSET; in create_gmac_session()
10856 ut_params->auth_xform.auth.iv.length = tdata->iv.len; in create_gmac_session()
10859 ut_params->sess = rte_cryptodev_sym_session_create( in create_gmac_session()
10862 rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_gmac_session()
10863 &ut_params->auth_xform, in create_gmac_session()
10866 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_gmac_session()
10875 struct crypto_unittest_params *ut_params = &unittest_params; in test_AES_GMAC_authentication() local
10910 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool); in test_AES_GMAC_authentication()
10912 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_AES_GMAC_authentication()
10913 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_AES_GMAC_authentication()
10916 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_AES_GMAC_authentication()
10917 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_AES_GMAC_authentication()
10928 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_GMAC_authentication()
10942 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_AES_GMAC_authentication()
10944 ut_params->op->sym->m_src = ut_params->ibuf; in test_AES_GMAC_authentication()
10948 ut_params->op); in test_AES_GMAC_authentication()
10951 ut_params->op, 0, 1, 0, 0); in test_AES_GMAC_authentication()
10955 ut_params->op), "failed to process sym crypto op"); in test_AES_GMAC_authentication()
10957 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_GMAC_authentication()
10960 if (ut_params->op->sym->m_dst) { in test_AES_GMAC_authentication()
10961 auth_tag = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_dst, in test_AES_GMAC_authentication()
11006 struct crypto_unittest_params *ut_params = &unittest_params; in test_AES_GMAC_authentication_verify() local
11039 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool); in test_AES_GMAC_authentication_verify()
11041 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_AES_GMAC_authentication_verify()
11042 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_AES_GMAC_authentication_verify()
11045 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_AES_GMAC_authentication_verify()
11046 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_AES_GMAC_authentication_verify()
11058 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_GMAC_authentication_verify()
11072 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_AES_GMAC_authentication_verify()
11074 ut_params->op->sym->m_src = ut_params->ibuf; in test_AES_GMAC_authentication_verify()
11078 ut_params->op); in test_AES_GMAC_authentication_verify()
11081 ut_params->op, 0, 1, 0, 0); in test_AES_GMAC_authentication_verify()
11085 ut_params->op), "failed to process sym crypto op"); in test_AES_GMAC_authentication_verify()
11087 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_GMAC_authentication_verify()
11123 struct crypto_unittest_params *ut_params = &unittest_params; in test_AES_GMAC_authentication_SGL() local
11165 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_AES_GMAC_authentication_SGL()
11166 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_AES_GMAC_authentication_SGL()
11169 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_AES_GMAC_authentication_SGL()
11170 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_AES_GMAC_authentication_SGL()
11172 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_GMAC_authentication_SGL()
11180 buf = ut_params->ibuf; in test_AES_GMAC_authentication_SGL()
11207 ut_params->ibuf->nb_segs = segs; in test_AES_GMAC_authentication_SGL()
11215 digest_mem = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_GMAC_authentication_SGL()
11217 digest_phys = rte_pktmbuf_iova_offset(ut_params->ibuf, in test_AES_GMAC_authentication_SGL()
11227 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_AES_GMAC_authentication_SGL()
11229 ut_params->op->sym->m_src = ut_params->ibuf; in test_AES_GMAC_authentication_SGL()
11236 ut_params->op), "failed to process sym crypto op"); in test_AES_GMAC_authentication_SGL()
11238 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_GMAC_authentication_SGL()
11484 create_auth_session(struct crypto_unittest_params *ut_params, in create_auth_session() argument
11495 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_auth_session()
11496 ut_params->auth_xform.auth.op = auth_op; in create_auth_session()
11497 ut_params->auth_xform.next = NULL; in create_auth_session()
11498 ut_params->auth_xform.auth.algo = reference->auth_algo; in create_auth_session()
11499 ut_params->auth_xform.auth.key.length = reference->auth_key.len; in create_auth_session()
11500 ut_params->auth_xform.auth.key.data = auth_key; in create_auth_session()
11501 ut_params->auth_xform.auth.digest_length = reference->digest.len; in create_auth_session()
11504 ut_params->sess = rte_cryptodev_sym_session_create( in create_auth_session()
11507 rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_auth_session()
11508 &ut_params->auth_xform, in create_auth_session()
11511 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_auth_session()
11517 create_auth_cipher_session(struct crypto_unittest_params *ut_params, in create_auth_cipher_session() argument
11532 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_auth_cipher_session()
11533 ut_params->auth_xform.auth.op = auth_op; in create_auth_cipher_session()
11534 ut_params->auth_xform.auth.algo = reference->auth_algo; in create_auth_cipher_session()
11535 ut_params->auth_xform.auth.key.length = reference->auth_key.len; in create_auth_cipher_session()
11536 ut_params->auth_xform.auth.key.data = auth_key; in create_auth_cipher_session()
11537 ut_params->auth_xform.auth.digest_length = reference->digest.len; in create_auth_cipher_session()
11540 ut_params->auth_xform.auth.iv.offset = IV_OFFSET; in create_auth_cipher_session()
11541 ut_params->auth_xform.auth.iv.length = reference->iv.len; in create_auth_cipher_session()
11543 ut_params->auth_xform.next = &ut_params->cipher_xform; in create_auth_cipher_session()
11546 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in create_auth_cipher_session()
11547 ut_params->cipher_xform.next = NULL; in create_auth_cipher_session()
11548 ut_params->cipher_xform.cipher.algo = reference->crypto_algo; in create_auth_cipher_session()
11549 ut_params->cipher_xform.cipher.op = cipher_op; in create_auth_cipher_session()
11550 ut_params->cipher_xform.cipher.key.data = cipher_key; in create_auth_cipher_session()
11551 ut_params->cipher_xform.cipher.key.length = reference->cipher_key.len; in create_auth_cipher_session()
11552 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in create_auth_cipher_session()
11553 ut_params->cipher_xform.cipher.iv.length = reference->iv.len; in create_auth_cipher_session()
11557 ut_params->sess = rte_cryptodev_sym_session_create( in create_auth_cipher_session()
11560 rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_auth_cipher_session()
11561 &ut_params->auth_xform, in create_auth_cipher_session()
11564 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_auth_cipher_session()
11571 struct crypto_unittest_params *ut_params, in create_auth_operation() argument
11576 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_auth_operation()
11578 TEST_ASSERT_NOT_NULL(ut_params->op, in create_auth_operation()
11582 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_auth_operation()
11584 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_auth_operation()
11587 sym_op->m_src = ut_params->ibuf; in create_auth_operation()
11591 ut_params->ibuf, reference->digest.len); in create_auth_operation()
11597 ut_params->ibuf, reference->plaintext.len); in create_auth_operation()
11618 struct crypto_unittest_params *ut_params, in create_auth_GMAC_operation() argument
11623 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_auth_GMAC_operation()
11625 TEST_ASSERT_NOT_NULL(ut_params->op, in create_auth_GMAC_operation()
11629 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_auth_GMAC_operation()
11631 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_auth_GMAC_operation()
11634 sym_op->m_src = ut_params->ibuf; in create_auth_GMAC_operation()
11638 ut_params->ibuf, reference->digest.len); in create_auth_GMAC_operation()
11644 ut_params->ibuf, reference->ciphertext.len); in create_auth_GMAC_operation()
11657 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in create_auth_GMAC_operation()
11671 struct crypto_unittest_params *ut_params, in create_cipher_auth_operation() argument
11676 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_cipher_auth_operation()
11678 TEST_ASSERT_NOT_NULL(ut_params->op, in create_cipher_auth_operation()
11682 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_cipher_auth_operation()
11684 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_cipher_auth_operation()
11687 sym_op->m_src = ut_params->ibuf; in create_cipher_auth_operation()
11691 ut_params->ibuf, reference->digest.len); in create_cipher_auth_operation()
11697 ut_params->ibuf, reference->ciphertext.len); in create_cipher_auth_operation()
11710 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in create_cipher_auth_operation()
11724 struct crypto_unittest_params *ut_params, in create_auth_verify_operation() argument
11727 return create_auth_operation(ts_params, ut_params, reference, 0); in create_auth_verify_operation()
11733 struct crypto_unittest_params *ut_params, in create_auth_verify_GMAC_operation() argument
11736 return create_auth_GMAC_operation(ts_params, ut_params, reference, 0); in create_auth_verify_GMAC_operation()
11741 struct crypto_unittest_params *ut_params, in create_cipher_auth_verify_operation() argument
11744 return create_cipher_auth_operation(ts_params, ut_params, reference, 0); in create_cipher_auth_verify_operation()
11750 struct crypto_unittest_params *ut_params, in test_authentication_verify_fail_when_data_corruption() argument
11778 retval = create_auth_session(ut_params, in test_authentication_verify_fail_when_data_corruption()
11785 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authentication_verify_fail_when_data_corruption()
11786 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_authentication_verify_fail_when_data_corruption()
11790 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authentication_verify_fail_when_data_corruption()
11791 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authentication_verify_fail_when_data_corruption()
11793 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authentication_verify_fail_when_data_corruption()
11802 retval = create_auth_verify_operation(ts_params, ut_params, reference); in test_authentication_verify_fail_when_data_corruption()
11814 ut_params->op); in test_authentication_verify_fail_when_data_corruption()
11815 TEST_ASSERT_NOT_EQUAL(ut_params->op->status, in test_authentication_verify_fail_when_data_corruption()
11820 ut_params->op, 0, 1, 0, 0); in test_authentication_verify_fail_when_data_corruption()
11822 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_authentication_verify_fail_when_data_corruption()
11823 ut_params->op); in test_authentication_verify_fail_when_data_corruption()
11824 TEST_ASSERT_NULL(ut_params->op, "authentication not failed"); in test_authentication_verify_fail_when_data_corruption()
11833 struct crypto_unittest_params *ut_params, in test_authentication_verify_GMAC_fail_when_corruption() argument
11859 retval = create_auth_cipher_session(ut_params, in test_authentication_verify_GMAC_fail_when_corruption()
11867 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authentication_verify_GMAC_fail_when_corruption()
11868 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_authentication_verify_GMAC_fail_when_corruption()
11872 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authentication_verify_GMAC_fail_when_corruption()
11873 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authentication_verify_GMAC_fail_when_corruption()
11875 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authentication_verify_GMAC_fail_when_corruption()
11885 ut_params, in test_authentication_verify_GMAC_fail_when_corruption()
11898 ut_params->op); in test_authentication_verify_GMAC_fail_when_corruption()
11899 TEST_ASSERT_NOT_EQUAL(ut_params->op->status, in test_authentication_verify_GMAC_fail_when_corruption()
11904 ut_params->op, 0, 1, 0, 0); in test_authentication_verify_GMAC_fail_when_corruption()
11906 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_authentication_verify_GMAC_fail_when_corruption()
11907 ut_params->op); in test_authentication_verify_GMAC_fail_when_corruption()
11908 TEST_ASSERT_NULL(ut_params->op, "authentication not failed"); in test_authentication_verify_GMAC_fail_when_corruption()
11917 struct crypto_unittest_params *ut_params, in test_authenticated_decryption_fail_when_corruption() argument
11949 retval = create_auth_cipher_session(ut_params, in test_authenticated_decryption_fail_when_corruption()
11957 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decryption_fail_when_corruption()
11958 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_authenticated_decryption_fail_when_corruption()
11962 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_decryption_fail_when_corruption()
11963 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_decryption_fail_when_corruption()
11965 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authenticated_decryption_fail_when_corruption()
11973 ut_params, in test_authenticated_decryption_fail_when_corruption()
11986 ut_params->op); in test_authenticated_decryption_fail_when_corruption()
11987 TEST_ASSERT_NOT_EQUAL(ut_params->op->status, in test_authenticated_decryption_fail_when_corruption()
11992 ut_params->op, 1, 1, 0, 0); in test_authenticated_decryption_fail_when_corruption()
11994 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_authenticated_decryption_fail_when_corruption()
11995 ut_params->op); in test_authenticated_decryption_fail_when_corruption()
11996 TEST_ASSERT_NULL(ut_params->op, "authentication not failed"); in test_authenticated_decryption_fail_when_corruption()
12005 struct crypto_unittest_params *ut_params, in test_authenticated_encryt_with_esn() argument
12044 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_authenticated_encryt_with_esn()
12045 ut_params->cipher_xform.cipher.algo = reference->crypto_algo; in test_authenticated_encryt_with_esn()
12046 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; in test_authenticated_encryt_with_esn()
12047 ut_params->cipher_xform.cipher.key.data = cipher_key; in test_authenticated_encryt_with_esn()
12048 ut_params->cipher_xform.cipher.key.length = reference->cipher_key.len; in test_authenticated_encryt_with_esn()
12049 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_authenticated_encryt_with_esn()
12050 ut_params->cipher_xform.cipher.iv.length = reference->iv.len; in test_authenticated_encryt_with_esn()
12052 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_authenticated_encryt_with_esn()
12055 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_authenticated_encryt_with_esn()
12056 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; in test_authenticated_encryt_with_esn()
12057 ut_params->auth_xform.auth.algo = reference->auth_algo; in test_authenticated_encryt_with_esn()
12058 ut_params->auth_xform.auth.key.length = reference->auth_key.len; in test_authenticated_encryt_with_esn()
12059 ut_params->auth_xform.auth.key.data = auth_key; in test_authenticated_encryt_with_esn()
12060 ut_params->auth_xform.auth.digest_length = reference->digest.len; in test_authenticated_encryt_with_esn()
12061 ut_params->auth_xform.next = NULL; in test_authenticated_encryt_with_esn()
12064 ut_params->sess = rte_cryptodev_sym_session_create( in test_authenticated_encryt_with_esn()
12068 ut_params->sess, in test_authenticated_encryt_with_esn()
12069 &ut_params->cipher_xform, in test_authenticated_encryt_with_esn()
12072 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in test_authenticated_encryt_with_esn()
12074 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryt_with_esn()
12075 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_authenticated_encryt_with_esn()
12079 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_encryt_with_esn()
12080 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_encryt_with_esn()
12082 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authenticated_encryt_with_esn()
12089 ut_params, in test_authenticated_encryt_with_esn()
12097 ut_params->op); in test_authenticated_encryt_with_esn()
12100 ut_params->op, 1, 1, 0, 0); in test_authenticated_encryt_with_esn()
12102 ut_params->op = process_crypto_request( in test_authenticated_encryt_with_esn()
12103 ts_params->valid_devs[0], ut_params->op); in test_authenticated_encryt_with_esn()
12105 TEST_ASSERT_NOT_NULL(ut_params->op, "no crypto operation returned"); in test_authenticated_encryt_with_esn()
12107 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_encryt_with_esn()
12112 authciphertext = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *, in test_authenticated_encryt_with_esn()
12113 ut_params->op->sym->auth.data.offset); in test_authenticated_encryt_with_esn()
12139 struct crypto_unittest_params *ut_params, in test_authenticated_decrypt_with_esn() argument
12177 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_authenticated_decrypt_with_esn()
12178 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY; in test_authenticated_decrypt_with_esn()
12179 ut_params->auth_xform.auth.algo = reference->auth_algo; in test_authenticated_decrypt_with_esn()
12180 ut_params->auth_xform.auth.key.length = reference->auth_key.len; in test_authenticated_decrypt_with_esn()
12181 ut_params->auth_xform.auth.key.data = auth_key; in test_authenticated_decrypt_with_esn()
12182 ut_params->auth_xform.auth.digest_length = reference->digest.len; in test_authenticated_decrypt_with_esn()
12183 ut_params->auth_xform.next = &ut_params->cipher_xform; in test_authenticated_decrypt_with_esn()
12186 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_authenticated_decrypt_with_esn()
12187 ut_params->cipher_xform.next = NULL; in test_authenticated_decrypt_with_esn()
12188 ut_params->cipher_xform.cipher.algo = reference->crypto_algo; in test_authenticated_decrypt_with_esn()
12189 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT; in test_authenticated_decrypt_with_esn()
12190 ut_params->cipher_xform.cipher.key.data = cipher_key; in test_authenticated_decrypt_with_esn()
12191 ut_params->cipher_xform.cipher.key.length = reference->cipher_key.len; in test_authenticated_decrypt_with_esn()
12192 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_authenticated_decrypt_with_esn()
12193 ut_params->cipher_xform.cipher.iv.length = reference->iv.len; in test_authenticated_decrypt_with_esn()
12196 ut_params->sess = rte_cryptodev_sym_session_create( in test_authenticated_decrypt_with_esn()
12200 ut_params->sess, in test_authenticated_decrypt_with_esn()
12201 &ut_params->auth_xform, in test_authenticated_decrypt_with_esn()
12204 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in test_authenticated_decrypt_with_esn()
12206 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decrypt_with_esn()
12207 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_authenticated_decrypt_with_esn()
12211 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_decrypt_with_esn()
12212 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_decrypt_with_esn()
12214 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authenticated_decrypt_with_esn()
12222 ut_params, in test_authenticated_decrypt_with_esn()
12230 ut_params->op); in test_authenticated_decrypt_with_esn()
12233 ut_params->op, 1, 1, 0, 0); in test_authenticated_decrypt_with_esn()
12235 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_authenticated_decrypt_with_esn()
12236 ut_params->op); in test_authenticated_decrypt_with_esn()
12238 TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process"); in test_authenticated_decrypt_with_esn()
12239 TEST_ASSERT_EQUAL(ut_params->op->status, in test_authenticated_decrypt_with_esn()
12243 ut_params->obuf = ut_params->op->sym->m_src; in test_authenticated_decrypt_with_esn()
12244 TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf"); in test_authenticated_decrypt_with_esn()
12255 struct crypto_unittest_params *ut_params = &unittest_params; in create_aead_operation_SGL() local
12263 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_aead_operation_SGL()
12265 TEST_ASSERT_NOT_NULL(ut_params->op, in create_aead_operation_SGL()
12268 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_aead_operation_SGL()
12287 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_aead_operation_SGL()
12296 ut_params->ibuf, aad_len); in create_aead_operation_SGL()
12300 ut_params->ibuf); in create_aead_operation_SGL()
12310 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_aead_operation_SGL()
12318 ut_params->ibuf, aad_len_pad); in create_aead_operation_SGL()
12322 ut_params->ibuf); in create_aead_operation_SGL()
12345 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_encryption_SGL() local
12430 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption_SGL()
12431 rte_pktmbuf_append(ut_params->obuf, in test_authenticated_encryption_SGL()
12433 buf_oop = ut_params->obuf; in test_authenticated_encryption_SGL()
12446 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption_SGL()
12449 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_encryption_SGL()
12450 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_encryption_SGL()
12452 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authenticated_encryption_SGL()
12459 buf = ut_params->ibuf; in test_authenticated_encryption_SGL()
12507 ut_params->ibuf->nb_segs = segs; in test_authenticated_encryption_SGL()
12515 digest_mem = rte_pktmbuf_append(ut_params->obuf, in test_authenticated_encryption_SGL()
12519 ut_params->obuf, in test_authenticated_encryption_SGL()
12549 ut_params->obuf->nb_segs = segs; in test_authenticated_encryption_SGL()
12561 digest_mem = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authenticated_encryption_SGL()
12563 digest_phys = rte_pktmbuf_iova_offset(ut_params->ibuf, in test_authenticated_encryption_SGL()
12574 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_authenticated_encryption_SGL()
12576 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_encryption_SGL()
12578 ut_params->op->sym->m_dst = ut_params->obuf; in test_authenticated_encryption_SGL()
12583 process_cpu_aead_op(ts_params->valid_devs[0], ut_params->op); in test_authenticated_encryption_SGL()
12586 ut_params->op, 0, 0, 0, 0); in test_authenticated_encryption_SGL()
12590 ut_params->op), "failed to process sym crypto op"); in test_authenticated_encryption_SGL()
12592 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_encryption_SGL()
12596 ciphertext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_src, in test_authenticated_encryption_SGL()
12599 ciphertext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_dst, in test_authenticated_encryption_SGL()
12612 buf = ut_params->op->sym->m_src->next; in test_authenticated_encryption_SGL()
12614 buf = ut_params->op->sym->m_dst->next; in test_authenticated_encryption_SGL()
12680 struct crypto_unittest_params *ut_params, in test_authentication_verify_fail_when_data_corrupted() argument
12684 ts_params, ut_params, reference, 1); in test_authentication_verify_fail_when_data_corrupted()
12690 struct crypto_unittest_params *ut_params, in test_authentication_verify_fail_when_tag_corrupted() argument
12694 ts_params, ut_params, reference, 0); in test_authentication_verify_fail_when_tag_corrupted()
12700 struct crypto_unittest_params *ut_params, in test_authentication_verify_GMAC_fail_when_data_corrupted() argument
12704 ts_params, ut_params, reference, 1); in test_authentication_verify_GMAC_fail_when_data_corrupted()
12710 struct crypto_unittest_params *ut_params, in test_authentication_verify_GMAC_fail_when_tag_corrupted() argument
12714 ts_params, ut_params, reference, 0); in test_authentication_verify_GMAC_fail_when_tag_corrupted()
12720 struct crypto_unittest_params *ut_params, in test_authenticated_decryption_fail_when_data_corrupted() argument
12724 ts_params, ut_params, reference, 1); in test_authenticated_decryption_fail_when_data_corrupted()
12730 struct crypto_unittest_params *ut_params, in test_authenticated_decryption_fail_when_tag_corrupted() argument
12734 ts_params, ut_params, reference, 0); in test_authenticated_decryption_fail_when_tag_corrupted()