cryptodev: rename ADD field
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Mon, 17 Jul 2017 08:29:52 +0000 (09:29 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 19 Jul 2017 11:10:41 +0000 (14:10 +0300)
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>
12 files changed:
app/test-crypto-perf/cperf_ops.c
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
drivers/crypto/openssl/rte_openssl_pmd.c
drivers/crypto/qat/qat_adf/qat_algs.h
drivers/crypto/qat/qat_adf/qat_algs_build_desc.c
drivers/crypto/qat/qat_crypto.c
examples/ipsec-secgw/sa.c
examples/l2fwd-crypto/main.c
lib/librte_cryptodev/rte_crypto_sym.h
test/test/test_cryptodev.c
test/test/test_cryptodev_perf.c

index a5bf09b..88fb972 100644 (file)
@@ -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 */
index 91c3801..e051624 100644 (file)
@@ -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");
index 9f2c0d9..f422937 100644 (file)
@@ -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;
index d943d72..c7c520f 100644 (file)
@@ -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;
index c280325..2c8e03c 100644 (file)
@@ -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);
 
index 7c753e4..2d16c9e 100644 (file)
@@ -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;
index 9c5e08c..ec481ae 100644 (file)
@@ -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;
index c6fca93..7be0e62 100644 (file)
@@ -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;
index 71cb133..84b727b 100644 (file)
@@ -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. */
index 27439af..ea58cef 100644 (file)
@@ -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. */
 };
 
index d998cdd..32d65ce 100644 (file)
@@ -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);
 
index 8febd1a..3b57e6d 100644 (file)
@@ -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);