git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test/crypto: rename GCM test code
[dpdk.git]
/
test
/
test
/
test_cryptodev.c
diff --git
a/test/test/test_cryptodev.c
b/test/test/test_cryptodev.c
index
4c750f6
..
83b8ee7
100644
(file)
--- a/
test/test/test_cryptodev.c
+++ b/
test/test/test_cryptodev.c
@@
-58,7
+58,7
@@
#include "test_cryptodev_snow3g_test_vectors.h"
#include "test_cryptodev_snow3g_hash_test_vectors.h"
#include "test_cryptodev_zuc_test_vectors.h"
#include "test_cryptodev_snow3g_test_vectors.h"
#include "test_cryptodev_snow3g_hash_test_vectors.h"
#include "test_cryptodev_zuc_test_vectors.h"
-#include "test_cryptodev_
gcm
_test_vectors.h"
+#include "test_cryptodev_
aead
_test_vectors.h"
#include "test_cryptodev_hmac_test_vectors.h"
static int gbl_driver_id;
#include "test_cryptodev_hmac_test_vectors.h"
static int gbl_driver_id;
@@
-4842,10
+4842,11
@@
test_3DES_cipheronly_openssl_all(void)
return TEST_SUCCESS;
}
return TEST_SUCCESS;
}
-/* ***** AE
S-GCM
Tests ***** */
+/* ***** AE
AD algorithm
Tests ***** */
static int
static int
-create_gcm_session(uint8_t dev_id, enum rte_crypto_aead_operation op,
+create_aead_session(uint8_t dev_id, enum rte_crypto_aead_algorithm algo,
+ enum rte_crypto_aead_operation op,
const uint8_t *key, const uint8_t key_len,
const uint16_t aad_len, const uint8_t auth_len,
uint8_t iv_len)
const uint8_t *key, const uint8_t key_len,
const uint16_t aad_len, const uint8_t auth_len,
uint8_t iv_len)
@@
-4860,7
+4861,7
@@
create_gcm_session(uint8_t dev_id, enum rte_crypto_aead_operation op,
/* Setup AEAD Parameters */
ut_params->aead_xform.type = RTE_CRYPTO_SYM_XFORM_AEAD;
ut_params->aead_xform.next = NULL;
/* Setup AEAD Parameters */
ut_params->aead_xform.type = RTE_CRYPTO_SYM_XFORM_AEAD;
ut_params->aead_xform.next = NULL;
- ut_params->aead_xform.aead.algo =
RTE_CRYPTO_AEAD_AES_GCM
;
+ ut_params->aead_xform.aead.algo =
algo
;
ut_params->aead_xform.aead.op = op;
ut_params->aead_xform.aead.key.data = aead_key;
ut_params->aead_xform.aead.key.length = key_len;
ut_params->aead_xform.aead.op = op;
ut_params->aead_xform.aead.key.data = aead_key;
ut_params->aead_xform.aead.key.length = key_len;
@@
-4884,7
+4885,8
@@
create_gcm_session(uint8_t dev_id, enum rte_crypto_aead_operation op,
}
static int
}
static int
-create_gcm_xforms(struct rte_crypto_op *op,
+create_aead_xform(struct rte_crypto_op *op,
+ enum rte_crypto_aead_algorithm algo,
enum rte_crypto_aead_operation aead_op,
uint8_t *key, const uint8_t key_len,
const uint8_t aad_len, const uint8_t auth_len,
enum rte_crypto_aead_operation aead_op,
uint8_t *key, const uint8_t key_len,
const uint8_t aad_len, const uint8_t auth_len,
@@
-4898,7
+4900,7
@@
create_gcm_xforms(struct rte_crypto_op *op,
/* Setup AEAD Parameters */
sym_op->xform->type = RTE_CRYPTO_SYM_XFORM_AEAD;
sym_op->xform->next = NULL;
/* Setup AEAD Parameters */
sym_op->xform->type = RTE_CRYPTO_SYM_XFORM_AEAD;
sym_op->xform->next = NULL;
- sym_op->xform->aead.algo =
RTE_CRYPTO_AEAD_AES_GCM
;
+ sym_op->xform->aead.algo =
algo
;
sym_op->xform->aead.op = aead_op;
sym_op->xform->aead.key.data = key;
sym_op->xform->aead.key.length = key_len;
sym_op->xform->aead.op = aead_op;
sym_op->xform->aead.key.data = key;
sym_op->xform->aead.key.length = key_len;
@@
-4913,8
+4915,8
@@
create_gcm_xforms(struct rte_crypto_op *op,
}
static int
}
static int
-create_
gcm
_operation(enum rte_crypto_aead_operation op,
- const struct
gcm
_test_data *tdata)
+create_
aead
_operation(enum rte_crypto_aead_operation op,
+ const struct
aead
_test_data *tdata)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
@@
-5033,7
+5035,7
@@
create_gcm_operation(enum rte_crypto_aead_operation op,
}
static int
}
static int
-test_
AES_GCM_authenticated_encryption(const struct gcm
_test_data *tdata)
+test_
authenticated_encryption(const struct aead
_test_data *tdata)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
@@
-5043,8
+5045,9
@@
test_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
uint16_t plaintext_pad_len;
uint32_t i;
uint16_t plaintext_pad_len;
uint32_t i;
- /* Create GCM session */
- retval = create_gcm_session(ts_params->valid_devs[0],
+ /* Create AEAD session */
+ retval = create_aead_session(ts_params->valid_devs[0],
+ tdata->algo,
RTE_CRYPTO_AEAD_OP_ENCRYPT,
tdata->key.data, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
RTE_CRYPTO_AEAD_OP_ENCRYPT,
tdata->key.data, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
@@
-5055,7
+5058,7
@@
test_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
if (tdata->aad.len > MBUF_SIZE) {
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool);
/* Populate full size of add data */
if (tdata->aad.len > MBUF_SIZE) {
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool);
/* Populate full size of add data */
- for (i = 32; i <
GCM_
MAX_AAD_LENGTH; i += 32)
+ for (i = 32; i < MAX_AAD_LENGTH; i += 32)
memcpy(&tdata->aad.data[i], &tdata->aad.data[0], 32);
} else
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
memcpy(&tdata->aad.data[i], &tdata->aad.data[0], 32);
} else
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
@@
-5064,8
+5067,8
@@
test_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->ibuf));
memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->ibuf));
- /* Create
GCM
operation */
- retval = create_
gcm
_operation(RTE_CRYPTO_AEAD_OP_ENCRYPT, tdata);
+ /* Create
AEAD
operation */
+ retval = create_
aead
_operation(RTE_CRYPTO_AEAD_OP_ENCRYPT, tdata);
if (retval < 0)
return retval;
if (retval < 0)
return retval;
@@
-5102,13
+5105,13
@@
test_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
ciphertext,
tdata->ciphertext.data,
tdata->ciphertext.len,
ciphertext,
tdata->ciphertext.data,
tdata->ciphertext.len,
- "
GCM
Ciphertext data not as expected");
+ "Ciphertext data not as expected");
TEST_ASSERT_BUFFERS_ARE_EQUAL(
auth_tag,
tdata->auth_tag.data,
tdata->auth_tag.len,
TEST_ASSERT_BUFFERS_ARE_EQUAL(
auth_tag,
tdata->auth_tag.data,
tdata->auth_tag.len,
- "G
CM G
enerated auth tag not as expected");
+ "Generated auth tag not as expected");
return 0;
return 0;
@@
-5117,143
+5120,143
@@
test_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
static int
test_AES_GCM_authenticated_encryption_test_case_1(void)
{
static int
test_AES_GCM_authenticated_encryption_test_case_1(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_1);
+ return test_authenticated_encryption(&gcm_test_case_1);
}
static int
test_AES_GCM_authenticated_encryption_test_case_2(void)
{
}
static int
test_AES_GCM_authenticated_encryption_test_case_2(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_2);
+ return test_authenticated_encryption(&gcm_test_case_2);
}
static int
test_AES_GCM_authenticated_encryption_test_case_3(void)
{
}
static int
test_AES_GCM_authenticated_encryption_test_case_3(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_3);
+ return test_authenticated_encryption(&gcm_test_case_3);
}
static int
test_AES_GCM_authenticated_encryption_test_case_4(void)
{
}
static int
test_AES_GCM_authenticated_encryption_test_case_4(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_4);
+ return test_authenticated_encryption(&gcm_test_case_4);
}
static int
test_AES_GCM_authenticated_encryption_test_case_5(void)
{
}
static int
test_AES_GCM_authenticated_encryption_test_case_5(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_5);
+ return test_authenticated_encryption(&gcm_test_case_5);
}
static int
test_AES_GCM_authenticated_encryption_test_case_6(void)
{
}
static int
test_AES_GCM_authenticated_encryption_test_case_6(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_6);
+ return test_authenticated_encryption(&gcm_test_case_6);
}
static int
test_AES_GCM_authenticated_encryption_test_case_7(void)
{
}
static int
test_AES_GCM_authenticated_encryption_test_case_7(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_7);
+ return test_authenticated_encryption(&gcm_test_case_7);
}
static int
test_AES_GCM_auth_encryption_test_case_192_1(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_192_1(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_192_1);
+ return test_authenticated_encryption(&gcm_test_case_192_1);
}
static int
test_AES_GCM_auth_encryption_test_case_192_2(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_192_2(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_192_2);
+ return test_authenticated_encryption(&gcm_test_case_192_2);
}
static int
test_AES_GCM_auth_encryption_test_case_192_3(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_192_3(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_192_3);
+ return test_authenticated_encryption(&gcm_test_case_192_3);
}
static int
test_AES_GCM_auth_encryption_test_case_192_4(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_192_4(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_192_4);
+ return test_authenticated_encryption(&gcm_test_case_192_4);
}
static int
test_AES_GCM_auth_encryption_test_case_192_5(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_192_5(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_192_5);
+ return test_authenticated_encryption(&gcm_test_case_192_5);
}
static int
test_AES_GCM_auth_encryption_test_case_192_6(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_192_6(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_192_6);
+ return test_authenticated_encryption(&gcm_test_case_192_6);
}
static int
test_AES_GCM_auth_encryption_test_case_192_7(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_192_7(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_192_7);
+ return test_authenticated_encryption(&gcm_test_case_192_7);
}
static int
test_AES_GCM_auth_encryption_test_case_256_1(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_256_1(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_256_1);
+ return test_authenticated_encryption(&gcm_test_case_256_1);
}
static int
test_AES_GCM_auth_encryption_test_case_256_2(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_256_2(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_256_2);
+ return test_authenticated_encryption(&gcm_test_case_256_2);
}
static int
test_AES_GCM_auth_encryption_test_case_256_3(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_256_3(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_256_3);
+ return test_authenticated_encryption(&gcm_test_case_256_3);
}
static int
test_AES_GCM_auth_encryption_test_case_256_4(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_256_4(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_256_4);
+ return test_authenticated_encryption(&gcm_test_case_256_4);
}
static int
test_AES_GCM_auth_encryption_test_case_256_5(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_256_5(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_256_5);
+ return test_authenticated_encryption(&gcm_test_case_256_5);
}
static int
test_AES_GCM_auth_encryption_test_case_256_6(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_256_6(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_256_6);
+ return test_authenticated_encryption(&gcm_test_case_256_6);
}
static int
test_AES_GCM_auth_encryption_test_case_256_7(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_256_7(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_256_7);
+ return test_authenticated_encryption(&gcm_test_case_256_7);
}
static int
test_AES_GCM_auth_encryption_test_case_aad_1(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_aad_1(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_aad_1);
+ return test_authenticated_encryption(&gcm_test_case_aad_1);
}
static int
test_AES_GCM_auth_encryption_test_case_aad_2(void)
{
}
static int
test_AES_GCM_auth_encryption_test_case_aad_2(void)
{
- return test_
AES_GCM_
authenticated_encryption(&gcm_test_case_aad_2);
+ return test_authenticated_encryption(&gcm_test_case_aad_2);
}
static int
}
static int
-test_
AES_GCM_authenticated_decryption(const struct gcm
_test_data *tdata)
+test_
authenticated_decryption(const struct aead
_test_data *tdata)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
@@
-5262,8
+5265,9
@@
test_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
uint8_t *plaintext;
uint32_t i;
uint8_t *plaintext;
uint32_t i;
- /* Create GCM session */
- retval = create_gcm_session(ts_params->valid_devs[0],
+ /* Create AEAD session */
+ retval = create_aead_session(ts_params->valid_devs[0],
+ tdata->algo,
RTE_CRYPTO_AEAD_OP_DECRYPT,
tdata->key.data, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
RTE_CRYPTO_AEAD_OP_DECRYPT,
tdata->key.data, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
@@
-5275,7
+5279,7
@@
test_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
if (tdata->aad.len > MBUF_SIZE) {
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool);
/* Populate full size of add data */
if (tdata->aad.len > MBUF_SIZE) {
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool);
/* Populate full size of add data */
- for (i = 32; i <
GCM_
MAX_AAD_LENGTH; i += 32)
+ for (i = 32; i < MAX_AAD_LENGTH; i += 32)
memcpy(&tdata->aad.data[i], &tdata->aad.data[0], 32);
} else
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
memcpy(&tdata->aad.data[i], &tdata->aad.data[0], 32);
} else
ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
@@
-5283,8
+5287,8
@@
test_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->ibuf));
memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->ibuf));
- /* Create
GCM
operation */
- retval = create_
gcm
_operation(RTE_CRYPTO_AEAD_OP_DECRYPT, tdata);
+ /* Create
AEAD
operation */
+ retval = create_
aead
_operation(RTE_CRYPTO_AEAD_OP_DECRYPT, tdata);
if (retval < 0)
return retval;
if (retval < 0)
return retval;
@@
-5314,154
+5318,154
@@
test_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
plaintext,
tdata->plaintext.data,
tdata->plaintext.len,
plaintext,
tdata->plaintext.data,
tdata->plaintext.len,
- "
GCM p
laintext data not as expected");
+ "
P
laintext data not as expected");
TEST_ASSERT_EQUAL(ut_params->op->status,
RTE_CRYPTO_OP_STATUS_SUCCESS,
TEST_ASSERT_EQUAL(ut_params->op->status,
RTE_CRYPTO_OP_STATUS_SUCCESS,
- "
GCM a
uthentication failed");
+ "
A
uthentication failed");
return 0;
}
static int
test_AES_GCM_authenticated_decryption_test_case_1(void)
{
return 0;
}
static int
test_AES_GCM_authenticated_decryption_test_case_1(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_1);
+ return test_authenticated_decryption(&gcm_test_case_1);
}
static int
test_AES_GCM_authenticated_decryption_test_case_2(void)
{
}
static int
test_AES_GCM_authenticated_decryption_test_case_2(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_2);
+ return test_authenticated_decryption(&gcm_test_case_2);
}
static int
test_AES_GCM_authenticated_decryption_test_case_3(void)
{
}
static int
test_AES_GCM_authenticated_decryption_test_case_3(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_3);
+ return test_authenticated_decryption(&gcm_test_case_3);
}
static int
test_AES_GCM_authenticated_decryption_test_case_4(void)
{
}
static int
test_AES_GCM_authenticated_decryption_test_case_4(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_4);
+ return test_authenticated_decryption(&gcm_test_case_4);
}
static int
test_AES_GCM_authenticated_decryption_test_case_5(void)
{
}
static int
test_AES_GCM_authenticated_decryption_test_case_5(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_5);
+ return test_authenticated_decryption(&gcm_test_case_5);
}
static int
test_AES_GCM_authenticated_decryption_test_case_6(void)
{
}
static int
test_AES_GCM_authenticated_decryption_test_case_6(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_6);
+ return test_authenticated_decryption(&gcm_test_case_6);
}
static int
test_AES_GCM_authenticated_decryption_test_case_7(void)
{
}
static int
test_AES_GCM_authenticated_decryption_test_case_7(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_7);
+ return test_authenticated_decryption(&gcm_test_case_7);
}
static int
test_AES_GCM_auth_decryption_test_case_192_1(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_192_1(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_192_1);
+ return test_authenticated_decryption(&gcm_test_case_192_1);
}
static int
test_AES_GCM_auth_decryption_test_case_192_2(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_192_2(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_192_2);
+ return test_authenticated_decryption(&gcm_test_case_192_2);
}
static int
test_AES_GCM_auth_decryption_test_case_192_3(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_192_3(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_192_3);
+ return test_authenticated_decryption(&gcm_test_case_192_3);
}
static int
test_AES_GCM_auth_decryption_test_case_192_4(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_192_4(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_192_4);
+ return test_authenticated_decryption(&gcm_test_case_192_4);
}
static int
test_AES_GCM_auth_decryption_test_case_192_5(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_192_5(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_192_5);
+ return test_authenticated_decryption(&gcm_test_case_192_5);
}
static int
test_AES_GCM_auth_decryption_test_case_192_6(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_192_6(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_192_6);
+ return test_authenticated_decryption(&gcm_test_case_192_6);
}
static int
test_AES_GCM_auth_decryption_test_case_192_7(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_192_7(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_192_7);
+ return test_authenticated_decryption(&gcm_test_case_192_7);
}
static int
test_AES_GCM_auth_decryption_test_case_256_1(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_256_1(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_256_1);
+ return test_authenticated_decryption(&gcm_test_case_256_1);
}
static int
test_AES_GCM_auth_decryption_test_case_256_2(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_256_2(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_256_2);
+ return test_authenticated_decryption(&gcm_test_case_256_2);
}
static int
test_AES_GCM_auth_decryption_test_case_256_3(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_256_3(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_256_3);
+ return test_authenticated_decryption(&gcm_test_case_256_3);
}
static int
test_AES_GCM_auth_decryption_test_case_256_4(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_256_4(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_256_4);
+ return test_authenticated_decryption(&gcm_test_case_256_4);
}
static int
test_AES_GCM_auth_decryption_test_case_256_5(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_256_5(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_256_5);
+ return test_authenticated_decryption(&gcm_test_case_256_5);
}
static int
test_AES_GCM_auth_decryption_test_case_256_6(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_256_6(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_256_6);
+ return test_authenticated_decryption(&gcm_test_case_256_6);
}
static int
test_AES_GCM_auth_decryption_test_case_256_7(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_256_7(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_256_7);
+ return test_authenticated_decryption(&gcm_test_case_256_7);
}
static int
test_AES_GCM_auth_decryption_test_case_aad_1(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_aad_1(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_aad_1);
+ return test_authenticated_decryption(&gcm_test_case_aad_1);
}
static int
test_AES_GCM_auth_decryption_test_case_aad_2(void)
{
}
static int
test_AES_GCM_auth_decryption_test_case_aad_2(void)
{
- return test_
AES_GCM_
authenticated_decryption(&gcm_test_case_aad_2);
+ return test_authenticated_decryption(&gcm_test_case_aad_2);
}
static int
}
static int
-test_
AES_GCM_authenticated_encryption_oop(const struct gcm
_test_data *tdata)
+test_
authenticated_encryption_oop(const struct aead
_test_data *tdata)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
@@
-5470,8
+5474,9
@@
test_AES_GCM_authenticated_encryption_oop(const struct gcm_test_data *tdata)
uint8_t *ciphertext, *auth_tag;
uint16_t plaintext_pad_len;
uint8_t *ciphertext, *auth_tag;
uint16_t plaintext_pad_len;
- /* Create GCM session */
- retval = create_gcm_session(ts_params->valid_devs[0],
+ /* Create AEAD session */
+ retval = create_aead_session(ts_params->valid_devs[0],
+ tdata->algo,
RTE_CRYPTO_AEAD_OP_ENCRYPT,
tdata->key.data, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
RTE_CRYPTO_AEAD_OP_ENCRYPT,
tdata->key.data, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
@@
-5488,8
+5493,8
@@
test_AES_GCM_authenticated_encryption_oop(const struct gcm_test_data *tdata)
memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->obuf));
memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->obuf));
- /* Create
GCM
operation */
- retval = create_
gcm
_operation(RTE_CRYPTO_AEAD_OP_ENCRYPT, tdata);
+ /* Create
AEAD
operation */
+ retval = create_
aead
_operation(RTE_CRYPTO_AEAD_OP_ENCRYPT, tdata);
if (retval < 0)
return retval;
if (retval < 0)
return retval;
@@
-5519,13
+5524,13
@@
test_AES_GCM_authenticated_encryption_oop(const struct gcm_test_data *tdata)
ciphertext,
tdata->ciphertext.data,
tdata->ciphertext.len,
ciphertext,
tdata->ciphertext.data,
tdata->ciphertext.len,
- "
GCM
Ciphertext data not as expected");
+ "Ciphertext data not as expected");
TEST_ASSERT_BUFFERS_ARE_EQUAL(
auth_tag,
tdata->auth_tag.data,
tdata->auth_tag.len,
TEST_ASSERT_BUFFERS_ARE_EQUAL(
auth_tag,
tdata->auth_tag.data,
tdata->auth_tag.len,
- "G
CM G
enerated auth tag not as expected");
+ "Generated auth tag not as expected");
return 0;
return 0;
@@
-5534,11
+5539,11
@@
test_AES_GCM_authenticated_encryption_oop(const struct gcm_test_data *tdata)
static int
test_AES_GCM_authenticated_encryption_oop_test_case_1(void)
{
static int
test_AES_GCM_authenticated_encryption_oop_test_case_1(void)
{
- return test_
AES_GCM_
authenticated_encryption_oop(&gcm_test_case_5);
+ return test_authenticated_encryption_oop(&gcm_test_case_5);
}
static int
}
static int
-test_
AES_GCM_authenticated_decryption_oop(const struct gcm
_test_data *tdata)
+test_
authenticated_decryption_oop(const struct aead
_test_data *tdata)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
@@
-5546,8
+5551,9
@@
test_AES_GCM_authenticated_decryption_oop(const struct gcm_test_data *tdata)
int retval;
uint8_t *plaintext;
int retval;
uint8_t *plaintext;
- /* Create GCM session */
- retval = create_gcm_session(ts_params->valid_devs[0],
+ /* Create AEAD session */
+ retval = create_aead_session(ts_params->valid_devs[0],
+ tdata->algo,
RTE_CRYPTO_AEAD_OP_DECRYPT,
tdata->key.data, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
RTE_CRYPTO_AEAD_OP_DECRYPT,
tdata->key.data, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
@@
-5564,8
+5570,8
@@
test_AES_GCM_authenticated_decryption_oop(const struct gcm_test_data *tdata)
memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->obuf));
memset(rte_pktmbuf_mtod(ut_params->obuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->obuf));
- /* Create
GCM
operation */
- retval = create_
gcm
_operation(RTE_CRYPTO_AEAD_OP_DECRYPT, tdata);
+ /* Create
AEAD
operation */
+ retval = create_
aead
_operation(RTE_CRYPTO_AEAD_OP_DECRYPT, tdata);
if (retval < 0)
return retval;
if (retval < 0)
return retval;
@@
-5591,23
+5597,23
@@
test_AES_GCM_authenticated_decryption_oop(const struct gcm_test_data *tdata)
plaintext,
tdata->plaintext.data,
tdata->plaintext.len,
plaintext,
tdata->plaintext.data,
tdata->plaintext.len,
- "
GCM p
laintext data not as expected");
+ "
P
laintext data not as expected");
TEST_ASSERT_EQUAL(ut_params->op->status,
RTE_CRYPTO_OP_STATUS_SUCCESS,
TEST_ASSERT_EQUAL(ut_params->op->status,
RTE_CRYPTO_OP_STATUS_SUCCESS,
- "
GCM a
uthentication failed");
+ "
A
uthentication failed");
return 0;
}
static int
test_AES_GCM_authenticated_decryption_oop_test_case_1(void)
{
return 0;
}
static int
test_AES_GCM_authenticated_decryption_oop_test_case_1(void)
{
- return test_
AES_GCM_
authenticated_decryption_oop(&gcm_test_case_5);
+ return test_authenticated_decryption_oop(&gcm_test_case_5);
}
static int
}
static int
-test_
AES_GCM_
authenticated_encryption_sessionless(
- const struct
gcm
_test_data *tdata)
+test_authenticated_encryption_sessionless(
+ const struct
aead
_test_data *tdata)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
@@
-5623,14
+5629,15
@@
test_AES_GCM_authenticated_encryption_sessionless(
memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->ibuf));
memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->ibuf));
- /* Create
GCM
operation */
- retval = create_
gcm
_operation(RTE_CRYPTO_AEAD_OP_ENCRYPT, tdata);
+ /* Create
AEAD
operation */
+ retval = create_
aead
_operation(RTE_CRYPTO_AEAD_OP_ENCRYPT, tdata);
if (retval < 0)
return retval;
if (retval < 0)
return retval;
- /* Create GCM xform
s
*/
+ /* Create GCM xform */
memcpy(key, tdata->key.data, tdata->key.len);
memcpy(key, tdata->key.data, tdata->key.len);
- retval = create_gcm_xforms(ut_params->op,
+ retval = create_aead_xform(ut_params->op,
+ tdata->algo,
RTE_CRYPTO_AEAD_OP_ENCRYPT,
key, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
RTE_CRYPTO_AEAD_OP_ENCRYPT,
key, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
@@
-5667,13
+5674,13
@@
test_AES_GCM_authenticated_encryption_sessionless(
ciphertext,
tdata->ciphertext.data,
tdata->ciphertext.len,
ciphertext,
tdata->ciphertext.data,
tdata->ciphertext.len,
- "
GCM
Ciphertext data not as expected");
+ "Ciphertext data not as expected");
TEST_ASSERT_BUFFERS_ARE_EQUAL(
auth_tag,
tdata->auth_tag.data,
tdata->auth_tag.len,
TEST_ASSERT_BUFFERS_ARE_EQUAL(
auth_tag,
tdata->auth_tag.data,
tdata->auth_tag.len,
- "G
CM G
enerated auth tag not as expected");
+ "Generated auth tag not as expected");
return 0;
return 0;
@@
-5682,13
+5689,13
@@
test_AES_GCM_authenticated_encryption_sessionless(
static int
test_AES_GCM_authenticated_encryption_sessionless_test_case_1(void)
{
static int
test_AES_GCM_authenticated_encryption_sessionless_test_case_1(void)
{
- return test_
AES_GCM_
authenticated_encryption_sessionless(
+ return test_authenticated_encryption_sessionless(
&gcm_test_case_5);
}
static int
&gcm_test_case_5);
}
static int
-test_
AES_GCM_
authenticated_decryption_sessionless(
- const struct
gcm
_test_data *tdata)
+test_authenticated_decryption_sessionless(
+ const struct
aead
_test_data *tdata)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
@@
-5703,14
+5710,15
@@
test_AES_GCM_authenticated_decryption_sessionless(
memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->ibuf));
memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->ibuf));
- /* Create
GCM
operation */
- retval = create_
gcm
_operation(RTE_CRYPTO_AEAD_OP_DECRYPT, tdata);
+ /* Create
AEAD
operation */
+ retval = create_
aead
_operation(RTE_CRYPTO_AEAD_OP_DECRYPT, tdata);
if (retval < 0)
return retval;
if (retval < 0)
return retval;
- /* Create
GCM xforms
*/
+ /* Create
AEAD xform
*/
memcpy(key, tdata->key.data, tdata->key.len);
memcpy(key, tdata->key.data, tdata->key.len);
- retval = create_gcm_xforms(ut_params->op,
+ retval = create_aead_xform(ut_params->op,
+ tdata->algo,
RTE_CRYPTO_AEAD_OP_DECRYPT,
key, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
RTE_CRYPTO_AEAD_OP_DECRYPT,
key, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
@@
-5743,18
+5751,18
@@
test_AES_GCM_authenticated_decryption_sessionless(
plaintext,
tdata->plaintext.data,
tdata->plaintext.len,
plaintext,
tdata->plaintext.data,
tdata->plaintext.len,
- "
GCM p
laintext data not as expected");
+ "
P
laintext data not as expected");
TEST_ASSERT_EQUAL(ut_params->op->status,
RTE_CRYPTO_OP_STATUS_SUCCESS,
TEST_ASSERT_EQUAL(ut_params->op->status,
RTE_CRYPTO_OP_STATUS_SUCCESS,
- "
GCM a
uthentication failed");
+ "
A
uthentication failed");
return 0;
}
static int
test_AES_GCM_authenticated_decryption_sessionless_test_case_1(void)
{
return 0;
}
static int
test_AES_GCM_authenticated_decryption_sessionless_test_case_1(void)
{
- return test_
AES_GCM_
authenticated_decryption_sessionless(
+ return test_authenticated_decryption_sessionless(
&gcm_test_case_5);
}
&gcm_test_case_5);
}
@@
-7463,8
+7471,8
@@
test_authenticated_decryption_fail_when_corruption(
}
static int
}
static int
-create_
gcm
_operation_SGL(enum rte_crypto_aead_operation op,
- const struct
gcm
_test_data *tdata,
+create_
aead
_operation_SGL(enum rte_crypto_aead_operation op,
+ const struct
aead
_test_data *tdata,
void *digest_mem, uint64_t digest_phys)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
void *digest_mem, uint64_t digest_phys)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
@@
-7525,7
+7533,7
@@
create_gcm_operation_SGL(enum rte_crypto_aead_operation op,
#define SGL_MAX_NO 16
static int
#define SGL_MAX_NO 16
static int
-test_
AES_GCM_authenticated_encryption_SGL(const struct gcm
_test_data *tdata,
+test_
authenticated_encryption_SGL(const struct aead
_test_data *tdata,
const int oop, uint32_t fragsz, uint32_t fragsz_oop)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
const int oop, uint32_t fragsz, uint32_t fragsz_oop)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
@@
-7570,8
+7578,9
@@
test_AES_GCM_authenticated_encryption_SGL(const struct gcm_test_data *tdata,
buf_oop = ut_params->obuf;
}
buf_oop = ut_params->obuf;
}
- /* Create GCM session */
- retval = create_gcm_session(ts_params->valid_devs[0],
+ /* Create AEAD session */
+ retval = create_aead_session(ts_params->valid_devs[0],
+ tdata->algo,
RTE_CRYPTO_AEAD_OP_ENCRYPT,
tdata->key.data, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
RTE_CRYPTO_AEAD_OP_ENCRYPT,
tdata->key.data, tdata->key.len,
tdata->aad.len, tdata->auth_tag.len,
@@
-7700,8
+7709,8
@@
test_AES_GCM_authenticated_encryption_SGL(const struct gcm_test_data *tdata,
tdata->plaintext.len);
}
tdata->plaintext.len);
}
- /* Create
GCM operta
ion */
- retval = create_
gcm
_operation_SGL(RTE_CRYPTO_AEAD_OP_ENCRYPT,
+ /* Create
AEAD operat
ion */
+ retval = create_
aead
_operation_SGL(RTE_CRYPTO_AEAD_OP_ENCRYPT,
tdata, digest_mem, digest_phys);
if (retval < 0)
tdata, digest_mem, digest_phys);
if (retval < 0)
@@
-7735,7
+7744,7
@@
test_AES_GCM_authenticated_encryption_SGL(const struct gcm_test_data *tdata,
ciphertext,
tdata->ciphertext.data,
fragsz,
ciphertext,
tdata->ciphertext.data,
fragsz,
- "
GCM
Ciphertext data not as expected");
+ "Ciphertext data not as expected");
buf = ut_params->op->sym->m_src->next;
if (oop)
buf = ut_params->op->sym->m_src->next;
if (oop)
@@
-7752,7
+7761,7
@@
test_AES_GCM_authenticated_encryption_SGL(const struct gcm_test_data *tdata,
ciphertext,
tdata->ciphertext.data + off,
to_trn_tbl[ecx],
ciphertext,
tdata->ciphertext.data + off,
to_trn_tbl[ecx],
- "
GCM
Ciphertext data not as expected");
+ "Ciphertext data not as expected");
off += to_trn_tbl[ecx++];
buf = buf->next;
off += to_trn_tbl[ecx++];
buf = buf->next;
@@
-7763,7
+7772,7
@@
test_AES_GCM_authenticated_encryption_SGL(const struct gcm_test_data *tdata,
auth_tag,
tdata->auth_tag.data,
tdata->auth_tag.len,
auth_tag,
tdata->auth_tag.data,
tdata->auth_tag.len,
- "G
CM G
enerated auth tag not as expected");
+ "Generated auth tag not as expected");
return 0;
}
return 0;
}
@@
-7774,21
+7783,21
@@
test_AES_GCM_authenticated_encryption_SGL(const struct gcm_test_data *tdata,
static int
test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_400B(void)
{
static int
test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_400B(void)
{
- return test_
AES_GCM_
authenticated_encryption_SGL(
+ return test_authenticated_encryption_SGL(
&gcm_test_case_SGL_1, OUT_OF_PLACE, 400, 400);
}
static int
test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B(void)
{
&gcm_test_case_SGL_1, OUT_OF_PLACE, 400, 400);
}
static int
test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B(void)
{
- return test_
AES_GCM_
authenticated_encryption_SGL(
+ return test_authenticated_encryption_SGL(
&gcm_test_case_SGL_1, OUT_OF_PLACE, 1500, 2000);
}
static int
test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg(void)
{
&gcm_test_case_SGL_1, OUT_OF_PLACE, 1500, 2000);
}
static int
test_AES_GCM_auth_encrypt_SGL_out_of_place_400B_1seg(void)
{
- return test_
AES_GCM_
authenticated_encryption_SGL(
+ return test_authenticated_encryption_SGL(
&gcm_test_case_8, OUT_OF_PLACE, 400,
gcm_test_case_8.plaintext.len);
}
&gcm_test_case_8, OUT_OF_PLACE, 400,
gcm_test_case_8.plaintext.len);
}
@@
-7797,7
+7806,7
@@
static int
test_AES_GCM_auth_encrypt_SGL_in_place_1500B(void)
{
test_AES_GCM_auth_encrypt_SGL_in_place_1500B(void)
{
- return test_
AES_GCM_
authenticated_encryption_SGL(
+ return test_authenticated_encryption_SGL(
&gcm_test_case_SGL_1, IN_PLACE, 1500, 0);
}
&gcm_test_case_SGL_1, IN_PLACE, 1500, 0);
}