| 3978 | } |
| 3979 | |
| 3980 | static int |
| 3981 | test_kasumi_encryption_oop_sgl(const struct kasumi_test_data *tdata) |
| 3982 | { |
| 3983 | struct crypto_testsuite_params *ts_params = &testsuite_params; |
| 3984 | struct crypto_unittest_params *ut_params = &unittest_params; |
| 3985 | |
| 3986 | int retval; |
| 3987 | unsigned int plaintext_pad_len; |
| 3988 | unsigned int plaintext_len; |
| 3989 | |
| 3990 | const uint8_t *ciphertext; |
| 3991 | uint8_t buffer[2048]; |
| 3992 | |
| 3993 | struct rte_cryptodev_info dev_info; |
| 3994 | |
| 3995 | /* Verify the capabilities */ |
| 3996 | struct rte_cryptodev_sym_capability_idx cap_idx; |
| 3997 | cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER; |
| 3998 | cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8; |
| 3999 | if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], |
| 4000 | &cap_idx) == NULL) |
| 4001 | return TEST_SKIPPED; |
| 4002 | |
| 4003 | if (global_api_test_type == CRYPTODEV_RAW_API_TEST) |
| 4004 | return TEST_SKIPPED; |
| 4005 | |
| 4006 | if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) |
| 4007 | return TEST_SKIPPED; |
| 4008 | |
| 4009 | rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); |
| 4010 | |
| 4011 | uint64_t feat_flags = dev_info.feature_flags; |
| 4012 | if (!(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)) { |
| 4013 | printf("Device doesn't support out-of-place scatter-gather " |
| 4014 | "in both input and output mbufs. " |
| 4015 | "Test Skipped.\n"); |
| 4016 | return TEST_SKIPPED; |
| 4017 | } |
| 4018 | |
| 4019 | /* Create KASUMI session */ |
| 4020 | retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0], |
| 4021 | RTE_CRYPTO_CIPHER_OP_ENCRYPT, |
| 4022 | RTE_CRYPTO_CIPHER_KASUMI_F8, |
| 4023 | tdata->key.data, tdata->key.len, |
| 4024 | tdata->cipher_iv.len); |
| 4025 | if (retval < 0) |
| 4026 | return retval; |
| 4027 | |
| 4028 | plaintext_len = ceil_byte_length(tdata->plaintext.len); |
| 4029 | /* Append data which is padded to a multiple */ |
| 4030 | /* of the algorithms block size */ |
| 4031 | plaintext_pad_len = RTE_ALIGN_CEIL(plaintext_len, 8); |
| 4032 | |
| 4033 | ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, |
| 4034 | plaintext_pad_len, 10, 0); |
| 4035 | ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool, |
| 4036 | plaintext_pad_len, 3, 0); |
| 4037 |
no test coverage detected