@@ -669,6 +669,13 @@ test_device_configure_invalid_queue_pair_ids(void)
struct crypto_testsuite_params *ts_params = &testsuite_params;
uint16_t orig_nb_qps = ts_params->conf.nb_queue_pairs;
+ /* This test is for QAT and NITROX PMDs only */
+ if (gbl_driver_id != rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)) &&
+ gbl_driver_id != rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_NITROX_PMD)))
+ return -ENOTSUP;
+
/* Stop the device in case it's started so it can be configured */
rte_cryptodev_stop(ts_params->valid_devs[0]);
@@ -740,6 +747,11 @@ test_queue_pair_descriptor_setup(void)
uint16_t qp_id;
+ /* This test is for QAT PMD only */
+ if (gbl_driver_id != rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)))
+ return -ENOTSUP;
+
/* Stop the device in case it's started so it can be configured */
rte_cryptodev_stop(ts_params->valid_devs[0]);
@@ -1348,6 +1360,19 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_SHA1_HMAC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_AES_CBC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Generate test mbuf data and space for digest */
ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
catch_22_quote, QUOTE_512_BYTES, 0);
@@ -2314,6 +2339,20 @@ test_snow3g_authentication(const struct snow3g_hash_test_data *tdata)
unsigned plaintext_len;
uint8_t *plaintext;
+ /* QAT PMD supports byte-aligned data only */
+ if ((tdata->validAuthLenInBits.len % 8 != 0) &&
+ (gbl_driver_id == rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD))))
+ return -ENOTSUP;
+
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_SNOW3G_UIA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create SNOW 3G session */
retval = create_wireless_algo_hash_session(ts_params->valid_devs[0],
tdata->key.data, tdata->key.len,
@@ -2374,6 +2413,20 @@ test_snow3g_authentication_verify(const struct snow3g_hash_test_data *tdata)
unsigned plaintext_len;
uint8_t *plaintext;
+ /* QAT PMD supports byte-aligned data only */
+ if ((tdata->validAuthLenInBits.len % 8 != 0) &&
+ (gbl_driver_id == rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD))))
+ return -ENOTSUP;
+
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_SNOW3G_UIA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create SNOW 3G session */
retval = create_wireless_algo_hash_session(ts_params->valid_devs[0],
tdata->key.data, tdata->key.len,
@@ -2434,6 +2487,14 @@ test_kasumi_authentication(const struct kasumi_hash_test_data *tdata)
unsigned plaintext_len;
uint8_t *plaintext;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_KASUMI_F9;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create KASUMI session */
retval = create_wireless_algo_hash_session(ts_params->valid_devs[0],
tdata->key.data, tdata->key.len,
@@ -2494,6 +2555,14 @@ test_kasumi_authentication_verify(const struct kasumi_hash_test_data *tdata)
unsigned plaintext_len;
uint8_t *plaintext;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_KASUMI_F9;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create KASUMI session */
retval = create_wireless_algo_hash_session(ts_params->valid_devs[0],
tdata->key.data, tdata->key.len,
@@ -2693,6 +2762,14 @@ test_kasumi_encryption(const struct kasumi_test_data *tdata)
unsigned plaintext_pad_len;
unsigned plaintext_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create KASUMI session */
retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -2765,6 +2842,14 @@ test_kasumi_encryption_sgl(const struct kasumi_test_data *tdata)
struct rte_cryptodev_info dev_info;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
uint64_t feat_flags = dev_info.feature_flags;
@@ -2843,6 +2928,14 @@ test_kasumi_encryption_oop(const struct kasumi_test_data *tdata)
unsigned plaintext_pad_len;
unsigned plaintext_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create KASUMI session */
retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -2916,6 +3009,14 @@ test_kasumi_encryption_oop_sgl(const struct kasumi_test_data *tdata)
struct rte_cryptodev_info dev_info;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
uint64_t feat_flags = dev_info.feature_flags;
@@ -2993,6 +3094,14 @@ test_kasumi_decryption_oop(const struct kasumi_test_data *tdata)
unsigned ciphertext_pad_len;
unsigned ciphertext_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create KASUMI session */
retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_DECRYPT,
@@ -3062,6 +3171,14 @@ test_kasumi_decryption(const struct kasumi_test_data *tdata)
unsigned ciphertext_pad_len;
unsigned ciphertext_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create KASUMI session */
retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_DECRYPT,
@@ -3129,6 +3246,14 @@ test_snow3g_encryption(const struct snow3g_test_data *tdata)
unsigned plaintext_pad_len;
unsigned plaintext_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create SNOW 3G session */
retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -3195,6 +3320,14 @@ test_snow3g_encryption_oop(const struct snow3g_test_data *tdata)
unsigned plaintext_pad_len;
unsigned plaintext_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create SNOW 3G session */
retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -3270,6 +3403,14 @@ test_snow3g_encryption_oop_sgl(const struct snow3g_test_data *tdata)
struct rte_cryptodev_info dev_info;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
uint64_t feat_flags = dev_info.feature_flags;
@@ -3371,6 +3512,19 @@ test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata)
uint8_t extra_offset = 4;
uint8_t *expected_ciphertext_shifted;
+ /* QAT PMD supports byte-aligned data only */
+ if (gbl_driver_id == rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)))
+ return -ENOTSUP;
+
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create SNOW 3G session */
retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -3462,6 +3616,14 @@ static int test_snow3g_decryption(const struct snow3g_test_data *tdata)
unsigned ciphertext_pad_len;
unsigned ciphertext_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create SNOW 3G session */
retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_DECRYPT,
@@ -3525,6 +3687,14 @@ static int test_snow3g_decryption_oop(const struct snow3g_test_data *tdata)
unsigned ciphertext_pad_len;
unsigned ciphertext_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create SNOW 3G session */
retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_DECRYPT,
@@ -3685,6 +3855,19 @@ test_snow3g_cipher_auth(const struct snow3g_test_data *tdata)
unsigned plaintext_pad_len;
unsigned plaintext_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_SNOW3G_UIA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create SNOW 3G session */
retval = create_wireless_algo_cipher_auth_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -3772,6 +3955,19 @@ test_snow3g_auth_cipher(const struct snow3g_test_data *tdata,
struct rte_cryptodev_info dev_info;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_SNOW3G_UIA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
uint64_t feat_flags = dev_info.feature_flags;
@@ -3936,6 +4132,19 @@ test_snow3g_auth_cipher_sgl(const struct snow3g_test_data *tdata,
struct rte_cryptodev_info dev_info;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_SNOW3G_UIA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
uint64_t feat_flags = dev_info.feature_flags;
@@ -4116,6 +4325,19 @@ test_kasumi_auth_cipher(const struct kasumi_test_data *tdata,
struct rte_cryptodev_info dev_info;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_KASUMI_F9;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
uint64_t feat_flags = dev_info.feature_flags;
@@ -4282,6 +4504,19 @@ test_kasumi_auth_cipher_sgl(const struct kasumi_test_data *tdata,
struct rte_cryptodev_info dev_info;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_KASUMI_F9;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
uint64_t feat_flags = dev_info.feature_flags;
@@ -4457,6 +4692,19 @@ test_kasumi_cipher_auth(const struct kasumi_test_data *tdata)
unsigned plaintext_pad_len;
unsigned plaintext_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_KASUMI_F9;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_KASUMI_F8;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create KASUMI session */
retval = create_wireless_algo_cipher_auth_session(
ts_params->valid_devs[0],
@@ -4711,6 +4959,12 @@ test_zuc_authentication(const struct wireless_test_data *tdata)
struct rte_cryptodev_sym_capability_idx cap_idx;
+ /* QAT PMD supports byte-aligned data only */
+ if ((tdata->validAuthLenInBits.len % 8 != 0) &&
+ (gbl_driver_id == rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD))))
+ return -ENOTSUP;
+
/* Check if device supports ZUC EIA3 */
cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
cap_idx.algo.auth = RTE_CRYPTO_AUTH_ZUC_EIA3;
@@ -4762,7 +5016,7 @@ test_zuc_authentication(const struct wireless_test_data *tdata)
TEST_ASSERT_BUFFERS_ARE_EQUAL(
ut_params->digest,
tdata->digest.data,
- DIGEST_BYTE_LENGTH_KASUMI_F9,
+ tdata->digest.len,
"ZUC Generated auth tag not as expected");
return 0;
@@ -5652,6 +5906,11 @@ test_zuc_hash_generate_test_case_6(void)
static int
test_zuc_hash_generate_test_case_7(void)
{
+ /* This test is not for SW ZUC PMD */
+ if (gbl_driver_id == rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_ZUC_PMD)))
+ return -ENOTSUP;
+
return test_zuc_authentication(&zuc_test_case_auth_2080b);
}
@@ -5676,6 +5935,11 @@ test_zuc_cipher_auth_test_case_2(void)
static int
test_zuc_auth_cipher_test_case_1(void)
{
+ /* This test is not for SW ZUC PMD */
+ if (gbl_driver_id == rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_ZUC_PMD)))
+ return -ENOTSUP;
+
return test_zuc_auth_cipher(
&zuc_auth_cipher_test_case_1, IN_PLACE, 0);
}
@@ -6632,6 +6896,20 @@ test_authenticated_encryption(const struct aead_test_data *tdata)
uint16_t plaintext_pad_len;
uint32_t i;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ const struct rte_cryptodev_symmetric_capability *capability;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;
+ cap_idx.algo.aead = tdata->algo;
+ capability = rte_cryptodev_sym_capability_get(
+ ts_params->valid_devs[0], &cap_idx);
+ if (capability == NULL)
+ return -ENOTSUP;
+ if (rte_cryptodev_sym_capability_check_aead(
+ capability, tdata->key.len, tdata->auth_tag.len,
+ tdata->aad.len, tdata->iv.len))
+ return -ENOTSUP;
+
/* Create AEAD session */
retval = create_aead_session(ts_params->valid_devs[0],
tdata->algo,
@@ -6724,6 +7002,21 @@ test_pdcp_proto(int i, int oop,
uint8_t *plaintext;
int ret = TEST_SUCCESS;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ if (pdcp_test_params[i].auth_alg != 0) {
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = pdcp_test_params[i].auth_alg;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ }
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = pdcp_test_params[i].cipher_alg;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Generate test mbuf data */
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
@@ -6890,6 +7183,21 @@ test_pdcp_proto_SGL(int i, int oop,
int segs = 1;
unsigned int trn_data = 0;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ if (pdcp_test_params[i].auth_alg != 0) {
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = pdcp_test_params[i].auth_alg;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ }
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = pdcp_test_params[i].cipher_alg;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
if (fragsz > input_vec_len)
fragsz = input_vec_len;
@@ -7434,6 +7742,8 @@ test_AES_GCM_auth_encryption_fail_iv_corrupt(void)
memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));
tdata.iv.data[0] += 1;
res = test_authenticated_encryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "encryption not failed");
return TEST_SUCCESS;
}
@@ -7448,6 +7758,8 @@ test_AES_GCM_auth_encryption_fail_in_data_corrupt(void)
memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));
tdata.plaintext.data[0] += 1;
res = test_authenticated_encryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "encryption not failed");
return TEST_SUCCESS;
}
@@ -7462,6 +7774,8 @@ test_AES_GCM_auth_encryption_fail_out_data_corrupt(void)
memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));
tdata.ciphertext.data[0] += 1;
res = test_authenticated_encryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "encryption not failed");
return TEST_SUCCESS;
}
@@ -7476,6 +7790,8 @@ test_AES_GCM_auth_encryption_fail_aad_len_corrupt(void)
memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));
tdata.aad.len += 1;
res = test_authenticated_encryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "encryption not failed");
return TEST_SUCCESS;
}
@@ -7493,6 +7809,8 @@ test_AES_GCM_auth_encryption_fail_aad_corrupt(void)
aad[0] += 1;
tdata.aad.data = aad;
res = test_authenticated_encryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "encryption not failed");
return TEST_SUCCESS;
}
@@ -7507,6 +7825,8 @@ test_AES_GCM_auth_encryption_fail_tag_corrupt(void)
memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));
tdata.auth_tag.data[0] += 1;
res = test_authenticated_encryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "encryption not failed");
return TEST_SUCCESS;
}
@@ -7521,6 +7841,20 @@ test_authenticated_decryption(const struct aead_test_data *tdata)
uint8_t *plaintext;
uint32_t i;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ const struct rte_cryptodev_symmetric_capability *capability;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;
+ cap_idx.algo.aead = tdata->algo;
+ capability = rte_cryptodev_sym_capability_get(
+ ts_params->valid_devs[0], &cap_idx);
+ if (capability == NULL)
+ return -ENOTSUP;
+ if (rte_cryptodev_sym_capability_check_aead(
+ capability, tdata->key.len, tdata->auth_tag.len,
+ tdata->aad.len, tdata->iv.len))
+ return -ENOTSUP;
+
/* Create AEAD session */
retval = create_aead_session(ts_params->valid_devs[0],
tdata->algo,
@@ -7736,6 +8070,8 @@ test_AES_GCM_auth_decryption_fail_iv_corrupt(void)
memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));
tdata.iv.data[0] += 1;
res = test_authenticated_decryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "decryption not failed");
return TEST_SUCCESS;
}
@@ -7750,6 +8086,8 @@ test_AES_GCM_auth_decryption_fail_in_data_corrupt(void)
memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));
tdata.plaintext.data[0] += 1;
res = test_authenticated_decryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "decryption not failed");
return TEST_SUCCESS;
}
@@ -7763,6 +8101,8 @@ test_AES_GCM_auth_decryption_fail_out_data_corrupt(void)
memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));
tdata.ciphertext.data[0] += 1;
res = test_authenticated_decryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "decryption not failed");
return TEST_SUCCESS;
}
@@ -7776,6 +8116,8 @@ test_AES_GCM_auth_decryption_fail_aad_len_corrupt(void)
memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));
tdata.aad.len += 1;
res = test_authenticated_decryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "decryption not failed");
return TEST_SUCCESS;
}
@@ -7792,6 +8134,8 @@ test_AES_GCM_auth_decryption_fail_aad_corrupt(void)
aad[0] += 1;
tdata.aad.data = aad;
res = test_authenticated_decryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "decryption not failed");
return TEST_SUCCESS;
}
@@ -7805,6 +8149,8 @@ test_AES_GCM_auth_decryption_fail_tag_corrupt(void)
memcpy(&tdata, &gcm_test_case_7, sizeof(struct aead_test_data));
tdata.auth_tag.data[0] += 1;
res = test_authenticated_decryption(&tdata);
+ if (res == -ENOTSUP)
+ return res;
TEST_ASSERT_EQUAL(res, TEST_FAILED, "authentication not failed");
return TEST_SUCCESS;
}
@@ -7819,6 +8165,14 @@ test_authenticated_encryption_oop(const struct aead_test_data *tdata)
uint8_t *ciphertext, *auth_tag;
uint16_t plaintext_pad_len;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;
+ cap_idx.algo.aead = tdata->algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create AEAD session */
retval = create_aead_session(ts_params->valid_devs[0],
tdata->algo,
@@ -7896,6 +8250,14 @@ test_authenticated_decryption_oop(const struct aead_test_data *tdata)
int retval;
uint8_t *plaintext;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;
+ cap_idx.algo.aead = tdata->algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create AEAD session */
retval = create_aead_session(ts_params->valid_devs[0],
tdata->algo,
@@ -7968,6 +8330,21 @@ test_authenticated_encryption_sessionless(
uint16_t plaintext_pad_len;
uint8_t key[tdata->key.len + 1];
+ /* This test is for AESNI MB and AESNI GCM PMDs only */
+ if ((gbl_driver_id != rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD))) &&
+ (gbl_driver_id != rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD))))
+ return -ENOTSUP;
+
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;
+ cap_idx.algo.aead = tdata->algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
/* clear mbuf payload */
@@ -8049,6 +8426,21 @@ test_authenticated_decryption_sessionless(
uint8_t *plaintext;
uint8_t key[tdata->key.len + 1];
+ /* This test is for AESNI MB and AESNI GCM PMDs only */
+ if ((gbl_driver_id != rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD))) &&
+ (gbl_driver_id != rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD))))
+ return -ENOTSUP;
+
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;
+ cap_idx.algo.aead = tdata->algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* alloc mbuf and set payload */
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
@@ -8227,6 +8619,19 @@ test_stats(void)
struct rte_cryptodev *dev;
cryptodev_stats_get_t temp_pfn;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_SHA1_HMAC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_AES_CBC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
rte_cryptodev_stats_reset(ts_params->valid_devs[0]);
TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0] + 600,
&stats) == -ENODEV),
@@ -8361,6 +8766,14 @@ test_MD5_HMAC_generate(const struct HMAC_MD5_vector *test_case)
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_MD5_HMAC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
if (MD5_HMAC_create_session(ts_params, ut_params,
RTE_CRYPTO_AUTH_OP_GENERATE, test_case))
return TEST_FAILED;
@@ -8407,6 +8820,14 @@ test_MD5_HMAC_verify(const struct HMAC_MD5_vector *test_case)
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_MD5_HMAC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
if (MD5_HMAC_create_session(ts_params, ut_params,
RTE_CRYPTO_AUTH_OP_VERIFY, test_case)) {
return TEST_FAILED;
@@ -8465,6 +8886,19 @@ test_multi_session(void)
uint16_t i;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_SHA512_HMAC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_AES_CBC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(ut_params,
aes_cbc_key, hmac_sha512_key);
@@ -8580,6 +9014,19 @@ test_multi_session_random_usage(void)
};
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_SHA512_HMAC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_AES_CBC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
sessions = rte_malloc(NULL,
@@ -8662,6 +9109,14 @@ test_null_cipher_only_operation(void)
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Generate test mbuf data and space for digest */
ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
catch_22_quote, QUOTE_512_BYTES, 0);
@@ -8728,6 +9183,14 @@ test_null_auth_only_operation(void)
struct crypto_unittest_params *ut_params = &unittest_params;
uint8_t *digest;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Generate test mbuf data and space for digest */
ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
catch_22_quote, QUOTE_512_BYTES, 0);
@@ -8800,6 +9263,19 @@ test_null_cipher_auth_operation(void)
struct crypto_unittest_params *ut_params = &unittest_params;
uint8_t *digest;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Generate test mbuf data and space for digest */
ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
catch_22_quote, QUOTE_512_BYTES, 0);
@@ -8888,6 +9364,19 @@ test_null_auth_cipher_operation(void)
struct crypto_unittest_params *ut_params = &unittest_params;
uint8_t *digest;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Generate test mbuf data */
ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
catch_22_quote, QUOTE_512_BYTES, 0);
@@ -8977,6 +9466,11 @@ test_null_invalid_operation(void)
struct crypto_unittest_params *ut_params = &unittest_params;
int ret;
+ /* This test is for NULL PMD only */
+ if (gbl_driver_id != rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_NULL_PMD)))
+ return -ENOTSUP;
+
/* Setup Cipher Parameters */
ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
ut_params->cipher_xform.next = NULL;
@@ -9029,6 +9523,11 @@ test_null_burst_operation(void)
struct rte_crypto_op *burst[NULL_BURST_LENGTH] = { NULL };
struct rte_crypto_op *burst_dequeued[NULL_BURST_LENGTH] = { NULL };
+ /* This test is for NULL PMD only */
+ if (gbl_driver_id != rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_NULL_PMD)))
+ return -ENOTSUP;
+
/* Setup Cipher Parameters */
ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
ut_params->cipher_xform.next = &ut_params->auth_xform;
@@ -9205,6 +9704,14 @@ test_AES_GMAC_authentication(const struct gmac_test_data *tdata)
TEST_ASSERT_NOT_EQUAL(tdata->gmac_tag.len, 0,
"No GMAC length in the source data");
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_AES_GMAC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
retval = create_gmac_session(ts_params->valid_devs[0],
tdata, RTE_CRYPTO_AUTH_OP_GENERATE);
@@ -9308,6 +9815,14 @@ test_AES_GMAC_authentication_verify(const struct gmac_test_data *tdata)
TEST_ASSERT_NOT_EQUAL(tdata->gmac_tag.len, 0,
"No GMAC length in the source data");
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = RTE_CRYPTO_AUTH_AES_GMAC;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
retval = create_gmac_session(ts_params->valid_devs[0],
tdata, RTE_CRYPTO_AUTH_OP_VERIFY);
@@ -9866,6 +10381,14 @@ test_authentication_verify_fail_when_data_corruption(
uint8_t *plaintext;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = reference->auth_algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create session */
retval = create_auth_session(ut_params,
ts_params->valid_devs[0],
@@ -9924,6 +10447,14 @@ test_authentication_verify_GMAC_fail_when_corruption(
int retval;
uint8_t *plaintext;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = reference->auth_algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create session */
retval = create_auth_cipher_session(ut_params,
ts_params->valid_devs[0],
@@ -9986,6 +10517,19 @@ test_authenticated_decryption_fail_when_corruption(
uint8_t *ciphertext;
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = reference->auth_algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = reference->crypto_algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create session */
retval = create_auth_cipher_session(ut_params,
ts_params->valid_devs[0],
@@ -10049,6 +10593,19 @@ test_authenticated_encryt_with_esn(
uint8_t cipher_key[reference->cipher_key.len + 1];
uint8_t auth_key[reference->auth_key.len + 1];
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = reference->auth_algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = reference->crypto_algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create session */
memcpy(cipher_key, reference->cipher_key.data,
reference->cipher_key.len);
@@ -10152,6 +10709,19 @@ test_authenticated_decrypt_with_esn(
uint8_t cipher_key[reference->cipher_key.len + 1];
uint8_t auth_key[reference->auth_key.len + 1];
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+ cap_idx.algo.auth = reference->auth_algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = reference->crypto_algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
/* Create session */
memcpy(cipher_key, reference->cipher_key.data,
reference->cipher_key.len);
@@ -10324,6 +10894,41 @@ test_authenticated_encryption_SGL(const struct aead_test_data *tdata,
int segs = 1;
unsigned int trn_data = 0;
uint8_t *plaintext, *ciphertext, *auth_tag;
+ struct rte_cryptodev_info dev_info;
+
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;
+ cap_idx.algo.aead = tdata->algo;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return -ENOTSUP;
+
+ /* Detailed check for the particular SGL support flag */
+ rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+ if (!oop) {
+ unsigned int sgl_in = fragsz < tdata->plaintext.len;
+ if (sgl_in && (!(dev_info.feature_flags &
+ RTE_CRYPTODEV_FF_IN_PLACE_SGL)))
+ return -ENOTSUP;
+ } else {
+ unsigned int sgl_in = fragsz < tdata->plaintext.len;
+ unsigned int sgl_out = (fragsz_oop ? fragsz_oop : fragsz) <
+ tdata->plaintext.len;
+ if (sgl_in && !sgl_out) {
+ if (!(dev_info.feature_flags &
+ RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT))
+ return -ENOTSUP;
+ } else if (!sgl_in && sgl_out) {
+ if (!(dev_info.feature_flags &
+ RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT))
+ return -ENOTSUP;
+ } else if (sgl_in && sgl_out) {
+ if (!(dev_info.feature_flags &
+ RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT))
+ return -ENOTSUP;
+ }
+ }
if (fragsz > tdata->plaintext.len)
fragsz = tdata->plaintext.len;
@@ -10573,6 +11178,11 @@ test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B(void)
static int
test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg(void)
{
+ /* This test is not for QAT PMD */
+ if (gbl_driver_id == rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)))
+ return -ENOTSUP;
+
return test_authenticated_encryption_SGL(
&gcm_test_case_8, OUT_OF_PLACE, 400,
gcm_test_case_8.plaintext.len);
@@ -10581,6 +11191,10 @@ test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg(void)
static int
test_AES_GCM_auth_encrypt_SGL_in_place_1500B(void)
{
+ /* This test is not for OPENSSL PMD */
+ if (gbl_driver_id == rte_cryptodev_driver_id_get(
+ RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD)))
+ return -ENOTSUP;
return test_authenticated_encryption_SGL(
&gcm_test_case_SGL_1, IN_PLACE, 1500, 0);