| 12992 | } |
| 12993 | |
| 12994 | static int MD5_HMAC_create_op(struct crypto_unittest_params *ut_params, |
| 12995 | const struct HMAC_MD5_vector *test_case, |
| 12996 | uint8_t **plaintext) |
| 12997 | { |
| 12998 | uint16_t plaintext_pad_len; |
| 12999 | |
| 13000 | struct rte_crypto_sym_op *sym_op = ut_params->op->sym; |
| 13001 | |
| 13002 | plaintext_pad_len = RTE_ALIGN_CEIL(test_case->plaintext.len, |
| 13003 | 16); |
| 13004 | |
| 13005 | *plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, |
| 13006 | plaintext_pad_len); |
| 13007 | memcpy(*plaintext, test_case->plaintext.data, |
| 13008 | test_case->plaintext.len); |
| 13009 | |
| 13010 | sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append( |
| 13011 | ut_params->ibuf, MD5_DIGEST_LEN); |
| 13012 | TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data, |
| 13013 | "no room to append digest"); |
| 13014 | sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset( |
| 13015 | ut_params->ibuf, plaintext_pad_len); |
| 13016 | |
| 13017 | if (ut_params->auth_xform.auth.op == RTE_CRYPTO_AUTH_OP_VERIFY) { |
| 13018 | rte_memcpy(sym_op->auth.digest.data, test_case->auth_tag.data, |
| 13019 | test_case->auth_tag.len); |
| 13020 | } |
| 13021 | |
| 13022 | sym_op->auth.data.offset = 0; |
| 13023 | sym_op->auth.data.length = test_case->plaintext.len; |
| 13024 | |
| 13025 | rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); |
| 13026 | ut_params->op->sym->m_src = ut_params->ibuf; |
| 13027 | |
| 13028 | return 0; |
| 13029 | } |
| 13030 | |
| 13031 | static int |
| 13032 | test_MD5_HMAC_generate(const struct HMAC_MD5_vector *test_case) |
no test coverage detected