summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2017-07-17 09:29:52 +0100
committerPablo de Lara <pablo.de.lara.guarch@intel.com>2017-07-19 14:10:41 +0300
commit46a0547f9f2a07169c7285e098539ccc7c003dcc (patch)
tree579c55d73614123e0c825d4d8da4635c6d12b306
parent799dea57838a89fd447d2208dff035f7307ffb85 (diff)
downloaddpdk-46a0547f9f2a07169c7285e098539ccc7c003dcc.zip
dpdk-46a0547f9f2a07169c7285e098539ccc7c003dcc.tar.gz
dpdk-46a0547f9f2a07169c7285e098539ccc7c003dcc.tar.xz
cryptodev: rename ADD field
Additional Authenticated Data (AAD) is called "aad" in most places of cryptodev, but it was called "add_auth_data" in the AEAD transform transform (aead_xform). This field is renamed to "aad_length" in order to keep consistency. Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
-rw-r--r--app/test-crypto-perf/cperf_ops.c2
-rw-r--r--drivers/crypto/aesni_gcm/aesni_gcm_pmd.c2
-rw-r--r--drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c2
-rw-r--r--drivers/crypto/openssl/rte_openssl_pmd.c2
-rw-r--r--drivers/crypto/qat/qat_adf/qat_algs.h2
-rw-r--r--drivers/crypto/qat/qat_adf/qat_algs_build_desc.c8
-rw-r--r--drivers/crypto/qat/qat_crypto.c4
-rw-r--r--examples/ipsec-secgw/sa.c4
-rw-r--r--examples/l2fwd-crypto/main.c4
-rw-r--r--lib/librte_cryptodev/rte_crypto_sym.h2
-rw-r--r--test/test/test_cryptodev.c4
-rw-r--r--test/test/test_cryptodev_perf.c4
12 files changed, 20 insertions, 20 deletions
diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index a5bf09b..88fb972 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -509,7 +509,7 @@ cperf_create_session(struct rte_mempool *sess_mp,
aead_xform.aead.iv.length = test_vector->aead_iv.length;
aead_xform.aead.digest_length = options->digest_sz;
- aead_xform.aead.add_auth_data_length =
+ aead_xform.aead.aad_length =
options->aead_aad_sz;
/* Create crypto session */
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 91c3801..e051624 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -102,7 +102,7 @@ aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *gcm_ops,
key_length = aead_xform->aead.key.length;
key = aead_xform->aead.key.data;
- sess->aad_length = aead_xform->aead.add_auth_data_length;
+ sess->aad_length = aead_xform->aead.aad_length;
digest_length = aead_xform->aead.digest_length;
} else {
GCM_LOG_ERR("Wrong xform type, has to be AEAD or authentication");
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 9f2c0d9..f422937 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1193,7 +1193,7 @@ dpaa2_sec_aead_init(struct rte_cryptodev *dev,
session->digest_length = aead_xform->digest_length;
session->aead_key.length = aead_xform->key.length;
- ctxt->auth_only_len = aead_xform->add_auth_data_length;
+ ctxt->auth_only_len = aead_xform->aad_length;
aeaddata.key = (uint64_t)session->aead_key.data;
aeaddata.keylen = session->aead_key.length;
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index d943d72..c7c520f 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -458,7 +458,7 @@ openssl_set_session_aead_parameters(struct openssl_session *sess,
return -EINVAL;
}
- sess->auth.aad_length = xform->aead.add_auth_data_length;
+ sess->auth.aad_length = xform->aead.aad_length;
sess->auth.digest_length = xform->aead.digest_length;
return 0;
diff --git a/drivers/crypto/qat/qat_adf/qat_algs.h b/drivers/crypto/qat/qat_adf/qat_algs.h
index c280325..2c8e03c 100644
--- a/drivers/crypto/qat/qat_adf/qat_algs.h
+++ b/drivers/crypto/qat/qat_adf/qat_algs.h
@@ -150,7 +150,7 @@ int qat_alg_aead_session_create_content_desc_cipher(struct qat_session *cd,
int qat_alg_aead_session_create_content_desc_auth(struct qat_session *cdesc,
uint8_t *authkey,
uint32_t authkeylen,
- uint32_t add_auth_data_length,
+ uint32_t aad_length,
uint32_t digestsize,
unsigned int operation);
diff --git a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c
index 7c753e4..2d16c9e 100644
--- a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c
+++ b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c
@@ -665,7 +665,7 @@ int qat_alg_aead_session_create_content_desc_cipher(struct qat_session *cdesc,
int qat_alg_aead_session_create_content_desc_auth(struct qat_session *cdesc,
uint8_t *authkey,
uint32_t authkeylen,
- uint32_t add_auth_data_length,
+ uint32_t aad_length,
uint32_t digestsize,
unsigned int operation)
{
@@ -814,14 +814,14 @@ int qat_alg_aead_session_create_content_desc_auth(struct qat_session *cdesc,
* in big-endian format. This field is 8 bytes
*/
auth_param->u2.aad_sz =
- RTE_ALIGN_CEIL(add_auth_data_length, 16);
+ RTE_ALIGN_CEIL(aad_length, 16);
auth_param->hash_state_sz = (auth_param->u2.aad_sz) >> 3;
aad_len = (uint32_t *)(cdesc->cd_cur_ptr +
ICP_QAT_HW_GALOIS_128_STATE1_SZ +
ICP_QAT_HW_GALOIS_H_SZ);
- *aad_len = rte_bswap32(add_auth_data_length);
- cdesc->aad_len = add_auth_data_length;
+ *aad_len = rte_bswap32(aad_length);
+ cdesc->aad_len = aad_length;
break;
case ICP_QAT_HW_AUTH_ALGO_SNOW_3G_UIA2:
qat_proto_flag = QAT_CRYPTO_PROTO_FLAG_SNOW3G;
diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index 9c5e08c..ec481ae 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -744,7 +744,7 @@ qat_crypto_sym_configure_session_aead(struct rte_crypto_sym_xform *xform,
if (qat_alg_aead_session_create_content_desc_auth(session,
aead_xform->key.data,
aead_xform->key.length,
- aead_xform->add_auth_data_length,
+ aead_xform->aad_length,
aead_xform->digest_length,
RTE_CRYPTO_AUTH_OP_GENERATE))
goto error_out;
@@ -757,7 +757,7 @@ qat_crypto_sym_configure_session_aead(struct rte_crypto_sym_xform *xform,
if (qat_alg_aead_session_create_content_desc_auth(session,
aead_xform->key.data,
aead_xform->key.length,
- aead_xform->add_auth_data_length,
+ aead_xform->aad_length,
aead_xform->digest_length,
RTE_CRYPTO_AUTH_OP_VERIFY))
goto error_out;
diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index c6fca93..7be0e62 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -720,7 +720,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[],
sa_ctx->xf[idx].a.next = NULL;
sa_ctx->xf[idx].a.aead.iv.offset = IV_OFFSET;
sa_ctx->xf[idx].a.aead.iv.length = iv_length;
- sa_ctx->xf[idx].a.aead.add_auth_data_length =
+ sa_ctx->xf[idx].a.aead.aad_length =
sa->aad_len;
sa_ctx->xf[idx].a.aead.digest_length =
sa->digest_len;
@@ -735,7 +735,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[],
sa_ctx->xf[idx].a.next = NULL;
sa_ctx->xf[idx].a.aead.iv.offset = IV_OFFSET;
sa_ctx->xf[idx].a.aead.iv.length = iv_length;
- sa_ctx->xf[idx].a.aead.add_auth_data_length =
+ sa_ctx->xf[idx].a.aead.aad_length =
sa->aad_len;
sa_ctx->xf[idx].a.aead.digest_length =
sa->digest_len;
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 71cb133..84b727b 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -765,7 +765,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
port_cparams[i].aead_algo = options->aead_xform.aead.algo;
port_cparams[i].digest_length =
options->aead_xform.aead.digest_length;
- if (options->aead_xform.aead.add_auth_data_length) {
+ if (options->aead_xform.aead.aad_length) {
port_cparams[i].aad.data = options->aad.data;
port_cparams[i].aad.phys_addr = options->aad.phys_addr;
port_cparams[i].aad.length = options->aad.length;
@@ -2082,7 +2082,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
} else
options->aad.length = cap->sym.auth.aad_size.min;
- options->aead_xform.aead.add_auth_data_length =
+ options->aead_xform.aead.aad_length =
options->aad.length;
/* Check if digest size is supported by the algorithm. */
diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h
index 27439af..ea58cef 100644
--- a/lib/librte_cryptodev/rte_crypto_sym.h
+++ b/lib/librte_cryptodev/rte_crypto_sym.h
@@ -426,7 +426,7 @@ struct rte_crypto_aead_xform {
uint16_t digest_length;
- uint16_t add_auth_data_length;
+ uint16_t aad_length;
/**< The length of the additional authenticated data (AAD) in bytes. */
};
diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index d998cdd..32d65ce 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -4810,7 +4810,7 @@ create_gcm_session(uint8_t dev_id, enum rte_crypto_aead_operation op,
ut_params->aead_xform.aead.iv.offset = IV_OFFSET;
ut_params->aead_xform.aead.iv.length = iv_len;
ut_params->aead_xform.aead.digest_length = auth_len;
- ut_params->aead_xform.aead.add_auth_data_length = aad_len;
+ ut_params->aead_xform.aead.aad_length = aad_len;
TEST_HEXDUMP(stdout, "key:", key, key_len);
@@ -4848,7 +4848,7 @@ create_gcm_xforms(struct rte_crypto_op *op,
sym_op->xform->aead.iv.offset = IV_OFFSET;
sym_op->xform->aead.iv.length = iv_len;
sym_op->xform->aead.digest_length = auth_len;
- sym_op->xform->aead.add_auth_data_length = aad_len;
+ sym_op->xform->aead.aad_length = aad_len;
TEST_HEXDUMP(stdout, "key:", key, key_len);
diff --git a/test/test/test_cryptodev_perf.c b/test/test/test_cryptodev_perf.c
index 8febd1a..3b57e6d 100644
--- a/test/test/test_cryptodev_perf.c
+++ b/test/test/test_cryptodev_perf.c
@@ -2881,7 +2881,7 @@ test_perf_create_openssl_session(uint8_t dev_id, enum chain_mode chain,
case RTE_CRYPTO_AEAD_AES_GCM:
aead_xform.aead.key.data = aes_key;
aead_xform.aead.iv.length = AES_CIPHER_IV_LENGTH;
- aead_xform.aead.add_auth_data_length = AES_GCM_AAD_LENGTH;
+ aead_xform.aead.aad_length = AES_GCM_AAD_LENGTH;
aead_xform.aead.digest_length = get_aead_digest_length(aead_algo);
break;
default:
@@ -4267,7 +4267,7 @@ test_perf_create_session(uint8_t dev_id, struct perf_test_params *pparams)
aead_xform.aead.key.length = pparams->session_attrs->key_aead_len;
aead_xform.aead.iv.length = pparams->session_attrs->iv_len;
aead_xform.aead.iv.offset = IV_OFFSET;
- aead_xform.aead.add_auth_data_length = pparams->session_attrs->aad_len;
+ aead_xform.aead.aad_length = pparams->session_attrs->aad_len;
aead_xform.aead.digest_length = pparams->session_attrs->digest_len;
test_crypto_session = rte_cryptodev_sym_session_create(ts_params->sess_mp);