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]);
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]);
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);
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,
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,
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,
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,
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,
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;
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,
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;
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,
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,
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,
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,
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;
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,
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,
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,
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,
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;
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;
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;
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;
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],
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;
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;
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);
}
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);
}
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,
struct crypto_unittest_params *ut_params = &unittest_params;
uint8_t *plaintext;
int ret = TEST_SUCCESS;
+ struct rte_security_ctx *ctx = (struct rte_security_ctx *)
+ rte_cryptodev_get_sec_ctx(
+ ts_params->valid_devs[0]);
+
+ /* Verify the capabilities */
+ struct rte_security_capability_idx sec_cap_idx;
+
+ sec_cap_idx.action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
+ sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_PDCP;
+ sec_cap_idx.pdcp.domain = pdcp_test_params[i].domain;
+ if (rte_security_capability_get(ctx, &sec_cap_idx) == NULL)
+ return -ENOTSUP;
/* Generate test mbuf data */
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
.crypto_xform = &ut_params->cipher_xform
};
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(
- ts_params->valid_devs[0]);
-
/* Create security session */
ut_params->sec_session = rte_security_session_create(ctx,
&sess_conf, ts_params->session_priv_mpool);
int to_trn_tbl[16];
int segs = 1;
unsigned int trn_data = 0;
+ struct rte_security_ctx *ctx = (struct rte_security_ctx *)
+ rte_cryptodev_get_sec_ctx(
+ ts_params->valid_devs[0]);
+
+ /* Verify the capabilities */
+ struct rte_security_capability_idx sec_cap_idx;
+
+ sec_cap_idx.action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL;
+ sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_PDCP;
+ sec_cap_idx.pdcp.domain = pdcp_test_params[i].domain;
+ if (rte_security_capability_get(ctx, &sec_cap_idx) == NULL)
+ return -ENOTSUP;
if (fragsz > input_vec_len)
fragsz = input_vec_len;
.crypto_xform = &ut_params->cipher_xform
};
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(
- ts_params->valid_devs[0]);
-
/* Create security session */
ut_params->sec_session = rte_security_session_create(ctx,
&sess_conf, ts_params->session_priv_mpool);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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,
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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,
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,
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 */
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);
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),
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;
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;
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);
};
+ /* 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,
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);
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);
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);
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);
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;
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;
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);
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);
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],
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],
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],
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);
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);
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;
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);