From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 76294376C for ; Mon, 17 Jul 2017 18:30:04 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 17 Jul 2017 09:30:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,375,1496127600"; d="scan'208";a="128375087" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by fmsmga006.fm.intel.com with ESMTP; 17 Jul 2017 09:29:36 -0700 From: Pablo de Lara To: declan.doherty@intel.com Cc: dev@dpdk.org, Pablo de Lara Date: Mon, 17 Jul 2017 09:29:52 +0100 Message-Id: <20170717082953.74995-2-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170717082953.74995-1-pablo.de.lara.guarch@intel.com> References: <20170717082953.74995-1-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH 2/3] cryptodev: rename field name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 16:30:05 -0000 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 --- app/test-crypto-perf/cperf_ops.c | 2 +- drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 2 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +- drivers/crypto/openssl/rte_openssl_pmd.c | 2 +- drivers/crypto/qat/qat_adf/qat_algs.h | 2 +- drivers/crypto/qat/qat_adf/qat_algs_build_desc.c | 8 ++++---- drivers/crypto/qat/qat_crypto.c | 4 ++-- examples/ipsec-secgw/sa.c | 4 ++-- examples/l2fwd-crypto/main.c | 4 ++-- lib/librte_cryptodev/rte_crypto_sym.h | 2 +- test/test/test_cryptodev.c | 4 ++-- test/test/test_cryptodev_perf.c | 4 ++-- 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 bd80f3a..118a203 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 4c0a09b..4c02bc4 100644 --- a/drivers/crypto/qat/qat_adf/qat_algs.h +++ b/drivers/crypto/qat/qat_adf/qat_algs.h @@ -148,7 +148,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 cff8d12..d43c854 100644 --- a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c +++ b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c @@ -664,7 +664,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) { @@ -813,14 +813,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 098109e..2390191 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -742,7 +742,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; @@ -755,7 +755,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 f6236fa..67619c9 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); -- 2.9.4