test/crypto: add AES-XTS vectors

The AES-XTS algorithm supports using a wrapped key.
In AES-XTS the data-unit defines the data block size to be
encrypted\decrypted.

Add AES-XTS vectors with a wrapped key.
Add a variable stating whether the key is wrapped or not.
Add the AES-XTS data-unit.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
This commit is contained in:
Shiri Kuzin 2021-07-20 16:09:42 +03:00 committed by Akhil Goyal
parent 9dfc2d6fda
commit d5728a5a17
3 changed files with 1351 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,8 @@ verify_algo_support(const struct blockcipher_test_case *t,
if (capability == NULL)
return -1;
if (cap_idx.algo.cipher != RTE_CRYPTO_CIPHER_NULL)
if (cap_idx.algo.cipher != RTE_CRYPTO_CIPHER_NULL &&
!(t->test_data->wrapped_key))
ret = rte_cryptodev_sym_capability_check_cipher(capability,
tdata->cipher_key.len,
tdata->iv.len);
@ -145,6 +146,12 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
nb_segs = 3;
}
if (!!(feat_flags & RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY) ^
tdata->wrapped_key) {
snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
"SKIPPED");
return TEST_SKIPPED;
}
if (global_api_test_type == CRYPTODEV_RAW_API_TEST &&
!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP)) {
@ -450,6 +457,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
cipher_xform->cipher.key.data = cipher_key;
cipher_xform->cipher.key.length = tdata->cipher_key.len;
cipher_xform->cipher.iv.offset = IV_OFFSET;
cipher_xform->cipher.dataunit_len = tdata->xts_dataunit_len;
if (tdata->crypto_algo == RTE_CRYPTO_CIPHER_NULL)
cipher_xform->cipher.iv.length = 0;

View File

@ -97,6 +97,8 @@ struct blockcipher_test_data {
unsigned int cipher_offset;
unsigned int auth_offset;
uint16_t xts_dataunit_len;
bool wrapped_key;
};
struct unit_test_suite *