| 15312 | } |
| 15313 | |
| 15314 | static int |
| 15315 | test_authenticated_decrypt_with_esn( |
| 15316 | struct crypto_testsuite_params *ts_params, |
| 15317 | struct crypto_unittest_params *ut_params, |
| 15318 | const struct test_crypto_vector *reference) |
| 15319 | { |
| 15320 | int retval; |
| 15321 | |
| 15322 | uint8_t *ciphertext; |
| 15323 | uint8_t cipher_key[reference->cipher_key.len + 1]; |
| 15324 | uint8_t auth_key[reference->auth_key.len + 1]; |
| 15325 | struct rte_cryptodev_info dev_info; |
| 15326 | |
| 15327 | rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); |
| 15328 | uint64_t feat_flags = dev_info.feature_flags; |
| 15329 | |
| 15330 | if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) && |
| 15331 | (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) { |
| 15332 | printf("Device doesn't support RAW data-path APIs.\n"); |
| 15333 | return TEST_SKIPPED; |
| 15334 | } |
| 15335 | |
| 15336 | /* Verify the capabilities */ |
| 15337 | struct rte_cryptodev_sym_capability_idx cap_idx; |
| 15338 | cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH; |
| 15339 | cap_idx.algo.auth = reference->auth_algo; |
| 15340 | if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], |
| 15341 | &cap_idx) == NULL) |
| 15342 | return TEST_SKIPPED; |
| 15343 | cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER; |
| 15344 | cap_idx.algo.cipher = reference->crypto_algo; |
| 15345 | if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], |
| 15346 | &cap_idx) == NULL) |
| 15347 | return TEST_SKIPPED; |
| 15348 | |
| 15349 | /* Create session */ |
| 15350 | memcpy(cipher_key, reference->cipher_key.data, |
| 15351 | reference->cipher_key.len); |
| 15352 | memcpy(auth_key, reference->auth_key.data, reference->auth_key.len); |
| 15353 | |
| 15354 | /* Setup Authentication Parameters */ |
| 15355 | ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; |
| 15356 | ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY; |
| 15357 | ut_params->auth_xform.auth.algo = reference->auth_algo; |
| 15358 | ut_params->auth_xform.auth.key.length = reference->auth_key.len; |
| 15359 | ut_params->auth_xform.auth.key.data = auth_key; |
| 15360 | ut_params->auth_xform.auth.digest_length = reference->digest.len; |
| 15361 | ut_params->auth_xform.next = &ut_params->cipher_xform; |
| 15362 | |
| 15363 | /* Setup Cipher Parameters */ |
| 15364 | ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; |
| 15365 | ut_params->cipher_xform.next = NULL; |
| 15366 | ut_params->cipher_xform.cipher.algo = reference->crypto_algo; |
| 15367 | ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT; |
| 15368 | ut_params->cipher_xform.cipher.key.data = cipher_key; |
| 15369 | ut_params->cipher_xform.cipher.key.length = reference->cipher_key.len; |
| 15370 | ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; |
| 15371 | ut_params->cipher_xform.cipher.iv.length = reference->iv.len; |
no test coverage detected