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

Function test_PDCP_PROTO_short_mac

dpdk/app/test/test_cryptodev.c:9782–9824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9780}
9781
9782static int
9783test_PDCP_PROTO_short_mac(void)
9784{
9785 int i = 0, size = 0;
9786 int err, all_err = TEST_SUCCESS;
9787 const struct pdcp_short_mac_test *cur_test;
9788
9789 size = RTE_DIM(list_pdcp_smac_tests);
9790
9791 for (i = 0; i < size; i++) {
9792 cur_test = &list_pdcp_smac_tests[i];
9793 err = test_pdcp_proto(
9794 i, 0, RTE_CRYPTO_CIPHER_OP_ENCRYPT,
9795 RTE_CRYPTO_AUTH_OP_GENERATE, cur_test->data_in,
9796 cur_test->in_len, cur_test->data_out,
9797 cur_test->in_len + ((cur_test->auth_key) ? 4 : 0),
9798 RTE_CRYPTO_CIPHER_NULL, NULL,
9799 0, cur_test->param.auth_alg,
9800 cur_test->auth_key, cur_test->param.auth_key_len,
9801 0, cur_test->param.domain, 0, 0,
9802 0, 0, 0);
9803 if (err) {
9804 printf("\t%d) %s: Short MAC test failed\n",
9805 cur_test->test_idx,
9806 cur_test->param.name);
9807 err = TEST_FAILED;
9808 } else {
9809 printf("\t%d) %s: Short MAC test PASS\n",
9810 cur_test->test_idx,
9811 cur_test->param.name);
9812 rte_hexdump(stdout, "MAC I",
9813 cur_test->data_out + cur_test->in_len + 2,
9814 2);
9815 err = TEST_SUCCESS;
9816 }
9817 all_err += err;
9818 }
9819
9820 printf("Success: %d, Failure: %d\n", size + all_err, -all_err);
9821
9822 return (all_err == TEST_SUCCESS) ? TEST_SUCCESS : TEST_FAILED;
9823
9824}
9825
9826static int
9827test_PDCP_SDAP_PROTO_decap_all(void)

Callers 1

test_PDCP_PROTO_allFunction · 0.85

Calls 3

test_pdcp_protoFunction · 0.85
rte_hexdumpFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected