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

Function create_wireless_algo_cipher_session

dpdk/app/test/test_cryptodev.c:2574–2609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2572}
2573
2574static int
2575create_wireless_algo_cipher_session(uint8_t dev_id,
2576 enum rte_crypto_cipher_operation op,
2577 enum rte_crypto_cipher_algorithm algo,
2578 const uint8_t *key, const uint8_t key_len,
2579 uint8_t iv_len)
2580{
2581 uint8_t cipher_key[key_len];
2582 struct crypto_testsuite_params *ts_params = &testsuite_params;
2583 struct crypto_unittest_params *ut_params = &unittest_params;
2584
2585 memcpy(cipher_key, key, key_len);
2586
2587 /* Setup Cipher Parameters */
2588 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
2589 ut_params->cipher_xform.next = NULL;
2590
2591 ut_params->cipher_xform.cipher.algo = algo;
2592 ut_params->cipher_xform.cipher.op = op;
2593 ut_params->cipher_xform.cipher.key.data = cipher_key;
2594 ut_params->cipher_xform.cipher.key.length = key_len;
2595 ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET;
2596 ut_params->cipher_xform.cipher.iv.length = iv_len;
2597
2598 debug_hexdump(stdout, "key:", key, key_len);
2599
2600 /* Create Crypto session */
2601 ut_params->sess = rte_cryptodev_sym_session_create(dev_id,
2602 &ut_params->cipher_xform, ts_params->session_mpool);
2603
2604 if (ut_params->sess == NULL && rte_errno == ENOTSUP)
2605 return TEST_SKIPPED;
2606
2607 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
2608 return 0;
2609}
2610
2611static int
2612create_wireless_algo_cipher_operation(const uint8_t *iv, uint8_t iv_len,

Calls 3

debug_hexdumpFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected