Lines Matching refs:ut_params
122 struct crypto_unittest_params *ut_params, uint8_t *cipher_key,
127 struct crypto_unittest_params *ut_params,
212 struct crypto_unittest_params *ut_params = &unittest_params; in process_sym_raw_dp_op() local
306 ut_params->auth_xform.auth.digest_length); in process_sym_raw_dp_op()
819 struct crypto_unittest_params *ut_params = &unittest_params; in ipsec_proto_testsuite_setup() local
837 ut_params->type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL; in ipsec_proto_testsuite_setup()
1374 struct crypto_unittest_params *ut_params = &unittest_params; in dev_configure_and_start() local
1379 memset(ut_params, 0, sizeof(*ut_params)); in dev_configure_and_start()
1431 struct crypto_unittest_params *ut_params = &unittest_params; in ut_teardown() local
1435 if (ut_params->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) { in ut_teardown()
1436 if (ut_params->sec_session) { in ut_teardown()
1439 ut_params->sec_session); in ut_teardown()
1440 ut_params->sec_session = NULL; in ut_teardown()
1445 if (ut_params->sess) { in ut_teardown()
1448 ut_params->sess); in ut_teardown()
1449 rte_cryptodev_sym_session_free(ut_params->sess); in ut_teardown()
1450 ut_params->sess = NULL; in ut_teardown()
1455 if (ut_params->op) in ut_teardown()
1456 rte_crypto_op_free(ut_params->op); in ut_teardown()
1463 if (ut_params->obuf) { in ut_teardown()
1464 rte_pktmbuf_free(ut_params->obuf); in ut_teardown()
1465 if (ut_params->ibuf == ut_params->obuf) in ut_teardown()
1466 ut_params->ibuf = 0; in ut_teardown()
1467 ut_params->obuf = 0; in ut_teardown()
1469 if (ut_params->ibuf) { in ut_teardown()
1470 rte_pktmbuf_free(ut_params->ibuf); in ut_teardown()
1471 ut_params->ibuf = 0; in ut_teardown()
2149 struct crypto_unittest_params *ut_params = &unittest_params; in test_AES_CBC_HMAC_SHA1_encrypt_digest() local
2166 ut_params->ibuf = setup_test_string(ts_params->mbuf_pool, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2169 ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2171 TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest"); in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2174 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2175 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2177 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2178 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2179 ut_params->cipher_xform.cipher.key.data = aes_cbc_key; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2180 ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2181 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2182 ut_params->cipher_xform.cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2185 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2187 ut_params->auth_xform.next = NULL; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2189 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2190 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2191 ut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA1; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2192 ut_params->auth_xform.auth.key.data = hmac_sha1_key; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2193 ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2195 ut_params->sess = rte_cryptodev_sym_session_create( in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2197 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2201 ut_params->sess, &ut_params->cipher_xform, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2210 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2212 TEST_ASSERT_NOT_NULL(ut_params->op, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2215 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2217 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2220 sym_op->m_src = ut_params->ibuf; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2223 sym_op->auth.digest.data = ut_params->digest; in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2225 ut_params->ibuf, QUOTE_512_BYTES); in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2231 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2241 ut_params->op); in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2245 ut_params->op), in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2248 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2252 uint8_t *ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_src, in test_AES_CBC_HMAC_SHA1_encrypt_digest()
2301 struct crypto_unittest_params *ut_params,
2307 struct crypto_unittest_params *ut_params,
2316 struct crypto_unittest_params *ut_params, in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params() argument
2322 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2323 ut_params->cipher_xform.next = NULL; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2325 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2326 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2327 ut_params->cipher_xform.cipher.key.data = cipher_key; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2328 ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2329 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2330 ut_params->cipher_xform.cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2333 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2334 ut_params->auth_xform.next = &ut_params->cipher_xform; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2336 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2337 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA512_HMAC; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2338 ut_params->auth_xform.auth.key.data = hmac_key; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2339 ut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA512; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2340 ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512; in test_AES_CBC_HMAC_SHA512_decrypt_create_session_params()
2348 struct crypto_unittest_params *ut_params, in test_AES_CBC_HMAC_SHA512_decrypt_perform() argument
2355 ut_params->ibuf = setup_test_string(ts_params->mbuf_pool, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2360 ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2362 TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest"); in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2364 rte_memcpy(ut_params->digest, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2369 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2371 TEST_ASSERT_NOT_NULL(ut_params->op, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2374 rte_crypto_op_attach_sym_session(ut_params->op, sess); in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2376 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2379 sym_op->m_src = ut_params->ibuf; in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2381 sym_op->auth.digest.data = ut_params->digest; in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2383 ut_params->ibuf, QUOTE_512_BYTES); in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2389 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2398 ut_params->op); in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2401 ut_params->op, 1, 1, 0, 0); in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2405 ut_params->op), in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2408 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2411 ut_params->obuf = ut_params->op->sym->m_src; in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2415 rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2421 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_CBC_HMAC_SHA512_decrypt_perform()
2439 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_hash_session() local
2446 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_wireless_algo_hash_session()
2447 ut_params->auth_xform.next = NULL; in create_wireless_algo_hash_session()
2449 ut_params->auth_xform.auth.op = op; in create_wireless_algo_hash_session()
2450 ut_params->auth_xform.auth.algo = algo; in create_wireless_algo_hash_session()
2451 ut_params->auth_xform.auth.key.length = key_len; in create_wireless_algo_hash_session()
2452 ut_params->auth_xform.auth.key.data = hash_key; in create_wireless_algo_hash_session()
2453 ut_params->auth_xform.auth.digest_length = auth_len; in create_wireless_algo_hash_session()
2454 ut_params->auth_xform.auth.iv.offset = IV_OFFSET; in create_wireless_algo_hash_session()
2455 ut_params->auth_xform.auth.iv.length = iv_len; in create_wireless_algo_hash_session()
2456 ut_params->sess = rte_cryptodev_sym_session_create( in create_wireless_algo_hash_session()
2459 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_algo_hash_session()
2460 &ut_params->auth_xform, in create_wireless_algo_hash_session()
2466 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_wireless_algo_hash_session()
2480 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_cipher_session() local
2485 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in create_wireless_algo_cipher_session()
2486 ut_params->cipher_xform.next = NULL; in create_wireless_algo_cipher_session()
2488 ut_params->cipher_xform.cipher.algo = algo; in create_wireless_algo_cipher_session()
2489 ut_params->cipher_xform.cipher.op = op; in create_wireless_algo_cipher_session()
2490 ut_params->cipher_xform.cipher.key.data = cipher_key; in create_wireless_algo_cipher_session()
2491 ut_params->cipher_xform.cipher.key.length = key_len; in create_wireless_algo_cipher_session()
2492 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in create_wireless_algo_cipher_session()
2493 ut_params->cipher_xform.cipher.iv.length = iv_len; in create_wireless_algo_cipher_session()
2498 ut_params->sess = rte_cryptodev_sym_session_create( in create_wireless_algo_cipher_session()
2501 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_algo_cipher_session()
2502 &ut_params->cipher_xform, in create_wireless_algo_cipher_session()
2508 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_wireless_algo_cipher_session()
2518 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_cipher_operation() local
2521 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_algo_cipher_operation()
2523 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_algo_cipher_operation()
2527 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_algo_cipher_operation()
2529 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_algo_cipher_operation()
2532 sym_op->m_src = ut_params->ibuf; in create_wireless_algo_cipher_operation()
2535 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in create_wireless_algo_cipher_operation()
2548 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_cipher_operation_oop() local
2551 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_algo_cipher_operation_oop()
2553 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_algo_cipher_operation_oop()
2557 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_algo_cipher_operation_oop()
2559 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_algo_cipher_operation_oop()
2562 sym_op->m_src = ut_params->ibuf; in create_wireless_algo_cipher_operation_oop()
2563 sym_op->m_dst = ut_params->obuf; in create_wireless_algo_cipher_operation_oop()
2566 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in create_wireless_algo_cipher_operation_oop()
2588 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_cipher_auth_session() local
2593 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_wireless_algo_cipher_auth_session()
2594 ut_params->auth_xform.next = NULL; in create_wireless_algo_cipher_auth_session()
2596 ut_params->auth_xform.auth.op = auth_op; in create_wireless_algo_cipher_auth_session()
2597 ut_params->auth_xform.auth.algo = auth_algo; in create_wireless_algo_cipher_auth_session()
2598 ut_params->auth_xform.auth.key.length = key_len; in create_wireless_algo_cipher_auth_session()
2600 ut_params->auth_xform.auth.key.data = cipher_auth_key; in create_wireless_algo_cipher_auth_session()
2601 ut_params->auth_xform.auth.digest_length = auth_len; in create_wireless_algo_cipher_auth_session()
2603 ut_params->auth_xform.auth.iv.offset = IV_OFFSET + cipher_iv_len; in create_wireless_algo_cipher_auth_session()
2604 ut_params->auth_xform.auth.iv.length = auth_iv_len; in create_wireless_algo_cipher_auth_session()
2607 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in create_wireless_algo_cipher_auth_session()
2608 ut_params->cipher_xform.next = &ut_params->auth_xform; in create_wireless_algo_cipher_auth_session()
2610 ut_params->cipher_xform.cipher.algo = cipher_algo; in create_wireless_algo_cipher_auth_session()
2611 ut_params->cipher_xform.cipher.op = cipher_op; in create_wireless_algo_cipher_auth_session()
2612 ut_params->cipher_xform.cipher.key.data = cipher_auth_key; in create_wireless_algo_cipher_auth_session()
2613 ut_params->cipher_xform.cipher.key.length = key_len; in create_wireless_algo_cipher_auth_session()
2614 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in create_wireless_algo_cipher_auth_session()
2615 ut_params->cipher_xform.cipher.iv.length = cipher_iv_len; in create_wireless_algo_cipher_auth_session()
2620 ut_params->sess = rte_cryptodev_sym_session_create( in create_wireless_algo_cipher_auth_session()
2622 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_wireless_algo_cipher_auth_session()
2624 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_algo_cipher_auth_session()
2625 &ut_params->cipher_xform, in create_wireless_algo_cipher_auth_session()
2647 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_cipher_auth_session() local
2656 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_wireless_cipher_auth_session()
2657 ut_params->auth_xform.next = NULL; in create_wireless_cipher_auth_session()
2659 ut_params->auth_xform.auth.op = auth_op; in create_wireless_cipher_auth_session()
2660 ut_params->auth_xform.auth.algo = auth_algo; in create_wireless_cipher_auth_session()
2661 ut_params->auth_xform.auth.key.length = key_len; in create_wireless_cipher_auth_session()
2663 ut_params->auth_xform.auth.key.data = cipher_auth_key; in create_wireless_cipher_auth_session()
2664 ut_params->auth_xform.auth.digest_length = auth_len; in create_wireless_cipher_auth_session()
2666 ut_params->auth_xform.auth.iv.offset = IV_OFFSET + cipher_iv_len; in create_wireless_cipher_auth_session()
2667 ut_params->auth_xform.auth.iv.length = auth_iv_len; in create_wireless_cipher_auth_session()
2670 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in create_wireless_cipher_auth_session()
2671 ut_params->cipher_xform.next = &ut_params->auth_xform; in create_wireless_cipher_auth_session()
2673 ut_params->cipher_xform.cipher.algo = cipher_algo; in create_wireless_cipher_auth_session()
2674 ut_params->cipher_xform.cipher.op = cipher_op; in create_wireless_cipher_auth_session()
2675 ut_params->cipher_xform.cipher.key.data = cipher_auth_key; in create_wireless_cipher_auth_session()
2676 ut_params->cipher_xform.cipher.key.length = key_len; in create_wireless_cipher_auth_session()
2677 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in create_wireless_cipher_auth_session()
2678 ut_params->cipher_xform.cipher.iv.length = cipher_iv_len; in create_wireless_cipher_auth_session()
2684 ut_params->sess = rte_cryptodev_sym_session_create( in create_wireless_cipher_auth_session()
2687 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_cipher_auth_session()
2688 &ut_params->cipher_xform, in create_wireless_cipher_auth_session()
2694 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_wireless_cipher_auth_session()
2721 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_auth_cipher_session() local
2726 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_wireless_algo_auth_cipher_session()
2727 ut_params->auth_xform.auth.op = auth_op; in create_wireless_algo_auth_cipher_session()
2728 ut_params->auth_xform.next = &ut_params->cipher_xform; in create_wireless_algo_auth_cipher_session()
2729 ut_params->auth_xform.auth.algo = auth_algo; in create_wireless_algo_auth_cipher_session()
2730 ut_params->auth_xform.auth.key.length = key_len; in create_wireless_algo_auth_cipher_session()
2731 ut_params->auth_xform.auth.key.data = auth_cipher_key; in create_wireless_algo_auth_cipher_session()
2732 ut_params->auth_xform.auth.digest_length = auth_len; in create_wireless_algo_auth_cipher_session()
2734 ut_params->auth_xform.auth.iv.offset = IV_OFFSET + cipher_iv_len; in create_wireless_algo_auth_cipher_session()
2735 ut_params->auth_xform.auth.iv.length = auth_iv_len; in create_wireless_algo_auth_cipher_session()
2738 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in create_wireless_algo_auth_cipher_session()
2739 ut_params->cipher_xform.next = NULL; in create_wireless_algo_auth_cipher_session()
2740 ut_params->cipher_xform.cipher.algo = cipher_algo; in create_wireless_algo_auth_cipher_session()
2741 ut_params->cipher_xform.cipher.op = cipher_op; in create_wireless_algo_auth_cipher_session()
2742 ut_params->cipher_xform.cipher.key.data = auth_cipher_key; in create_wireless_algo_auth_cipher_session()
2743 ut_params->cipher_xform.cipher.key.length = key_len; in create_wireless_algo_auth_cipher_session()
2744 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in create_wireless_algo_auth_cipher_session()
2745 ut_params->cipher_xform.cipher.iv.length = cipher_iv_len; in create_wireless_algo_auth_cipher_session()
2750 ut_params->sess = rte_cryptodev_sym_session_create( in create_wireless_algo_auth_cipher_session()
2752 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_wireless_algo_auth_cipher_session()
2755 ut_params->auth_xform.next = NULL; in create_wireless_algo_auth_cipher_session()
2756 ut_params->cipher_xform.next = &ut_params->auth_xform; in create_wireless_algo_auth_cipher_session()
2757 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_algo_auth_cipher_session()
2758 &ut_params->cipher_xform, in create_wireless_algo_auth_cipher_session()
2762 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_wireless_algo_auth_cipher_session()
2763 &ut_params->auth_xform, in create_wireless_algo_auth_cipher_session()
2784 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_hash_operation() local
2787 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_algo_hash_operation()
2789 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_algo_hash_operation()
2793 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_algo_hash_operation()
2795 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_algo_hash_operation()
2798 sym_op->m_src = ut_params->ibuf; in create_wireless_algo_hash_operation()
2801 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in create_wireless_algo_hash_operation()
2805 ut_params->ibuf, auth_tag_len); in create_wireless_algo_hash_operation()
2809 ut_params->digest = sym_op->auth.digest.data; in create_wireless_algo_hash_operation()
2811 ut_params->ibuf, data_pad_len); in create_wireless_algo_hash_operation()
2832 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_cipher_hash_operation() local
2847 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_cipher_hash_operation()
2849 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_cipher_hash_operation()
2852 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_cipher_hash_operation()
2854 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_cipher_hash_operation()
2857 sym_op->m_src = ut_params->ibuf; in create_wireless_cipher_hash_operation()
2861 ut_params->ibuf, auth_tag_len); in create_wireless_cipher_hash_operation()
2865 ut_params->digest = sym_op->auth.digest.data; in create_wireless_cipher_hash_operation()
2867 ut_params->ibuf, data_pad_len); in create_wireless_cipher_hash_operation()
2878 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, in create_wireless_cipher_hash_operation()
2911 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_cipher_hash_operation() local
2914 ut_params->cipher_xform.cipher.algo; in create_wireless_algo_cipher_hash_operation()
2916 ut_params->auth_xform.auth.algo; in create_wireless_algo_cipher_hash_operation()
2919 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_algo_cipher_hash_operation()
2921 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_algo_cipher_hash_operation()
2924 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_algo_cipher_hash_operation()
2926 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_algo_cipher_hash_operation()
2929 sym_op->m_src = ut_params->ibuf; in create_wireless_algo_cipher_hash_operation()
2933 ut_params->ibuf, auth_tag_len); in create_wireless_algo_cipher_hash_operation()
2937 ut_params->digest = sym_op->auth.digest.data; in create_wireless_algo_cipher_hash_operation()
2939 if (rte_pktmbuf_is_contiguous(ut_params->ibuf)) { in create_wireless_algo_cipher_hash_operation()
2941 ut_params->ibuf, data_pad_len); in create_wireless_algo_cipher_hash_operation()
2943 struct rte_mbuf *m = ut_params->ibuf; in create_wireless_algo_cipher_hash_operation()
2964 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, in create_wireless_algo_cipher_hash_operation()
3004 struct crypto_unittest_params *ut_params = &unittest_params; in create_wireless_algo_auth_cipher_operation() local
3007 ut_params->cipher_xform.cipher.algo; in create_wireless_algo_auth_cipher_operation()
3009 ut_params->auth_xform.auth.algo; in create_wireless_algo_auth_cipher_operation()
3012 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_wireless_algo_auth_cipher_operation()
3014 TEST_ASSERT_NOT_NULL(ut_params->op, in create_wireless_algo_auth_cipher_operation()
3018 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_wireless_algo_auth_cipher_operation()
3020 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_wireless_algo_auth_cipher_operation()
3023 sym_op->m_src = ut_params->ibuf; in create_wireless_algo_auth_cipher_operation()
3025 sym_op->m_dst = ut_params->obuf; in create_wireless_algo_auth_cipher_operation()
3031 ut_params->ibuf : ut_params->obuf), in create_wireless_algo_auth_cipher_operation()
3035 ut_params->ibuf : ut_params->obuf), in create_wireless_algo_auth_cipher_operation()
3064 ut_params->op, uint8_t *, IV_OFFSET); in create_wireless_algo_auth_cipher_operation()
3112 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_authentication() local
3156 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_authentication()
3158 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_authentication()
3159 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_authentication()
3165 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_authentication()
3180 ut_params->op, 0, 1, 1, 0); in test_snow3g_authentication()
3182 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_authentication()
3183 ut_params->op); in test_snow3g_authentication()
3184 ut_params->obuf = ut_params->op->sym->m_src; in test_snow3g_authentication()
3185 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_authentication()
3186 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_snow3g_authentication()
3191 ut_params->digest, in test_snow3g_authentication()
3203 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_authentication_verify() local
3246 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_authentication_verify()
3248 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_authentication_verify()
3249 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_authentication_verify()
3255 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_authentication_verify()
3272 ut_params->op, 0, 1, 1, 0); in test_snow3g_authentication_verify()
3274 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_authentication_verify()
3275 ut_params->op); in test_snow3g_authentication_verify()
3276 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_authentication_verify()
3277 ut_params->obuf = ut_params->op->sym->m_src; in test_snow3g_authentication_verify()
3278 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_snow3g_authentication_verify()
3282 if (ut_params->op->status == RTE_CRYPTO_OP_STATUS_SUCCESS) in test_snow3g_authentication_verify()
3294 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_authentication() local
3332 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_authentication()
3334 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_authentication()
3335 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_authentication()
3341 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_authentication()
3356 ut_params->op); in test_kasumi_authentication()
3359 ut_params->op, 0, 1, 1, 0); in test_kasumi_authentication()
3361 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_authentication()
3362 ut_params->op); in test_kasumi_authentication()
3364 ut_params->obuf = ut_params->op->sym->m_src; in test_kasumi_authentication()
3365 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_authentication()
3366 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_kasumi_authentication()
3371 ut_params->digest, in test_kasumi_authentication()
3383 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_authentication_verify() local
3420 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_authentication_verify()
3422 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_authentication_verify()
3423 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_authentication_verify()
3429 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_authentication_verify()
3446 ut_params->op, 0, 1, 1, 0); in test_kasumi_authentication_verify()
3448 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_authentication_verify()
3449 ut_params->op); in test_kasumi_authentication_verify()
3450 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_authentication_verify()
3451 ut_params->obuf = ut_params->op->sym->m_src; in test_kasumi_authentication_verify()
3452 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_kasumi_authentication_verify()
3456 if (ut_params->op->status == RTE_CRYPTO_OP_STATUS_SUCCESS) in test_kasumi_authentication_verify()
3607 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_encryption() local
3644 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_encryption()
3647 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_encryption()
3648 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_encryption()
3654 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_encryption()
3670 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_kasumi_encryption()
3672 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_encryption()
3673 ut_params->op); in test_kasumi_encryption()
3674 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_encryption()
3676 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_encryption()
3677 if (ut_params->obuf) in test_kasumi_encryption()
3678 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_kasumi_encryption()
3699 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_encryption_sgl() local
3754 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_kasumi_encryption_sgl()
3757 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_kasumi_encryption_sgl()
3769 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_kasumi_encryption_sgl()
3771 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_encryption_sgl()
3772 ut_params->op); in test_kasumi_encryption_sgl()
3773 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_encryption_sgl()
3775 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_encryption_sgl()
3777 if (ut_params->obuf) in test_kasumi_encryption_sgl()
3778 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_kasumi_encryption_sgl()
3781 ciphertext = rte_pktmbuf_read(ut_params->ibuf, in test_kasumi_encryption_sgl()
3803 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_encryption_oop() local
3834 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_encryption_oop()
3835 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_encryption_oop()
3838 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_encryption_oop()
3839 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_encryption_oop()
3845 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_encryption_oop()
3847 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_kasumi_encryption_oop()
3860 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_encryption_oop()
3861 ut_params->op); in test_kasumi_encryption_oop()
3862 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_encryption_oop()
3864 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_encryption_oop()
3865 if (ut_params->obuf) in test_kasumi_encryption_oop()
3866 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_kasumi_encryption_oop()
3887 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_encryption_oop_sgl() local
3936 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_kasumi_encryption_oop_sgl()
3938 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_kasumi_encryption_oop_sgl()
3943 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_kasumi_encryption_oop_sgl()
3953 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_encryption_oop_sgl()
3954 ut_params->op); in test_kasumi_encryption_oop_sgl()
3955 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_encryption_oop_sgl()
3957 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_encryption_oop_sgl()
3958 if (ut_params->obuf) in test_kasumi_encryption_oop_sgl()
3959 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_kasumi_encryption_oop_sgl()
3962 ciphertext = rte_pktmbuf_read(ut_params->ibuf, in test_kasumi_encryption_oop_sgl()
3982 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_decryption_oop() local
4012 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_decryption_oop()
4013 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_decryption_oop()
4016 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_decryption_oop()
4017 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_decryption_oop()
4023 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_decryption_oop()
4025 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_kasumi_decryption_oop()
4038 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_decryption_oop()
4039 ut_params->op); in test_kasumi_decryption_oop()
4040 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_decryption_oop()
4042 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_decryption_oop()
4043 if (ut_params->obuf) in test_kasumi_decryption_oop()
4044 plaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_kasumi_decryption_oop()
4065 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_decryption() local
4102 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_decryption()
4105 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_decryption()
4106 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_decryption()
4112 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_decryption()
4128 ut_params->op, 1, 0, 1, 0); in test_kasumi_decryption()
4130 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_decryption()
4131 ut_params->op); in test_kasumi_decryption()
4132 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_decryption()
4134 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_decryption()
4135 if (ut_params->obuf) in test_kasumi_decryption()
4136 plaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_kasumi_decryption()
4157 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_encryption() local
4194 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_encryption()
4197 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_encryption()
4198 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_encryption()
4204 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_encryption()
4220 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_encryption()
4222 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_encryption()
4223 ut_params->op); in test_snow3g_encryption()
4224 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_encryption()
4226 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_encryption()
4227 if (ut_params->obuf) in test_snow3g_encryption()
4228 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_encryption()
4248 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_encryption_oop() local
4288 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_encryption_oop()
4289 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_encryption_oop()
4291 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_snow3g_encryption_oop()
4293 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_snow3g_encryption_oop()
4297 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_encryption_oop()
4298 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_encryption_oop()
4304 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_encryption_oop()
4306 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_snow3g_encryption_oop()
4321 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_encryption_oop()
4323 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_encryption_oop()
4324 ut_params->op); in test_snow3g_encryption_oop()
4325 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_encryption_oop()
4327 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_encryption_oop()
4328 if (ut_params->obuf) in test_snow3g_encryption_oop()
4329 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_encryption_oop()
4348 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_encryption_oop_sgl() local
4403 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_snow3g_encryption_oop_sgl()
4405 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_snow3g_encryption_oop_sgl()
4408 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_snow3g_encryption_oop_sgl()
4410 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_snow3g_encryption_oop_sgl()
4413 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_snow3g_encryption_oop_sgl()
4425 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_encryption_oop_sgl()
4427 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_encryption_oop_sgl()
4428 ut_params->op); in test_snow3g_encryption_oop_sgl()
4429 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_encryption_oop_sgl()
4431 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_encryption_oop_sgl()
4432 if (ut_params->obuf) in test_snow3g_encryption_oop_sgl()
4433 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_snow3g_encryption_oop_sgl()
4436 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_snow3g_encryption_oop_sgl()
4475 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_encryption_offset_oop() local
4516 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_encryption_offset_oop()
4517 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_encryption_offset_oop()
4519 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_snow3g_encryption_offset_oop()
4521 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_snow3g_encryption_offset_oop()
4525 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_encryption_offset_oop()
4526 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_encryption_offset_oop()
4535 plaintext = (uint8_t *) rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_encryption_offset_oop()
4538 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_snow3g_encryption_offset_oop()
4556 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_encryption_offset_oop()
4558 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_encryption_offset_oop()
4559 ut_params->op); in test_snow3g_encryption_offset_oop()
4560 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_encryption_offset_oop()
4562 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_encryption_offset_oop()
4563 if (ut_params->obuf) in test_snow3g_encryption_offset_oop()
4564 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_encryption_offset_oop()
4594 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_decryption() local
4632 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_decryption()
4635 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_decryption()
4636 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_decryption()
4642 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_decryption()
4658 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_decryption()
4660 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_decryption()
4661 ut_params->op); in test_snow3g_decryption()
4662 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_decryption()
4663 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_decryption()
4664 if (ut_params->obuf) in test_snow3g_decryption()
4665 plaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_decryption()
4682 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_decryption_oop() local
4722 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_decryption_oop()
4723 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_decryption_oop()
4725 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_snow3g_decryption_oop()
4727 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_snow3g_decryption_oop()
4731 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_decryption_oop()
4732 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_decryption_oop()
4734 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_snow3g_decryption_oop()
4735 rte_pktmbuf_tailroom(ut_params->obuf)); in test_snow3g_decryption_oop()
4741 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_decryption_oop()
4743 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_snow3g_decryption_oop()
4758 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_snow3g_decryption_oop()
4760 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_decryption_oop()
4761 ut_params->op); in test_snow3g_decryption_oop()
4762 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_decryption_oop()
4763 ut_params->obuf = ut_params->op->sym->m_dst; in test_snow3g_decryption_oop()
4764 if (ut_params->obuf) in test_snow3g_decryption_oop()
4765 plaintext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_decryption_oop()
4783 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_cipher_auth() local
4835 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_zuc_cipher_auth()
4838 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_zuc_cipher_auth()
4839 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_zuc_cipher_auth()
4845 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_zuc_cipher_auth()
4858 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_zuc_cipher_auth()
4860 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_cipher_auth()
4861 ut_params->op); in test_zuc_cipher_auth()
4862 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_cipher_auth()
4863 ut_params->obuf = ut_params->op->sym->m_src; in test_zuc_cipher_auth()
4864 if (ut_params->obuf) in test_zuc_cipher_auth()
4865 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_zuc_cipher_auth()
4877 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_zuc_cipher_auth()
4882 ut_params->digest, in test_zuc_cipher_auth()
4893 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_cipher_auth() local
4938 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_cipher_auth()
4941 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_cipher_auth()
4942 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_cipher_auth()
4948 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_cipher_auth()
4970 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_snow3g_cipher_auth()
4972 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_cipher_auth()
4973 ut_params->op); in test_snow3g_cipher_auth()
4974 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_cipher_auth()
4975 ut_params->obuf = ut_params->op->sym->m_src; in test_snow3g_cipher_auth()
4976 if (ut_params->obuf) in test_snow3g_cipher_auth()
4977 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_snow3g_cipher_auth()
4989 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_snow3g_cipher_auth()
4994 ut_params->digest, in test_snow3g_cipher_auth()
5006 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_auth_cipher() local
5068 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_auth_cipher()
5070 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_snow3g_auth_cipher()
5073 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_snow3g_auth_cipher()
5074 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_snow3g_auth_cipher()
5076 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_snow3g_auth_cipher()
5077 rte_pktmbuf_tailroom(ut_params->obuf)); in test_snow3g_auth_cipher()
5085 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_auth_cipher()
5089 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_snow3g_auth_cipher()
5093 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_snow3g_auth_cipher()
5097 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_snow3g_auth_cipher()
5120 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_snow3g_auth_cipher()
5122 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_auth_cipher()
5123 ut_params->op); in test_snow3g_auth_cipher()
5125 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_auth_cipher()
5127 ut_params->obuf = (op_mode == IN_PLACE ? in test_snow3g_auth_cipher()
5128 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_snow3g_auth_cipher()
5131 if (ut_params->obuf) in test_snow3g_auth_cipher()
5132 plaintext = rte_pktmbuf_mtod(ut_params->obuf, in test_snow3g_auth_cipher()
5144 if (ut_params->obuf) in test_snow3g_auth_cipher()
5145 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, in test_snow3g_auth_cipher()
5155 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_snow3g_auth_cipher()
5159 debug_hexdump(stdout, "digest:", ut_params->digest, in test_snow3g_auth_cipher()
5184 ut_params->digest, in test_snow3g_auth_cipher()
5197 struct crypto_unittest_params *ut_params = &unittest_params; in test_snow3g_auth_cipher_sgl() local
5279 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_snow3g_auth_cipher_sgl()
5281 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_snow3g_auth_cipher_sgl()
5285 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_snow3g_auth_cipher_sgl()
5287 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_snow3g_auth_cipher_sgl()
5292 pktmbuf_write(ut_params->ibuf, 0, ciphertext_len, in test_snow3g_auth_cipher_sgl()
5294 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_snow3g_auth_cipher_sgl()
5299 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, in test_snow3g_auth_cipher_sgl()
5301 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_snow3g_auth_cipher_sgl()
5327 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_snow3g_auth_cipher_sgl()
5329 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_snow3g_auth_cipher_sgl()
5330 ut_params->op); in test_snow3g_auth_cipher_sgl()
5332 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_snow3g_auth_cipher_sgl()
5334 ut_params->obuf = (op_mode == IN_PLACE ? in test_snow3g_auth_cipher_sgl()
5335 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_snow3g_auth_cipher_sgl()
5338 if (ut_params->obuf) in test_snow3g_auth_cipher_sgl()
5339 plaintext = rte_pktmbuf_read(ut_params->obuf, 0, in test_snow3g_auth_cipher_sgl()
5342 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_snow3g_auth_cipher_sgl()
5351 if (ut_params->obuf) in test_snow3g_auth_cipher_sgl()
5352 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_snow3g_auth_cipher_sgl()
5355 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_snow3g_auth_cipher_sgl()
5363 if (ut_params->obuf) in test_snow3g_auth_cipher_sgl()
5364 digest = rte_pktmbuf_read(ut_params->obuf, in test_snow3g_auth_cipher_sgl()
5369 digest = rte_pktmbuf_read(ut_params->ibuf, in test_snow3g_auth_cipher_sgl()
5412 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_auth_cipher() local
5475 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_auth_cipher()
5477 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_auth_cipher()
5480 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_auth_cipher()
5481 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_auth_cipher()
5483 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_kasumi_auth_cipher()
5484 rte_pktmbuf_tailroom(ut_params->obuf)); in test_kasumi_auth_cipher()
5492 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_auth_cipher()
5496 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_kasumi_auth_cipher()
5500 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_auth_cipher()
5504 rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len); in test_kasumi_auth_cipher()
5528 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_kasumi_auth_cipher()
5530 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_auth_cipher()
5531 ut_params->op); in test_kasumi_auth_cipher()
5533 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_auth_cipher()
5535 ut_params->obuf = (op_mode == IN_PLACE ? in test_kasumi_auth_cipher()
5536 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_kasumi_auth_cipher()
5540 if (ut_params->obuf) in test_kasumi_auth_cipher()
5541 plaintext = rte_pktmbuf_mtod(ut_params->obuf, in test_kasumi_auth_cipher()
5552 if (ut_params->obuf) in test_kasumi_auth_cipher()
5553 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, in test_kasumi_auth_cipher()
5563 ut_params->digest = rte_pktmbuf_mtod( in test_kasumi_auth_cipher()
5564 ut_params->obuf, uint8_t *) + in test_kasumi_auth_cipher()
5568 debug_hexdump(stdout, "digest:", ut_params->digest, in test_kasumi_auth_cipher()
5589 ut_params->digest, in test_kasumi_auth_cipher()
5602 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_auth_cipher_sgl() local
5684 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_kasumi_auth_cipher_sgl()
5686 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_kasumi_auth_cipher_sgl()
5690 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_kasumi_auth_cipher_sgl()
5692 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_kasumi_auth_cipher_sgl()
5697 pktmbuf_write(ut_params->ibuf, 0, ciphertext_len, in test_kasumi_auth_cipher_sgl()
5699 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_kasumi_auth_cipher_sgl()
5704 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, in test_kasumi_auth_cipher_sgl()
5706 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_kasumi_auth_cipher_sgl()
5732 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_kasumi_auth_cipher_sgl()
5734 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_auth_cipher_sgl()
5735 ut_params->op); in test_kasumi_auth_cipher_sgl()
5737 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_auth_cipher_sgl()
5739 ut_params->obuf = (op_mode == IN_PLACE ? in test_kasumi_auth_cipher_sgl()
5740 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_kasumi_auth_cipher_sgl()
5743 if (ut_params->obuf) in test_kasumi_auth_cipher_sgl()
5744 plaintext = rte_pktmbuf_read(ut_params->obuf, 0, in test_kasumi_auth_cipher_sgl()
5747 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_kasumi_auth_cipher_sgl()
5756 if (ut_params->obuf) in test_kasumi_auth_cipher_sgl()
5757 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_kasumi_auth_cipher_sgl()
5760 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_kasumi_auth_cipher_sgl()
5768 if (ut_params->obuf) in test_kasumi_auth_cipher_sgl()
5769 digest = rte_pktmbuf_read(ut_params->obuf, in test_kasumi_auth_cipher_sgl()
5774 digest = rte_pktmbuf_read(ut_params->ibuf, in test_kasumi_auth_cipher_sgl()
5812 struct crypto_unittest_params *ut_params = &unittest_params; in test_kasumi_cipher_auth() local
5859 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_kasumi_cipher_auth()
5862 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_kasumi_cipher_auth()
5863 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_kasumi_cipher_auth()
5869 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_kasumi_cipher_auth()
5890 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_kasumi_cipher_auth()
5892 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_kasumi_cipher_auth()
5893 ut_params->op); in test_kasumi_cipher_auth()
5894 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_kasumi_cipher_auth()
5896 if (ut_params->op->sym->m_dst) in test_kasumi_cipher_auth()
5897 ut_params->obuf = ut_params->op->sym->m_dst; in test_kasumi_cipher_auth()
5899 ut_params->obuf = ut_params->op->sym->m_src; in test_kasumi_cipher_auth()
5901 ciphertext = rte_pktmbuf_mtod_offset(ut_params->obuf, uint8_t *, in test_kasumi_cipher_auth()
5904 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_kasumi_cipher_auth()
5918 ut_params->digest, in test_kasumi_cipher_auth()
5984 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_encryption() local
6018 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_zuc_encryption()
6021 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_zuc_encryption()
6022 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_zuc_encryption()
6028 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_zuc_encryption()
6044 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_zuc_encryption()
6046 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_encryption()
6047 ut_params->op); in test_zuc_encryption()
6048 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_encryption()
6050 ut_params->obuf = ut_params->op->sym->m_dst; in test_zuc_encryption()
6051 if (ut_params->obuf) in test_zuc_encryption()
6052 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *); in test_zuc_encryption()
6071 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_encryption_sgl() local
6111 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_zuc_encryption_sgl()
6114 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, in test_zuc_encryption_sgl()
6128 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data); in test_zuc_encryption_sgl()
6139 ut_params->op, 1, 0, 1, tdata->cipher_iv.len); in test_zuc_encryption_sgl()
6141 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_encryption_sgl()
6142 ut_params->op); in test_zuc_encryption_sgl()
6143 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_encryption_sgl()
6145 ut_params->obuf = ut_params->op->sym->m_dst; in test_zuc_encryption_sgl()
6146 if (ut_params->obuf) in test_zuc_encryption_sgl()
6147 ciphertext = rte_pktmbuf_read(ut_params->obuf, in test_zuc_encryption_sgl()
6150 ciphertext = rte_pktmbuf_read(ut_params->ibuf, in test_zuc_encryption_sgl()
6170 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_authentication() local
6213 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_zuc_authentication()
6215 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_zuc_authentication()
6216 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_zuc_authentication()
6222 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_zuc_authentication()
6237 ut_params->op, 0, 1, 1, 0); in test_zuc_authentication()
6239 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_authentication()
6240 ut_params->op); in test_zuc_authentication()
6241 ut_params->obuf = ut_params->op->sym->m_src; in test_zuc_authentication()
6242 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_authentication()
6243 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_zuc_authentication()
6248 ut_params->digest, in test_zuc_authentication()
6261 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_auth_cipher() local
6330 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_zuc_auth_cipher()
6332 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_zuc_auth_cipher()
6335 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_zuc_auth_cipher()
6336 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_zuc_auth_cipher()
6338 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_zuc_auth_cipher()
6339 rte_pktmbuf_tailroom(ut_params->obuf)); in test_zuc_auth_cipher()
6347 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_zuc_auth_cipher()
6354 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_zuc_auth_cipher()
6362 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_zuc_auth_cipher()
6383 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_zuc_auth_cipher()
6385 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_auth_cipher()
6386 ut_params->op); in test_zuc_auth_cipher()
6388 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_auth_cipher()
6390 ut_params->obuf = (op_mode == IN_PLACE ? in test_zuc_auth_cipher()
6391 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_zuc_auth_cipher()
6395 if (ut_params->obuf) in test_zuc_auth_cipher()
6396 plaintext = rte_pktmbuf_mtod(ut_params->obuf, in test_zuc_auth_cipher()
6407 if (ut_params->obuf) in test_zuc_auth_cipher()
6408 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, in test_zuc_auth_cipher()
6418 ut_params->digest = rte_pktmbuf_mtod( in test_zuc_auth_cipher()
6419 ut_params->obuf, uint8_t *) + in test_zuc_auth_cipher()
6423 debug_hexdump(stdout, "digest:", ut_params->digest, in test_zuc_auth_cipher()
6444 ut_params->digest, in test_zuc_auth_cipher()
6457 struct crypto_unittest_params *ut_params = &unittest_params; in test_zuc_auth_cipher_sgl() local
6535 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_zuc_auth_cipher_sgl()
6537 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_zuc_auth_cipher_sgl()
6541 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_zuc_auth_cipher_sgl()
6543 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_zuc_auth_cipher_sgl()
6548 pktmbuf_write(ut_params->ibuf, 0, ciphertext_len, in test_zuc_auth_cipher_sgl()
6550 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_zuc_auth_cipher_sgl()
6555 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, in test_zuc_auth_cipher_sgl()
6557 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_zuc_auth_cipher_sgl()
6583 ut_params->op, 1, 1, 1, tdata->cipher_iv.len); in test_zuc_auth_cipher_sgl()
6585 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_zuc_auth_cipher_sgl()
6586 ut_params->op); in test_zuc_auth_cipher_sgl()
6588 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_zuc_auth_cipher_sgl()
6590 ut_params->obuf = (op_mode == IN_PLACE ? in test_zuc_auth_cipher_sgl()
6591 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_zuc_auth_cipher_sgl()
6594 if (ut_params->obuf) in test_zuc_auth_cipher_sgl()
6595 plaintext = rte_pktmbuf_read(ut_params->obuf, 0, in test_zuc_auth_cipher_sgl()
6598 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_zuc_auth_cipher_sgl()
6607 if (ut_params->obuf) in test_zuc_auth_cipher_sgl()
6608 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_zuc_auth_cipher_sgl()
6611 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_zuc_auth_cipher_sgl()
6619 if (ut_params->obuf) in test_zuc_auth_cipher_sgl()
6620 digest = rte_pktmbuf_read(ut_params->obuf, in test_zuc_auth_cipher_sgl()
6625 digest = rte_pktmbuf_read(ut_params->ibuf, in test_zuc_auth_cipher_sgl()
7344 struct crypto_unittest_params *ut_params = &unittest_params; in test_mixed_auth_cipher() local
7396 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_mixed_auth_cipher()
7398 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_mixed_auth_cipher()
7401 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_mixed_auth_cipher()
7402 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_mixed_auth_cipher()
7405 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_mixed_auth_cipher()
7406 rte_pktmbuf_tailroom(ut_params->obuf)); in test_mixed_auth_cipher()
7415 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_mixed_auth_cipher()
7422 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_mixed_auth_cipher()
7429 rte_pktmbuf_append(ut_params->obuf, ciphertext_pad_len); in test_mixed_auth_cipher()
7448 op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); in test_mixed_auth_cipher()
7452 if (op == NULL && ut_params->op->status == in test_mixed_auth_cipher()
7458 ut_params->op = op; in test_mixed_auth_cipher()
7460 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_mixed_auth_cipher()
7462 ut_params->obuf = (op_mode == IN_PLACE ? in test_mixed_auth_cipher()
7463 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_mixed_auth_cipher()
7466 if (ut_params->obuf) in test_mixed_auth_cipher()
7467 plaintext = rte_pktmbuf_mtod(ut_params->obuf, in test_mixed_auth_cipher()
7479 if (ut_params->obuf) in test_mixed_auth_cipher()
7480 ciphertext = rte_pktmbuf_mtod(ut_params->obuf, in test_mixed_auth_cipher()
7491 ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) in test_mixed_auth_cipher()
7495 debug_hexdump(stdout, "digest:", ut_params->digest, in test_mixed_auth_cipher()
7504 ut_params->digest, in test_mixed_auth_cipher()
7526 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_mixed_auth_cipher()
7537 struct crypto_unittest_params *ut_params = &unittest_params; in test_mixed_auth_cipher_sgl() local
7611 ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_mixed_auth_cipher_sgl()
7613 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_mixed_auth_cipher_sgl()
7617 ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, in test_mixed_auth_cipher_sgl()
7619 TEST_ASSERT_NOT_NULL(ut_params->obuf, in test_mixed_auth_cipher_sgl()
7624 pktmbuf_write(ut_params->ibuf, 0, ciphertext_len, in test_mixed_auth_cipher_sgl()
7626 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_mixed_auth_cipher_sgl()
7631 pktmbuf_write(ut_params->ibuf, 0, plaintext_len, in test_mixed_auth_cipher_sgl()
7633 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_mixed_auth_cipher_sgl()
7657 op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); in test_mixed_auth_cipher_sgl()
7661 if (op == NULL && ut_params->op->status == in test_mixed_auth_cipher_sgl()
7667 ut_params->op = op; in test_mixed_auth_cipher_sgl()
7669 TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); in test_mixed_auth_cipher_sgl()
7671 ut_params->obuf = (op_mode == IN_PLACE ? in test_mixed_auth_cipher_sgl()
7672 ut_params->op->sym->m_src : ut_params->op->sym->m_dst); in test_mixed_auth_cipher_sgl()
7675 if (ut_params->obuf) in test_mixed_auth_cipher_sgl()
7676 plaintext = rte_pktmbuf_read(ut_params->obuf, 0, in test_mixed_auth_cipher_sgl()
7679 plaintext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_mixed_auth_cipher_sgl()
7690 if (ut_params->obuf) in test_mixed_auth_cipher_sgl()
7691 ciphertext = rte_pktmbuf_read(ut_params->obuf, 0, in test_mixed_auth_cipher_sgl()
7694 ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0, in test_mixed_auth_cipher_sgl()
7703 if (ut_params->obuf) in test_mixed_auth_cipher_sgl()
7704 digest = rte_pktmbuf_read(ut_params->obuf, in test_mixed_auth_cipher_sgl()
7710 digest = rte_pktmbuf_read(ut_params->ibuf, in test_mixed_auth_cipher_sgl()
7746 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_mixed_auth_cipher_sgl()
7993 struct crypto_unittest_params *ut_params = &unittest_params; in create_aead_session() local
7998 ut_params->aead_xform.type = RTE_CRYPTO_SYM_XFORM_AEAD; in create_aead_session()
7999 ut_params->aead_xform.next = NULL; in create_aead_session()
8000 ut_params->aead_xform.aead.algo = algo; in create_aead_session()
8001 ut_params->aead_xform.aead.op = op; in create_aead_session()
8002 ut_params->aead_xform.aead.key.data = aead_key; in create_aead_session()
8003 ut_params->aead_xform.aead.key.length = key_len; in create_aead_session()
8004 ut_params->aead_xform.aead.iv.offset = IV_OFFSET; in create_aead_session()
8005 ut_params->aead_xform.aead.iv.length = iv_len; in create_aead_session()
8006 ut_params->aead_xform.aead.digest_length = auth_len; in create_aead_session()
8007 ut_params->aead_xform.aead.aad_length = aad_len; in create_aead_session()
8012 ut_params->sess = rte_cryptodev_sym_session_create( in create_aead_session()
8014 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_aead_session()
8016 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_aead_session()
8017 &ut_params->aead_xform, in create_aead_session()
8058 struct crypto_unittest_params *ut_params = &unittest_params; in create_aead_operation() local
8064 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_aead_operation()
8066 TEST_ASSERT_NOT_NULL(ut_params->op, in create_aead_operation()
8069 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_aead_operation()
8074 sym_op->aead.aad.data = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in create_aead_operation()
8080 rte_pktmbuf_iova(ut_params->ibuf); in create_aead_operation()
8087 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_aead_operation()
8096 sym_op->aead.aad.data = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in create_aead_operation()
8102 rte_pktmbuf_iova(ut_params->ibuf); in create_aead_operation()
8108 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_aead_operation()
8125 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in create_aead_operation()
8133 if (ut_params->obuf) { in create_aead_operation()
8135 ut_params->obuf, in create_aead_operation()
8145 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in create_aead_operation()
8155 if (ut_params->obuf) { in create_aead_operation()
8157 ut_params->obuf, in create_aead_operation()
8170 ut_params->obuf ? ut_params->obuf : in create_aead_operation()
8171 ut_params->ibuf, in create_aead_operation()
8177 ut_params->obuf ? ut_params->obuf : in create_aead_operation()
8178 ut_params->ibuf, in create_aead_operation()
8183 ut_params->ibuf, tdata->auth_tag.len); in create_aead_operation()
8187 ut_params->ibuf, in create_aead_operation()
8207 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_encryption() local
8249 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool); in test_authenticated_encryption()
8254 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption()
8257 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_encryption()
8258 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_encryption()
8265 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_authenticated_encryption()
8267 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_encryption()
8271 process_cpu_aead_op(ts_params->valid_devs[0], ut_params->op); in test_authenticated_encryption()
8274 ut_params->op, 0, 0, 0, 0); in test_authenticated_encryption()
8278 ut_params->op), "failed to process sym crypto op"); in test_authenticated_encryption()
8280 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_encryption()
8285 if (ut_params->op->sym->m_dst) { in test_authenticated_encryption()
8286 ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_dst, in test_authenticated_encryption()
8288 auth_tag = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_dst, in test_authenticated_encryption()
8291 ciphertext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_src, in test_authenticated_encryption()
8293 ut_params->op->sym->cipher.data.offset); in test_authenticated_encryption()
8367 struct crypto_unittest_params *ut_params = &unittest_params; in test_pdcp_proto() local
8377 sec_cap_idx.action = ut_params->type; in test_pdcp_proto()
8384 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_pdcp_proto()
8387 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_pdcp_proto()
8388 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_pdcp_proto()
8390 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_pdcp_proto()
8399 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_pdcp_proto()
8400 rte_pktmbuf_append(ut_params->obuf, output_vec_len); in test_pdcp_proto()
8404 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_pdcp_proto()
8405 ut_params->cipher_xform.cipher.algo = cipher_alg; in test_pdcp_proto()
8406 ut_params->cipher_xform.cipher.op = opc; in test_pdcp_proto()
8407 ut_params->cipher_xform.cipher.key.data = cipher_key; in test_pdcp_proto()
8408 ut_params->cipher_xform.cipher.key.length = cipher_key_len; in test_pdcp_proto()
8409 ut_params->cipher_xform.cipher.iv.length = in test_pdcp_proto()
8411 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_pdcp_proto()
8415 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_pdcp_proto()
8416 ut_params->auth_xform.next = NULL; in test_pdcp_proto()
8417 ut_params->auth_xform.auth.algo = auth_alg; in test_pdcp_proto()
8418 ut_params->auth_xform.auth.op = opa; in test_pdcp_proto()
8419 ut_params->auth_xform.auth.key.data = auth_key; in test_pdcp_proto()
8420 ut_params->auth_xform.auth.key.length = auth_key_len; in test_pdcp_proto()
8422 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_pdcp_proto()
8424 ut_params->cipher_xform.next = NULL; in test_pdcp_proto()
8428 .action_type = ut_params->type, in test_pdcp_proto()
8448 .crypto_xform = &ut_params->cipher_xform in test_pdcp_proto()
8452 ut_params->sec_session = rte_security_session_create(ctx, in test_pdcp_proto()
8456 if (!ut_params->sec_session) { in test_pdcp_proto()
8464 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_pdcp_proto()
8466 if (!ut_params->op) { in test_pdcp_proto()
8474 uint32_t *per_pkt_hfn = rte_crypto_op_ctod_offset(ut_params->op, in test_pdcp_proto()
8478 rte_security_attach_session(ut_params->op, ut_params->sec_session); in test_pdcp_proto()
8481 ut_params->op->sym->m_src = ut_params->ibuf; in test_pdcp_proto()
8483 ut_params->op->sym->m_dst = ut_params->obuf; in test_pdcp_proto()
8486 if (process_crypto_request(ts_params->valid_devs[0], ut_params->op) in test_pdcp_proto()
8495 if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { in test_pdcp_proto()
8503 uint8_t *ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_src, in test_pdcp_proto()
8506 ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_dst, in test_pdcp_proto()
8519 rte_crypto_op_free(ut_params->op); in test_pdcp_proto()
8520 ut_params->op = NULL; in test_pdcp_proto()
8522 if (ut_params->sec_session) in test_pdcp_proto()
8523 rte_security_session_destroy(ctx, ut_params->sec_session); in test_pdcp_proto()
8524 ut_params->sec_session = NULL; in test_pdcp_proto()
8526 rte_pktmbuf_free(ut_params->ibuf); in test_pdcp_proto()
8527 ut_params->ibuf = NULL; in test_pdcp_proto()
8529 rte_pktmbuf_free(ut_params->obuf); in test_pdcp_proto()
8530 ut_params->obuf = NULL; in test_pdcp_proto()
8548 struct crypto_unittest_params *ut_params = &unittest_params; in test_pdcp_proto_SGL() local
8574 sec_cap_idx.action = ut_params->type; in test_pdcp_proto_SGL()
8601 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_pdcp_proto_SGL()
8602 rte_pktmbuf_append(ut_params->obuf, frag_size_oop); in test_pdcp_proto_SGL()
8603 buf_oop = ut_params->obuf; in test_pdcp_proto_SGL()
8607 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_pdcp_proto_SGL()
8610 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_pdcp_proto_SGL()
8611 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_pdcp_proto_SGL()
8613 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_pdcp_proto_SGL()
8618 buf = ut_params->ibuf; in test_pdcp_proto_SGL()
8654 ut_params->ibuf->nb_segs = segs; in test_pdcp_proto_SGL()
8681 ut_params->obuf->nb_segs = segs; in test_pdcp_proto_SGL()
8685 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_pdcp_proto_SGL()
8686 ut_params->cipher_xform.cipher.algo = pdcp_test_params[i].cipher_alg; in test_pdcp_proto_SGL()
8687 ut_params->cipher_xform.cipher.op = opc; in test_pdcp_proto_SGL()
8688 ut_params->cipher_xform.cipher.key.data = pdcp_test_crypto_key[i]; in test_pdcp_proto_SGL()
8689 ut_params->cipher_xform.cipher.key.length = in test_pdcp_proto_SGL()
8691 ut_params->cipher_xform.cipher.iv.length = 0; in test_pdcp_proto_SGL()
8695 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_pdcp_proto_SGL()
8696 ut_params->auth_xform.next = NULL; in test_pdcp_proto_SGL()
8697 ut_params->auth_xform.auth.algo = pdcp_test_params[i].auth_alg; in test_pdcp_proto_SGL()
8698 ut_params->auth_xform.auth.op = opa; in test_pdcp_proto_SGL()
8699 ut_params->auth_xform.auth.key.data = pdcp_test_auth_key[i]; in test_pdcp_proto_SGL()
8700 ut_params->auth_xform.auth.key.length = in test_pdcp_proto_SGL()
8703 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_pdcp_proto_SGL()
8705 ut_params->cipher_xform.next = NULL; in test_pdcp_proto_SGL()
8709 .action_type = ut_params->type, in test_pdcp_proto_SGL()
8720 .crypto_xform = &ut_params->cipher_xform in test_pdcp_proto_SGL()
8724 ut_params->sec_session = rte_security_session_create(ctx, in test_pdcp_proto_SGL()
8728 if (!ut_params->sec_session) { in test_pdcp_proto_SGL()
8736 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_pdcp_proto_SGL()
8738 if (!ut_params->op) { in test_pdcp_proto_SGL()
8746 rte_security_attach_session(ut_params->op, ut_params->sec_session); in test_pdcp_proto_SGL()
8749 ut_params->op->sym->m_src = ut_params->ibuf; in test_pdcp_proto_SGL()
8751 ut_params->op->sym->m_dst = ut_params->obuf; in test_pdcp_proto_SGL()
8754 temp_mbuf = ut_params->op->sym->m_src; in test_pdcp_proto_SGL()
8758 ut_params->op->sym->cipher.data.length in test_pdcp_proto_SGL()
8760 ut_params->op->sym->auth.data.length in test_pdcp_proto_SGL()
8765 ut_params->op, 1, 1, 0, 0); in test_pdcp_proto_SGL()
8767 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_pdcp_proto_SGL()
8768 ut_params->op); in test_pdcp_proto_SGL()
8770 if (ut_params->op == NULL) { in test_pdcp_proto_SGL()
8778 if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { in test_pdcp_proto_SGL()
8786 uint8_t *ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_src, in test_pdcp_proto_SGL()
8789 ciphertext = rte_pktmbuf_mtod(ut_params->op->sym->m_dst, in test_pdcp_proto_SGL()
8802 buf = ut_params->op->sym->m_src->next; in test_pdcp_proto_SGL()
8804 buf = ut_params->op->sym->m_dst->next; in test_pdcp_proto_SGL()
8824 rte_crypto_op_free(ut_params->op); in test_pdcp_proto_SGL()
8825 ut_params->op = NULL; in test_pdcp_proto_SGL()
8827 if (ut_params->sec_session) in test_pdcp_proto_SGL()
8828 rte_security_session_destroy(ctx, ut_params->sec_session); in test_pdcp_proto_SGL()
8829 ut_params->sec_session = NULL; in test_pdcp_proto_SGL()
8831 rte_pktmbuf_free(ut_params->ibuf); in test_pdcp_proto_SGL()
8832 ut_params->ibuf = NULL; in test_pdcp_proto_SGL()
8834 rte_pktmbuf_free(ut_params->obuf); in test_pdcp_proto_SGL()
8835 ut_params->obuf = NULL; in test_pdcp_proto_SGL()
9145 struct crypto_unittest_params *ut_params = &unittest_params; in test_ipsec_proto_process() local
9158 ut_params->type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL; in test_ipsec_proto_process()
9217 sec_cap_idx.action = ut_params->type; in test_ipsec_proto_process()
9232 memcpy(&ut_params->aead_xform, &td[0].xform.aead, in test_ipsec_proto_process()
9233 sizeof(ut_params->aead_xform)); in test_ipsec_proto_process()
9234 ut_params->aead_xform.aead.key.data = td[0].key.data; in test_ipsec_proto_process()
9235 ut_params->aead_xform.aead.iv.offset = IV_OFFSET; in test_ipsec_proto_process()
9240 &ut_params->aead_xform) != 0) { in test_ipsec_proto_process()
9247 memcpy(&ut_params->auth_xform, &td[0].xform.chain.auth, in test_ipsec_proto_process()
9248 sizeof(ut_params->auth_xform)); in test_ipsec_proto_process()
9249 ut_params->auth_xform.auth.key.data = td[0].auth_key.data; in test_ipsec_proto_process()
9253 &ut_params->auth_xform) != 0) { in test_ipsec_proto_process()
9260 memcpy(&ut_params->cipher_xform, &td[0].xform.chain.cipher, in test_ipsec_proto_process()
9261 sizeof(ut_params->cipher_xform)); in test_ipsec_proto_process()
9262 memcpy(&ut_params->auth_xform, &td[0].xform.chain.auth, in test_ipsec_proto_process()
9263 sizeof(ut_params->auth_xform)); in test_ipsec_proto_process()
9264 ut_params->cipher_xform.cipher.key.data = td[0].key.data; in test_ipsec_proto_process()
9265 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_ipsec_proto_process()
9266 ut_params->auth_xform.auth.key.data = td[0].auth_key.data; in test_ipsec_proto_process()
9272 &ut_params->cipher_xform) != 0) { in test_ipsec_proto_process()
9281 &ut_params->auth_xform) != 0) { in test_ipsec_proto_process()
9293 .action_type = ut_params->type, in test_ipsec_proto_process()
9304 sess_conf.crypto_xform = &ut_params->aead_xform; in test_ipsec_proto_process()
9307 sess_conf.crypto_xform = &ut_params->auth_xform; in test_ipsec_proto_process()
9311 sess_conf.crypto_xform = &ut_params->cipher_xform; in test_ipsec_proto_process()
9312 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_ipsec_proto_process()
9314 sess_conf.crypto_xform = &ut_params->auth_xform; in test_ipsec_proto_process()
9315 ut_params->auth_xform.next = &ut_params->cipher_xform; in test_ipsec_proto_process()
9320 ut_params->sec_session = rte_security_session_create(ctx, &sess_conf, in test_ipsec_proto_process()
9324 if (ut_params->sec_session == NULL) in test_ipsec_proto_process()
9332 ut_params->sec_session, &sess_conf); in test_ipsec_proto_process()
9341 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_ipsec_proto_process()
9342 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_ipsec_proto_process()
9343 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_ipsec_proto_process()
9345 input_text = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_ipsec_proto_process()
9355 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_ipsec_proto_process()
9357 if (!ut_params->op) { in test_ipsec_proto_process()
9366 rte_security_attach_session(ut_params->op, in test_ipsec_proto_process()
9367 ut_params->sec_session); in test_ipsec_proto_process()
9370 ut_params->op->sym->m_src = ut_params->ibuf; in test_ipsec_proto_process()
9371 ut_params->op->sym->m_dst = NULL; in test_ipsec_proto_process()
9376 uint8_t *iv = rte_crypto_op_ctod_offset(ut_params->op, in test_ipsec_proto_process()
9392 process_crypto_request(dev_id, ut_params->op); in test_ipsec_proto_process()
9394 ret = test_ipsec_status_check(&td[i], ut_params->op, flags, dir, in test_ipsec_proto_process()
9402 ret = test_ipsec_post_process(ut_params->ibuf, &td[i], in test_ipsec_proto_process()
9407 ret = test_ipsec_stats_verify(ctx, ut_params->sec_session, in test_ipsec_proto_process()
9412 rte_crypto_op_free(ut_params->op); in test_ipsec_proto_process()
9413 ut_params->op = NULL; in test_ipsec_proto_process()
9415 rte_pktmbuf_free(ut_params->ibuf); in test_ipsec_proto_process()
9416 ut_params->ibuf = NULL; in test_ipsec_proto_process()
9420 rte_crypto_op_free(ut_params->op); in test_ipsec_proto_process()
9421 ut_params->op = NULL; in test_ipsec_proto_process()
9423 rte_pktmbuf_free(ut_params->ibuf); in test_ipsec_proto_process()
9424 ut_params->ibuf = NULL; in test_ipsec_proto_process()
9426 if (ut_params->sec_session) in test_ipsec_proto_process()
9427 rte_security_session_destroy(ctx, ut_params->sec_session); in test_ipsec_proto_process()
9428 ut_params->sec_session = NULL; in test_ipsec_proto_process()
10181 struct crypto_unittest_params *ut_params = &unittest_params; in test_PDCP_PROTO_all() local
10192 ut_params->type = gbl_action_type == RTE_SECURITY_ACTION_TYPE_NONE ? in test_PDCP_PROTO_all()
10196 if (security_proto_supported(ut_params->type, in test_PDCP_PROTO_all()
10244 struct crypto_unittest_params *ut_params = &unittest_params; in test_docsis_proto_uplink() local
10264 ut_params->type = gbl_action_type == RTE_SECURITY_ACTION_TYPE_NONE ? in test_docsis_proto_uplink()
10268 if (security_proto_supported(ut_params->type, in test_docsis_proto_uplink()
10272 sec_cap_idx.action = ut_params->type; in test_docsis_proto_uplink()
10299 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_docsis_proto_uplink()
10300 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_docsis_proto_uplink()
10301 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_docsis_proto_uplink()
10303 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_docsis_proto_uplink()
10309 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_docsis_proto_uplink()
10310 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI; in test_docsis_proto_uplink()
10311 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT; in test_docsis_proto_uplink()
10312 ut_params->cipher_xform.cipher.key.data = d_td->key.data; in test_docsis_proto_uplink()
10313 ut_params->cipher_xform.cipher.key.length = d_td->key.len; in test_docsis_proto_uplink()
10314 ut_params->cipher_xform.cipher.iv.length = d_td->iv.len; in test_docsis_proto_uplink()
10315 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_docsis_proto_uplink()
10316 ut_params->cipher_xform.next = NULL; in test_docsis_proto_uplink()
10319 ut_params->docsis_xform.direction = RTE_SECURITY_DOCSIS_UPLINK; in test_docsis_proto_uplink()
10322 .action_type = ut_params->type, in test_docsis_proto_uplink()
10324 .docsis = ut_params->docsis_xform, in test_docsis_proto_uplink()
10325 .crypto_xform = &ut_params->cipher_xform, in test_docsis_proto_uplink()
10329 ut_params->sec_session = rte_security_session_create(ctx, &sess_conf, in test_docsis_proto_uplink()
10333 if (!ut_params->sec_session) { in test_docsis_proto_uplink()
10341 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_docsis_proto_uplink()
10343 if (!ut_params->op) { in test_docsis_proto_uplink()
10358 ut_params->op->sym->auth.data.length = crc_len; in test_docsis_proto_uplink()
10359 ut_params->op->sym->auth.data.offset = d_td->ciphertext.crc_offset; in test_docsis_proto_uplink()
10367 ut_params->op->sym->cipher.data.length = cipher_len; in test_docsis_proto_uplink()
10368 ut_params->op->sym->cipher.data.offset = d_td->ciphertext.cipher_offset; in test_docsis_proto_uplink()
10371 iv_ptr = (uint8_t *)ut_params->op + IV_OFFSET; in test_docsis_proto_uplink()
10375 rte_security_attach_session(ut_params->op, ut_params->sec_session); in test_docsis_proto_uplink()
10378 ut_params->op->sym->m_src = ut_params->ibuf; in test_docsis_proto_uplink()
10379 ut_params->op->sym->m_dst = NULL; in test_docsis_proto_uplink()
10382 if (process_crypto_request(ts_params->valid_devs[0], ut_params->op) == in test_docsis_proto_uplink()
10390 if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { in test_docsis_proto_uplink()
10412 rte_crypto_op_free(ut_params->op); in test_docsis_proto_uplink()
10413 ut_params->op = NULL; in test_docsis_proto_uplink()
10415 if (ut_params->sec_session) in test_docsis_proto_uplink()
10416 rte_security_session_destroy(ctx, ut_params->sec_session); in test_docsis_proto_uplink()
10417 ut_params->sec_session = NULL; in test_docsis_proto_uplink()
10419 rte_pktmbuf_free(ut_params->ibuf); in test_docsis_proto_uplink()
10420 ut_params->ibuf = NULL; in test_docsis_proto_uplink()
10430 struct crypto_unittest_params *ut_params = &unittest_params; in test_docsis_proto_downlink() local
10449 ut_params->type = gbl_action_type == RTE_SECURITY_ACTION_TYPE_NONE ? in test_docsis_proto_downlink()
10453 if (security_proto_supported(ut_params->type, in test_docsis_proto_downlink()
10457 sec_cap_idx.action = ut_params->type; in test_docsis_proto_downlink()
10484 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_docsis_proto_downlink()
10485 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_docsis_proto_downlink()
10486 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_docsis_proto_downlink()
10488 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_docsis_proto_downlink()
10494 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_docsis_proto_downlink()
10495 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI; in test_docsis_proto_downlink()
10496 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; in test_docsis_proto_downlink()
10497 ut_params->cipher_xform.cipher.key.data = d_td->key.data; in test_docsis_proto_downlink()
10498 ut_params->cipher_xform.cipher.key.length = d_td->key.len; in test_docsis_proto_downlink()
10499 ut_params->cipher_xform.cipher.iv.length = d_td->iv.len; in test_docsis_proto_downlink()
10500 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_docsis_proto_downlink()
10501 ut_params->cipher_xform.next = NULL; in test_docsis_proto_downlink()
10504 ut_params->docsis_xform.direction = RTE_SECURITY_DOCSIS_DOWNLINK; in test_docsis_proto_downlink()
10507 .action_type = ut_params->type, in test_docsis_proto_downlink()
10509 .docsis = ut_params->docsis_xform, in test_docsis_proto_downlink()
10510 .crypto_xform = &ut_params->cipher_xform, in test_docsis_proto_downlink()
10514 ut_params->sec_session = rte_security_session_create(ctx, &sess_conf, in test_docsis_proto_downlink()
10518 if (!ut_params->sec_session) { in test_docsis_proto_downlink()
10526 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_docsis_proto_downlink()
10528 if (!ut_params->op) { in test_docsis_proto_downlink()
10542 ut_params->op->sym->auth.data.length = crc_len; in test_docsis_proto_downlink()
10543 ut_params->op->sym->auth.data.offset = d_td->plaintext.crc_offset; in test_docsis_proto_downlink()
10551 ut_params->op->sym->cipher.data.length = cipher_len; in test_docsis_proto_downlink()
10552 ut_params->op->sym->cipher.data.offset = d_td->plaintext.cipher_offset; in test_docsis_proto_downlink()
10555 iv_ptr = (uint8_t *)ut_params->op + IV_OFFSET; in test_docsis_proto_downlink()
10559 rte_security_attach_session(ut_params->op, ut_params->sec_session); in test_docsis_proto_downlink()
10562 ut_params->op->sym->m_src = ut_params->ibuf; in test_docsis_proto_downlink()
10563 ut_params->op->sym->m_dst = NULL; in test_docsis_proto_downlink()
10566 if (process_crypto_request(ts_params->valid_devs[0], ut_params->op) == in test_docsis_proto_downlink()
10574 if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { in test_docsis_proto_downlink()
10595 rte_crypto_op_free(ut_params->op); in test_docsis_proto_downlink()
10596 ut_params->op = NULL; in test_docsis_proto_downlink()
10598 if (ut_params->sec_session) in test_docsis_proto_downlink()
10599 rte_security_session_destroy(ctx, ut_params->sec_session); in test_docsis_proto_downlink()
10600 ut_params->sec_session = NULL; in test_docsis_proto_downlink()
10602 rte_pktmbuf_free(ut_params->ibuf); in test_docsis_proto_downlink()
10603 ut_params->ibuf = NULL; in test_docsis_proto_downlink()
10862 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_decryption() local
10904 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool); in test_authenticated_decryption()
10909 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decryption()
10911 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_decryption()
10912 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_decryption()
10919 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_authenticated_decryption()
10921 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_decryption()
10925 process_cpu_aead_op(ts_params->valid_devs[0], ut_params->op); in test_authenticated_decryption()
10928 ut_params->op, 0, 0, 0, 0); in test_authenticated_decryption()
10932 ut_params->op), "failed to process sym crypto op"); in test_authenticated_decryption()
10934 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_decryption()
10937 if (ut_params->op->sym->m_dst) in test_authenticated_decryption()
10938 plaintext = rte_pktmbuf_mtod(ut_params->op->sym->m_dst, in test_authenticated_decryption()
10941 plaintext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_src, in test_authenticated_decryption()
10943 ut_params->op->sym->cipher.data.offset); in test_authenticated_decryption()
10954 TEST_ASSERT_EQUAL(ut_params->op->status, in test_authenticated_decryption()
11209 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_encryption_oop() local
11245 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption_oop()
11246 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption_oop()
11249 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_encryption_oop()
11250 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_encryption_oop()
11251 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_authenticated_encryption_oop()
11252 rte_pktmbuf_tailroom(ut_params->obuf)); in test_authenticated_encryption_oop()
11259 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_authenticated_encryption_oop()
11261 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_encryption_oop()
11262 ut_params->op->sym->m_dst = ut_params->obuf; in test_authenticated_encryption_oop()
11267 ut_params->op, 0, 0, 0, 0); in test_authenticated_encryption_oop()
11270 ut_params->op), "failed to process sym crypto op"); in test_authenticated_encryption_oop()
11272 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_encryption_oop()
11277 ciphertext = rte_pktmbuf_mtod_offset(ut_params->obuf, uint8_t *, in test_authenticated_encryption_oop()
11278 ut_params->op->sym->cipher.data.offset); in test_authenticated_encryption_oop()
11311 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_decryption_oop() local
11350 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decryption_oop()
11351 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decryption_oop()
11353 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_decryption_oop()
11354 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_decryption_oop()
11355 memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0, in test_authenticated_decryption_oop()
11356 rte_pktmbuf_tailroom(ut_params->obuf)); in test_authenticated_decryption_oop()
11363 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_authenticated_decryption_oop()
11365 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_decryption_oop()
11366 ut_params->op->sym->m_dst = ut_params->obuf; in test_authenticated_decryption_oop()
11371 ut_params->op, 0, 0, 0, 0); in test_authenticated_decryption_oop()
11374 ut_params->op), "failed to process sym crypto op"); in test_authenticated_decryption_oop()
11376 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_decryption_oop()
11379 plaintext = rte_pktmbuf_mtod_offset(ut_params->obuf, uint8_t *, in test_authenticated_decryption_oop()
11380 ut_params->op->sym->cipher.data.offset); in test_authenticated_decryption_oop()
11391 TEST_ASSERT_EQUAL(ut_params->op->status, in test_authenticated_decryption_oop()
11408 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_encryption_sessionless() local
11436 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption_sessionless()
11439 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_encryption_sessionless()
11440 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_encryption_sessionless()
11449 retval = create_aead_xform(ut_params->op, in test_authenticated_encryption_sessionless()
11458 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_encryption_sessionless()
11460 TEST_ASSERT_EQUAL(ut_params->op->sess_type, in test_authenticated_encryption_sessionless()
11466 ut_params->op), "failed to process sym crypto op"); in test_authenticated_encryption_sessionless()
11468 TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process"); in test_authenticated_encryption_sessionless()
11470 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_encryption_sessionless()
11475 ciphertext = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *, in test_authenticated_encryption_sessionless()
11476 ut_params->op->sym->cipher.data.offset); in test_authenticated_encryption_sessionless()
11511 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_decryption_sessionless() local
11545 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decryption_sessionless()
11547 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_decryption_sessionless()
11548 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_decryption_sessionless()
11557 retval = create_aead_xform(ut_params->op, in test_authenticated_decryption_sessionless()
11566 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_decryption_sessionless()
11568 TEST_ASSERT_EQUAL(ut_params->op->sess_type, in test_authenticated_decryption_sessionless()
11575 ut_params->op, 0, 0, 0, 0); in test_authenticated_decryption_sessionless()
11578 ts_params->valid_devs[0], ut_params->op), in test_authenticated_decryption_sessionless()
11581 TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process"); in test_authenticated_decryption_sessionless()
11583 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_decryption_sessionless()
11586 plaintext = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *, in test_authenticated_decryption_sessionless()
11587 ut_params->op->sym->cipher.data.offset); in test_authenticated_decryption_sessionless()
11598 TEST_ASSERT_EQUAL(ut_params->op->status, in test_authenticated_decryption_sessionless()
11788 struct crypto_unittest_params *ut_params, in MD5_HMAC_create_session() argument
11797 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in MD5_HMAC_create_session()
11798 ut_params->auth_xform.next = NULL; in MD5_HMAC_create_session()
11799 ut_params->auth_xform.auth.op = op; in MD5_HMAC_create_session()
11801 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_MD5_HMAC; in MD5_HMAC_create_session()
11803 ut_params->auth_xform.auth.digest_length = MD5_DIGEST_LEN; in MD5_HMAC_create_session()
11804 ut_params->auth_xform.auth.key.length = test_case->key.len; in MD5_HMAC_create_session()
11805 ut_params->auth_xform.auth.key.data = key; in MD5_HMAC_create_session()
11807 ut_params->sess = rte_cryptodev_sym_session_create( in MD5_HMAC_create_session()
11809 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in MD5_HMAC_create_session()
11810 if (ut_params->sess == NULL) in MD5_HMAC_create_session()
11814 ut_params->sess, &ut_params->auth_xform, in MD5_HMAC_create_session()
11819 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in MD5_HMAC_create_session()
11821 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in MD5_HMAC_create_session()
11822 rte_pktmbuf_tailroom(ut_params->ibuf)); in MD5_HMAC_create_session()
11827 static int MD5_HMAC_create_op(struct crypto_unittest_params *ut_params, in MD5_HMAC_create_op() argument
11833 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in MD5_HMAC_create_op()
11838 *plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in MD5_HMAC_create_op()
11844 ut_params->ibuf, MD5_DIGEST_LEN); in MD5_HMAC_create_op()
11848 ut_params->ibuf, plaintext_pad_len); in MD5_HMAC_create_op()
11850 if (ut_params->auth_xform.auth.op == RTE_CRYPTO_AUTH_OP_VERIFY) { in MD5_HMAC_create_op()
11858 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in MD5_HMAC_create_op()
11859 ut_params->op->sym->m_src = ut_params->ibuf; in MD5_HMAC_create_op()
11871 struct crypto_unittest_params *ut_params = &unittest_params; in test_MD5_HMAC_generate() local
11891 if (MD5_HMAC_create_session(ts_params, ut_params, in test_MD5_HMAC_generate()
11896 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_MD5_HMAC_generate()
11898 TEST_ASSERT_NOT_NULL(ut_params->op, in test_MD5_HMAC_generate()
11904 if (MD5_HMAC_create_op(ut_params, test_case, &plaintext)) in test_MD5_HMAC_generate()
11909 ut_params->op); in test_MD5_HMAC_generate()
11912 ut_params->op, 0, 1, 0, 0); in test_MD5_HMAC_generate()
11916 ut_params->op), in test_MD5_HMAC_generate()
11919 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_MD5_HMAC_generate()
11922 if (ut_params->op->sym->m_dst) { in test_MD5_HMAC_generate()
11923 auth_tag = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_dst, in test_MD5_HMAC_generate()
11944 struct crypto_unittest_params *ut_params = &unittest_params; in test_MD5_HMAC_verify() local
11964 if (MD5_HMAC_create_session(ts_params, ut_params, in test_MD5_HMAC_verify()
11970 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in test_MD5_HMAC_verify()
11972 TEST_ASSERT_NOT_NULL(ut_params->op, in test_MD5_HMAC_verify()
11975 if (MD5_HMAC_create_op(ut_params, test_case, &plaintext)) in test_MD5_HMAC_verify()
11980 ut_params->op); in test_MD5_HMAC_verify()
11983 ut_params->op, 0, 1, 0, 0); in test_MD5_HMAC_verify()
11987 ut_params->op), in test_MD5_HMAC_verify()
11990 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_MD5_HMAC_verify()
12024 struct crypto_unittest_params *ut_params = &unittest_params; in test_multi_session() local
12045 test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(ut_params, in test_multi_session()
12066 sessions[i], &ut_params->auth_xform, in test_multi_session()
12074 ut_params, in test_multi_session()
12081 if (ut_params->op) in test_multi_session()
12082 rte_crypto_op_free(ut_params->op); in test_multi_session()
12089 if (ut_params->obuf) { in test_multi_session()
12090 rte_pktmbuf_free(ut_params->obuf); in test_multi_session()
12091 if (ut_params->ibuf == ut_params->obuf) in test_multi_session()
12092 ut_params->ibuf = 0; in test_multi_session()
12093 ut_params->obuf = 0; in test_multi_session()
12095 if (ut_params->ibuf) { in test_multi_session()
12096 rte_pktmbuf_free(ut_params->ibuf); in test_multi_session()
12097 ut_params->ibuf = 0; in test_multi_session()
12104 sessions[i], &ut_params->auth_xform, in test_multi_session()
12121 struct crypto_unittest_params ut_params; member
12191 rte_memcpy(&ut_paramz[i].ut_params, &unittest_params, in test_multi_session_random_usage()
12195 &ut_paramz[i].ut_params, in test_multi_session_random_usage()
12202 &ut_paramz[i].ut_params.auth_xform, in test_multi_session_random_usage()
12219 &ut_paramz[j].ut_params, in test_multi_session_random_usage()
12225 if (ut_paramz[j].ut_params.op) in test_multi_session_random_usage()
12226 rte_crypto_op_free(ut_paramz[j].ut_params.op); in test_multi_session_random_usage()
12233 if (ut_paramz[j].ut_params.obuf) { in test_multi_session_random_usage()
12234 rte_pktmbuf_free(ut_paramz[j].ut_params.obuf); in test_multi_session_random_usage()
12235 if (ut_paramz[j].ut_params.ibuf in test_multi_session_random_usage()
12236 == ut_paramz[j].ut_params.obuf) in test_multi_session_random_usage()
12237 ut_paramz[j].ut_params.ibuf = 0; in test_multi_session_random_usage()
12238 ut_paramz[j].ut_params.obuf = 0; in test_multi_session_random_usage()
12240 if (ut_paramz[j].ut_params.ibuf) { in test_multi_session_random_usage()
12241 rte_pktmbuf_free(ut_paramz[j].ut_params.ibuf); in test_multi_session_random_usage()
12242 ut_paramz[j].ut_params.ibuf = 0; in test_multi_session_random_usage()
12266 struct crypto_unittest_params *ut_params = &unittest_params; in test_null_invalid_operation() local
12275 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_null_invalid_operation()
12276 ut_params->cipher_xform.next = NULL; in test_null_invalid_operation()
12278 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC; in test_null_invalid_operation()
12279 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; in test_null_invalid_operation()
12281 ut_params->sess = rte_cryptodev_sym_session_create( in test_null_invalid_operation()
12286 ut_params->sess, &ut_params->cipher_xform, in test_null_invalid_operation()
12293 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_null_invalid_operation()
12294 ut_params->auth_xform.next = NULL; in test_null_invalid_operation()
12296 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC; in test_null_invalid_operation()
12297 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; in test_null_invalid_operation()
12299 ut_params->sess = rte_cryptodev_sym_session_create( in test_null_invalid_operation()
12304 ut_params->sess, &ut_params->auth_xform, in test_null_invalid_operation()
12319 struct crypto_unittest_params *ut_params = &unittest_params; in test_null_burst_operation() local
12333 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_null_burst_operation()
12334 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_null_burst_operation()
12336 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL; in test_null_burst_operation()
12337 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; in test_null_burst_operation()
12340 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_null_burst_operation()
12341 ut_params->auth_xform.next = NULL; in test_null_burst_operation()
12343 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_NULL; in test_null_burst_operation()
12344 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; in test_null_burst_operation()
12346 ut_params->sess = rte_cryptodev_sym_session_create( in test_null_burst_operation()
12348 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in test_null_burst_operation()
12352 ut_params->sess, &ut_params->cipher_xform, in test_null_burst_operation()
12374 rte_crypto_op_attach_sym_session(burst[i], ut_params->sess); in test_null_burst_operation()
12659 struct crypto_unittest_params *ut_params = &unittest_params; in create_gmac_operation() local
12665 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_gmac_operation()
12667 TEST_ASSERT_NOT_NULL(ut_params->op, in create_gmac_operation()
12670 sym_op = ut_params->op->sym; in create_gmac_operation()
12673 ut_params->ibuf, tdata->gmac_tag.len); in create_gmac_operation()
12678 ut_params->ibuf, plaintext_pad_len); in create_gmac_operation()
12688 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_gmac_operation()
12710 struct crypto_unittest_params *ut_params = &unittest_params; in create_gmac_operation_sgl() local
12714 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_gmac_operation_sgl()
12716 TEST_ASSERT_NOT_NULL(ut_params->op, in create_gmac_operation_sgl()
12719 sym_op = ut_params->op->sym; in create_gmac_operation_sgl()
12735 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_gmac_operation_sgl()
12759 struct crypto_unittest_params *ut_params = &unittest_params; in create_gmac_session() local
12763 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_gmac_session()
12764 ut_params->auth_xform.next = NULL; in create_gmac_session()
12766 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_AES_GMAC; in create_gmac_session()
12767 ut_params->auth_xform.auth.op = auth_op; in create_gmac_session()
12768 ut_params->auth_xform.auth.digest_length = tdata->gmac_tag.len; in create_gmac_session()
12769 ut_params->auth_xform.auth.key.length = tdata->key.len; in create_gmac_session()
12770 ut_params->auth_xform.auth.key.data = auth_key; in create_gmac_session()
12771 ut_params->auth_xform.auth.iv.offset = IV_OFFSET; in create_gmac_session()
12772 ut_params->auth_xform.auth.iv.length = tdata->iv.len; in create_gmac_session()
12775 ut_params->sess = rte_cryptodev_sym_session_create( in create_gmac_session()
12777 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_gmac_session()
12779 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_gmac_session()
12780 &ut_params->auth_xform, in create_gmac_session()
12790 struct crypto_unittest_params *ut_params = &unittest_params; in test_AES_GMAC_authentication() local
12827 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool); in test_AES_GMAC_authentication()
12829 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_AES_GMAC_authentication()
12830 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_AES_GMAC_authentication()
12833 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_AES_GMAC_authentication()
12834 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_AES_GMAC_authentication()
12845 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_GMAC_authentication()
12859 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_AES_GMAC_authentication()
12861 ut_params->op->sym->m_src = ut_params->ibuf; in test_AES_GMAC_authentication()
12865 ut_params->op); in test_AES_GMAC_authentication()
12868 ut_params->op, 0, 1, 0, 0); in test_AES_GMAC_authentication()
12872 ut_params->op), "failed to process sym crypto op"); in test_AES_GMAC_authentication()
12874 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_GMAC_authentication()
12877 if (ut_params->op->sym->m_dst) { in test_AES_GMAC_authentication()
12878 auth_tag = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_dst, in test_AES_GMAC_authentication()
12923 struct crypto_unittest_params *ut_params = &unittest_params; in test_AES_GMAC_authentication_verify() local
12958 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool); in test_AES_GMAC_authentication_verify()
12960 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_AES_GMAC_authentication_verify()
12961 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_AES_GMAC_authentication_verify()
12964 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_AES_GMAC_authentication_verify()
12965 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_AES_GMAC_authentication_verify()
12977 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_GMAC_authentication_verify()
12991 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_AES_GMAC_authentication_verify()
12993 ut_params->op->sym->m_src = ut_params->ibuf; in test_AES_GMAC_authentication_verify()
12997 ut_params->op); in test_AES_GMAC_authentication_verify()
13000 ut_params->op, 0, 1, 0, 0); in test_AES_GMAC_authentication_verify()
13004 ut_params->op), "failed to process sym crypto op"); in test_AES_GMAC_authentication_verify()
13006 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_GMAC_authentication_verify()
13042 struct crypto_unittest_params *ut_params = &unittest_params; in test_AES_GMAC_authentication_SGL() local
13086 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_AES_GMAC_authentication_SGL()
13087 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_AES_GMAC_authentication_SGL()
13090 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_AES_GMAC_authentication_SGL()
13091 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_AES_GMAC_authentication_SGL()
13093 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_GMAC_authentication_SGL()
13101 buf = ut_params->ibuf; in test_AES_GMAC_authentication_SGL()
13128 ut_params->ibuf->nb_segs = segs; in test_AES_GMAC_authentication_SGL()
13136 digest_mem = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_AES_GMAC_authentication_SGL()
13138 digest_phys = rte_pktmbuf_iova_offset(ut_params->ibuf, in test_AES_GMAC_authentication_SGL()
13148 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_AES_GMAC_authentication_SGL()
13150 ut_params->op->sym->m_src = ut_params->ibuf; in test_AES_GMAC_authentication_SGL()
13157 ut_params->op), "failed to process sym crypto op"); in test_AES_GMAC_authentication_SGL()
13159 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_AES_GMAC_authentication_SGL()
13405 create_auth_session(struct crypto_unittest_params *ut_params, in create_auth_session() argument
13417 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_auth_session()
13418 ut_params->auth_xform.auth.op = auth_op; in create_auth_session()
13419 ut_params->auth_xform.next = NULL; in create_auth_session()
13420 ut_params->auth_xform.auth.algo = reference->auth_algo; in create_auth_session()
13421 ut_params->auth_xform.auth.key.length = reference->auth_key.len; in create_auth_session()
13422 ut_params->auth_xform.auth.key.data = auth_key; in create_auth_session()
13423 ut_params->auth_xform.auth.digest_length = reference->digest.len; in create_auth_session()
13426 ut_params->sess = rte_cryptodev_sym_session_create( in create_auth_session()
13428 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_auth_session()
13430 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_auth_session()
13431 &ut_params->auth_xform, in create_auth_session()
13438 create_auth_cipher_session(struct crypto_unittest_params *ut_params, in create_auth_cipher_session() argument
13454 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in create_auth_cipher_session()
13455 ut_params->auth_xform.auth.op = auth_op; in create_auth_cipher_session()
13456 ut_params->auth_xform.auth.algo = reference->auth_algo; in create_auth_cipher_session()
13457 ut_params->auth_xform.auth.key.length = reference->auth_key.len; in create_auth_cipher_session()
13458 ut_params->auth_xform.auth.key.data = auth_key; in create_auth_cipher_session()
13459 ut_params->auth_xform.auth.digest_length = reference->digest.len; in create_auth_cipher_session()
13462 ut_params->auth_xform.auth.iv.offset = IV_OFFSET; in create_auth_cipher_session()
13463 ut_params->auth_xform.auth.iv.length = reference->iv.len; in create_auth_cipher_session()
13465 ut_params->auth_xform.next = &ut_params->cipher_xform; in create_auth_cipher_session()
13468 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in create_auth_cipher_session()
13469 ut_params->cipher_xform.next = NULL; in create_auth_cipher_session()
13470 ut_params->cipher_xform.cipher.algo = reference->crypto_algo; in create_auth_cipher_session()
13471 ut_params->cipher_xform.cipher.op = cipher_op; in create_auth_cipher_session()
13472 ut_params->cipher_xform.cipher.key.data = cipher_key; in create_auth_cipher_session()
13473 ut_params->cipher_xform.cipher.key.length = reference->cipher_key.len; in create_auth_cipher_session()
13474 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in create_auth_cipher_session()
13475 ut_params->cipher_xform.cipher.iv.length = reference->iv.len; in create_auth_cipher_session()
13479 ut_params->sess = rte_cryptodev_sym_session_create( in create_auth_cipher_session()
13481 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in create_auth_cipher_session()
13483 status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, in create_auth_cipher_session()
13484 &ut_params->auth_xform, in create_auth_cipher_session()
13492 struct crypto_unittest_params *ut_params, in create_auth_operation() argument
13497 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_auth_operation()
13499 TEST_ASSERT_NOT_NULL(ut_params->op, in create_auth_operation()
13503 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_auth_operation()
13505 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_auth_operation()
13508 sym_op->m_src = ut_params->ibuf; in create_auth_operation()
13512 ut_params->ibuf, reference->digest.len); in create_auth_operation()
13518 ut_params->ibuf, reference->plaintext.len); in create_auth_operation()
13539 struct crypto_unittest_params *ut_params, in create_auth_GMAC_operation() argument
13544 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_auth_GMAC_operation()
13546 TEST_ASSERT_NOT_NULL(ut_params->op, in create_auth_GMAC_operation()
13550 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_auth_GMAC_operation()
13552 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_auth_GMAC_operation()
13555 sym_op->m_src = ut_params->ibuf; in create_auth_GMAC_operation()
13559 ut_params->ibuf, reference->digest.len); in create_auth_GMAC_operation()
13565 ut_params->ibuf, reference->ciphertext.len); in create_auth_GMAC_operation()
13578 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in create_auth_GMAC_operation()
13592 struct crypto_unittest_params *ut_params, in create_cipher_auth_operation() argument
13597 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_cipher_auth_operation()
13599 TEST_ASSERT_NOT_NULL(ut_params->op, in create_cipher_auth_operation()
13603 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in create_cipher_auth_operation()
13605 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_cipher_auth_operation()
13608 sym_op->m_src = ut_params->ibuf; in create_cipher_auth_operation()
13612 ut_params->ibuf, reference->digest.len); in create_cipher_auth_operation()
13618 ut_params->ibuf, reference->ciphertext.len); in create_cipher_auth_operation()
13631 rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET), in create_cipher_auth_operation()
13645 struct crypto_unittest_params *ut_params, in create_auth_verify_operation() argument
13648 return create_auth_operation(ts_params, ut_params, reference, 0); in create_auth_verify_operation()
13654 struct crypto_unittest_params *ut_params, in create_auth_verify_GMAC_operation() argument
13657 return create_auth_GMAC_operation(ts_params, ut_params, reference, 0); in create_auth_verify_GMAC_operation()
13662 struct crypto_unittest_params *ut_params, in create_cipher_auth_verify_operation() argument
13665 return create_cipher_auth_operation(ts_params, ut_params, reference, 0); in create_cipher_auth_verify_operation()
13671 struct crypto_unittest_params *ut_params, in test_authentication_verify_fail_when_data_corruption() argument
13699 retval = create_auth_session(ut_params, in test_authentication_verify_fail_when_data_corruption()
13709 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authentication_verify_fail_when_data_corruption()
13710 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_authentication_verify_fail_when_data_corruption()
13714 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authentication_verify_fail_when_data_corruption()
13715 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authentication_verify_fail_when_data_corruption()
13717 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authentication_verify_fail_when_data_corruption()
13726 retval = create_auth_verify_operation(ts_params, ut_params, reference); in test_authentication_verify_fail_when_data_corruption()
13738 ut_params->op); in test_authentication_verify_fail_when_data_corruption()
13739 TEST_ASSERT_NOT_EQUAL(ut_params->op->status, in test_authentication_verify_fail_when_data_corruption()
13744 ut_params->op, 0, 1, 0, 0); in test_authentication_verify_fail_when_data_corruption()
13746 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_authentication_verify_fail_when_data_corruption()
13747 ut_params->op); in test_authentication_verify_fail_when_data_corruption()
13749 if (ut_params->op == NULL) in test_authentication_verify_fail_when_data_corruption()
13751 else if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) in test_authentication_verify_fail_when_data_corruption()
13760 struct crypto_unittest_params *ut_params, in test_authentication_verify_GMAC_fail_when_corruption() argument
13786 retval = create_auth_cipher_session(ut_params, in test_authentication_verify_GMAC_fail_when_corruption()
13794 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authentication_verify_GMAC_fail_when_corruption()
13795 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_authentication_verify_GMAC_fail_when_corruption()
13799 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authentication_verify_GMAC_fail_when_corruption()
13800 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authentication_verify_GMAC_fail_when_corruption()
13802 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authentication_verify_GMAC_fail_when_corruption()
13812 ut_params, in test_authentication_verify_GMAC_fail_when_corruption()
13825 ut_params->op); in test_authentication_verify_GMAC_fail_when_corruption()
13826 TEST_ASSERT_NOT_EQUAL(ut_params->op->status, in test_authentication_verify_GMAC_fail_when_corruption()
13831 ut_params->op, 0, 1, 0, 0); in test_authentication_verify_GMAC_fail_when_corruption()
13833 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_authentication_verify_GMAC_fail_when_corruption()
13834 ut_params->op); in test_authentication_verify_GMAC_fail_when_corruption()
13835 TEST_ASSERT_NULL(ut_params->op, "authentication not failed"); in test_authentication_verify_GMAC_fail_when_corruption()
13844 struct crypto_unittest_params *ut_params, in test_authenticated_decryption_fail_when_corruption() argument
13876 retval = create_auth_cipher_session(ut_params, in test_authenticated_decryption_fail_when_corruption()
13887 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decryption_fail_when_corruption()
13888 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_authenticated_decryption_fail_when_corruption()
13892 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_decryption_fail_when_corruption()
13893 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_decryption_fail_when_corruption()
13895 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authenticated_decryption_fail_when_corruption()
13903 ut_params, in test_authenticated_decryption_fail_when_corruption()
13916 ut_params->op); in test_authenticated_decryption_fail_when_corruption()
13917 TEST_ASSERT_NOT_EQUAL(ut_params->op->status, in test_authenticated_decryption_fail_when_corruption()
13922 ut_params->op, 1, 1, 0, 0); in test_authenticated_decryption_fail_when_corruption()
13924 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_authenticated_decryption_fail_when_corruption()
13925 ut_params->op); in test_authenticated_decryption_fail_when_corruption()
13926 TEST_ASSERT_NULL(ut_params->op, "authentication not failed"); in test_authenticated_decryption_fail_when_corruption()
13935 struct crypto_unittest_params *ut_params, in test_authenticated_encrypt_with_esn() argument
13975 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_authenticated_encrypt_with_esn()
13976 ut_params->cipher_xform.cipher.algo = reference->crypto_algo; in test_authenticated_encrypt_with_esn()
13977 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; in test_authenticated_encrypt_with_esn()
13978 ut_params->cipher_xform.cipher.key.data = cipher_key; in test_authenticated_encrypt_with_esn()
13979 ut_params->cipher_xform.cipher.key.length = reference->cipher_key.len; in test_authenticated_encrypt_with_esn()
13980 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_authenticated_encrypt_with_esn()
13981 ut_params->cipher_xform.cipher.iv.length = reference->iv.len; in test_authenticated_encrypt_with_esn()
13983 ut_params->cipher_xform.next = &ut_params->auth_xform; in test_authenticated_encrypt_with_esn()
13986 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_authenticated_encrypt_with_esn()
13987 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; in test_authenticated_encrypt_with_esn()
13988 ut_params->auth_xform.auth.algo = reference->auth_algo; in test_authenticated_encrypt_with_esn()
13989 ut_params->auth_xform.auth.key.length = reference->auth_key.len; in test_authenticated_encrypt_with_esn()
13990 ut_params->auth_xform.auth.key.data = auth_key; in test_authenticated_encrypt_with_esn()
13991 ut_params->auth_xform.auth.digest_length = reference->digest.len; in test_authenticated_encrypt_with_esn()
13992 ut_params->auth_xform.next = NULL; in test_authenticated_encrypt_with_esn()
13995 ut_params->sess = rte_cryptodev_sym_session_create( in test_authenticated_encrypt_with_esn()
13997 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in test_authenticated_encrypt_with_esn()
14000 ut_params->sess, in test_authenticated_encrypt_with_esn()
14001 &ut_params->cipher_xform, in test_authenticated_encrypt_with_esn()
14009 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encrypt_with_esn()
14010 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_authenticated_encrypt_with_esn()
14014 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_encrypt_with_esn()
14015 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_encrypt_with_esn()
14017 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authenticated_encrypt_with_esn()
14024 ut_params, in test_authenticated_encrypt_with_esn()
14032 ut_params->op); in test_authenticated_encrypt_with_esn()
14035 ut_params->op, 1, 1, 0, 0); in test_authenticated_encrypt_with_esn()
14037 ut_params->op = process_crypto_request( in test_authenticated_encrypt_with_esn()
14038 ts_params->valid_devs[0], ut_params->op); in test_authenticated_encrypt_with_esn()
14040 TEST_ASSERT_NOT_NULL(ut_params->op, "no crypto operation returned"); in test_authenticated_encrypt_with_esn()
14042 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_encrypt_with_esn()
14047 authciphertext = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *, in test_authenticated_encrypt_with_esn()
14048 ut_params->op->sym->auth.data.offset); in test_authenticated_encrypt_with_esn()
14074 struct crypto_unittest_params *ut_params, in test_authenticated_decrypt_with_esn() argument
14112 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; in test_authenticated_decrypt_with_esn()
14113 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY; in test_authenticated_decrypt_with_esn()
14114 ut_params->auth_xform.auth.algo = reference->auth_algo; in test_authenticated_decrypt_with_esn()
14115 ut_params->auth_xform.auth.key.length = reference->auth_key.len; in test_authenticated_decrypt_with_esn()
14116 ut_params->auth_xform.auth.key.data = auth_key; in test_authenticated_decrypt_with_esn()
14117 ut_params->auth_xform.auth.digest_length = reference->digest.len; in test_authenticated_decrypt_with_esn()
14118 ut_params->auth_xform.next = &ut_params->cipher_xform; in test_authenticated_decrypt_with_esn()
14121 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; in test_authenticated_decrypt_with_esn()
14122 ut_params->cipher_xform.next = NULL; in test_authenticated_decrypt_with_esn()
14123 ut_params->cipher_xform.cipher.algo = reference->crypto_algo; in test_authenticated_decrypt_with_esn()
14124 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT; in test_authenticated_decrypt_with_esn()
14125 ut_params->cipher_xform.cipher.key.data = cipher_key; in test_authenticated_decrypt_with_esn()
14126 ut_params->cipher_xform.cipher.key.length = reference->cipher_key.len; in test_authenticated_decrypt_with_esn()
14127 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; in test_authenticated_decrypt_with_esn()
14128 ut_params->cipher_xform.cipher.iv.length = reference->iv.len; in test_authenticated_decrypt_with_esn()
14131 ut_params->sess = rte_cryptodev_sym_session_create( in test_authenticated_decrypt_with_esn()
14133 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); in test_authenticated_decrypt_with_esn()
14136 ut_params->sess, in test_authenticated_decrypt_with_esn()
14137 &ut_params->auth_xform, in test_authenticated_decrypt_with_esn()
14145 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_decrypt_with_esn()
14146 TEST_ASSERT_NOT_NULL(ut_params->ibuf, in test_authenticated_decrypt_with_esn()
14150 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_decrypt_with_esn()
14151 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_decrypt_with_esn()
14153 ciphertext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authenticated_decrypt_with_esn()
14161 ut_params, in test_authenticated_decrypt_with_esn()
14169 ut_params->op); in test_authenticated_decrypt_with_esn()
14172 ut_params->op, 1, 1, 0, 0); in test_authenticated_decrypt_with_esn()
14174 ut_params->op = process_crypto_request(ts_params->valid_devs[0], in test_authenticated_decrypt_with_esn()
14175 ut_params->op); in test_authenticated_decrypt_with_esn()
14177 TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process"); in test_authenticated_decrypt_with_esn()
14178 TEST_ASSERT_EQUAL(ut_params->op->status, in test_authenticated_decrypt_with_esn()
14182 ut_params->obuf = ut_params->op->sym->m_src; in test_authenticated_decrypt_with_esn()
14183 TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf"); in test_authenticated_decrypt_with_esn()
14194 struct crypto_unittest_params *ut_params = &unittest_params; in create_aead_operation_SGL() local
14202 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, in create_aead_operation_SGL()
14204 TEST_ASSERT_NOT_NULL(ut_params->op, in create_aead_operation_SGL()
14207 struct rte_crypto_sym_op *sym_op = ut_params->op->sym; in create_aead_operation_SGL()
14226 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_aead_operation_SGL()
14235 ut_params->ibuf, aad_len); in create_aead_operation_SGL()
14239 ut_params->ibuf); in create_aead_operation_SGL()
14249 uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ut_params->op, in create_aead_operation_SGL()
14257 ut_params->ibuf, aad_len_pad); in create_aead_operation_SGL()
14261 ut_params->ibuf); in create_aead_operation_SGL()
14284 struct crypto_unittest_params *ut_params = &unittest_params; in test_authenticated_encryption_SGL() local
14369 ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption_SGL()
14370 rte_pktmbuf_append(ut_params->obuf, in test_authenticated_encryption_SGL()
14372 buf_oop = ut_params->obuf; in test_authenticated_encryption_SGL()
14385 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); in test_authenticated_encryption_SGL()
14388 memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, in test_authenticated_encryption_SGL()
14389 rte_pktmbuf_tailroom(ut_params->ibuf)); in test_authenticated_encryption_SGL()
14391 plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authenticated_encryption_SGL()
14398 buf = ut_params->ibuf; in test_authenticated_encryption_SGL()
14446 ut_params->ibuf->nb_segs = segs; in test_authenticated_encryption_SGL()
14454 digest_mem = rte_pktmbuf_append(ut_params->obuf, in test_authenticated_encryption_SGL()
14458 ut_params->obuf, in test_authenticated_encryption_SGL()
14488 ut_params->obuf->nb_segs = segs; in test_authenticated_encryption_SGL()
14500 digest_mem = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, in test_authenticated_encryption_SGL()
14502 digest_phys = rte_pktmbuf_iova_offset(ut_params->ibuf, in test_authenticated_encryption_SGL()
14513 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); in test_authenticated_encryption_SGL()
14515 ut_params->op->sym->m_src = ut_params->ibuf; in test_authenticated_encryption_SGL()
14517 ut_params->op->sym->m_dst = ut_params->obuf; in test_authenticated_encryption_SGL()
14522 process_cpu_aead_op(ts_params->valid_devs[0], ut_params->op); in test_authenticated_encryption_SGL()
14525 ut_params->op, 0, 0, 0, 0); in test_authenticated_encryption_SGL()
14529 ut_params->op), "failed to process sym crypto op"); in test_authenticated_encryption_SGL()
14531 TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, in test_authenticated_encryption_SGL()
14535 ciphertext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_src, in test_authenticated_encryption_SGL()
14538 ciphertext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_dst, in test_authenticated_encryption_SGL()
14551 buf = ut_params->op->sym->m_src->next; in test_authenticated_encryption_SGL()
14553 buf = ut_params->op->sym->m_dst->next; in test_authenticated_encryption_SGL()
14619 struct crypto_unittest_params *ut_params, in test_authentication_verify_fail_when_data_corrupted() argument
14623 ts_params, ut_params, reference, 1); in test_authentication_verify_fail_when_data_corrupted()
14629 struct crypto_unittest_params *ut_params, in test_authentication_verify_fail_when_tag_corrupted() argument
14633 ts_params, ut_params, reference, 0); in test_authentication_verify_fail_when_tag_corrupted()
14639 struct crypto_unittest_params *ut_params, in test_authentication_verify_GMAC_fail_when_data_corrupted() argument
14643 ts_params, ut_params, reference, 1); in test_authentication_verify_GMAC_fail_when_data_corrupted()
14649 struct crypto_unittest_params *ut_params, in test_authentication_verify_GMAC_fail_when_tag_corrupted() argument
14653 ts_params, ut_params, reference, 0); in test_authentication_verify_GMAC_fail_when_tag_corrupted()
14659 struct crypto_unittest_params *ut_params, in test_authenticated_decryption_fail_when_data_corrupted() argument
14663 ts_params, ut_params, reference, 1); in test_authenticated_decryption_fail_when_data_corrupted()
14669 struct crypto_unittest_params *ut_params, in test_authenticated_decryption_fail_when_tag_corrupted() argument
14673 ts_params, ut_params, reference, 0); in test_authenticated_decryption_fail_when_tag_corrupted()