crypto/qat: rename content descriptor functions
authorArek Kusztal <arkadiuszx.kusztal@intel.com>
Mon, 28 Jun 2021 16:34:23 +0000 (17:34 +0100)
committerAkhil Goyal <gakhil@marvell.com>
Tue, 20 Jul 2021 08:32:05 +0000 (10:32 +0200)
Content descriptor functions are incorrectly named,
having them with proper name will improve readability and
facilitate further work.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
drivers/crypto/qat/qat_sym_session.c
drivers/crypto/qat/qat_sym_session.h

index 5c62de9..5d8599b 100644 (file)
@@ -57,6 +57,19 @@ static const uint8_t sha512InitialState[] = {
        0x2b, 0x3e, 0x6c, 0x1f, 0x1f, 0x83, 0xd9, 0xab, 0xfb, 0x41, 0xbd,
        0x6b, 0x5b, 0xe0, 0xcd, 0x19, 0x13, 0x7e, 0x21, 0x79};
 
+static int
+qat_sym_cd_cipher_set(struct qat_sym_session *cd,
+                                               const uint8_t *enckey,
+                                               uint32_t enckeylen);
+
+static int
+qat_sym_cd_auth_set(struct qat_sym_session *cdesc,
+                                               const uint8_t *authkey,
+                                               uint32_t authkeylen,
+                                               uint32_t aad_length,
+                                               uint32_t digestsize,
+                                               unsigned int operation);
+
 /** Frees a context previously created
  *  Depends on openssl libcrypto
  */
@@ -420,7 +433,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,
        else
                session->qat_dir = ICP_QAT_HW_CIPHER_DECRYPT;
 
-       if (qat_sym_session_aead_create_cd_cipher(session,
+       if (qat_sym_cd_cipher_set(session,
                                                cipher_xform->key.data,
                                                cipher_xform->key.length)) {
                ret = -EINVAL;
@@ -669,7 +682,7 @@ qat_sym_session_handle_single_pass(struct qat_sym_session *session,
        }
        session->cipher_iv.offset = aead_xform->iv.offset;
        session->cipher_iv.length = aead_xform->iv.length;
-       if (qat_sym_session_aead_create_cd_cipher(session,
+       if (qat_sym_cd_cipher_set(session,
                        aead_xform->key.data, aead_xform->key.length))
                return -EINVAL;
        session->aad_len = aead_xform->aad_length;
@@ -825,12 +838,12 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
                         * then authentication
                         */
 
-                       if (qat_sym_session_aead_create_cd_cipher(session,
+                       if (qat_sym_cd_cipher_set(session,
                                                auth_xform->key.data,
                                                auth_xform->key.length))
                                return -EINVAL;
 
-                       if (qat_sym_session_aead_create_cd_auth(session,
+                       if (qat_sym_cd_auth_set(session,
                                                key_data,
                                                key_length,
                                                0,
@@ -845,7 +858,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
                         * then cipher
                         */
 
-                       if (qat_sym_session_aead_create_cd_auth(session,
+                       if (qat_sym_cd_auth_set(session,
                                        key_data,
                                        key_length,
                                        0,
@@ -853,7 +866,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
                                        auth_xform->op))
                                return -EINVAL;
 
-                       if (qat_sym_session_aead_create_cd_cipher(session,
+                       if (qat_sym_cd_cipher_set(session,
                                                auth_xform->key.data,
                                                auth_xform->key.length))
                                return -EINVAL;
@@ -861,7 +874,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
                /* Restore to authentication only only */
                session->qat_cmd = ICP_QAT_FW_LA_CMD_AUTH;
        } else {
-               if (qat_sym_session_aead_create_cd_auth(session,
+               if (qat_sym_cd_auth_set(session,
                                key_data,
                                key_length,
                                0,
@@ -948,12 +961,12 @@ qat_sym_session_configure_aead(struct rte_cryptodev *dev,
                crypto_operation = aead_xform->algo == RTE_CRYPTO_AEAD_AES_GCM ?
                        RTE_CRYPTO_AUTH_OP_GENERATE : RTE_CRYPTO_AUTH_OP_VERIFY;
 
-               if (qat_sym_session_aead_create_cd_cipher(session,
+               if (qat_sym_cd_cipher_set(session,
                                        aead_xform->key.data,
                                        aead_xform->key.length))
                        return -EINVAL;
 
-               if (qat_sym_session_aead_create_cd_auth(session,
+               if (qat_sym_cd_auth_set(session,
                                        aead_xform->key.data,
                                        aead_xform->key.length,
                                        aead_xform->aad_length,
@@ -970,7 +983,7 @@ qat_sym_session_configure_aead(struct rte_cryptodev *dev,
                crypto_operation = aead_xform->algo == RTE_CRYPTO_AEAD_AES_GCM ?
                        RTE_CRYPTO_AUTH_OP_VERIFY : RTE_CRYPTO_AUTH_OP_GENERATE;
 
-               if (qat_sym_session_aead_create_cd_auth(session,
+               if (qat_sym_cd_auth_set(session,
                                        aead_xform->key.data,
                                        aead_xform->key.length,
                                        aead_xform->aad_length,
@@ -978,7 +991,7 @@ qat_sym_session_configure_aead(struct rte_cryptodev *dev,
                                        crypto_operation))
                        return -EINVAL;
 
-               if (qat_sym_session_aead_create_cd_cipher(session,
+               if (qat_sym_cd_cipher_set(session,
                                        aead_xform->key.data,
                                        aead_xform->key.length))
                        return -EINVAL;
@@ -1526,7 +1539,7 @@ qat_get_crypto_proto_flag(uint16_t flags)
        return qat_proto_flag;
 }
 
-int qat_sym_session_aead_create_cd_cipher(struct qat_sym_session *cdesc,
+int qat_sym_cd_cipher_set(struct qat_sym_session *cdesc,
                                                const uint8_t *cipherkey,
                                                uint32_t cipherkeylen)
 {
@@ -1696,7 +1709,7 @@ int qat_sym_session_aead_create_cd_cipher(struct qat_sym_session *cdesc,
        return 0;
 }
 
-int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
+int qat_sym_cd_auth_set(struct qat_sym_session *cdesc,
                                                const uint8_t *authkey,
                                                uint32_t authkeylen,
                                                uint32_t aad_length,
index 4450df6..5d28e5a 100644 (file)
@@ -120,19 +120,6 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
                                struct rte_crypto_sym_xform *xform,
                                struct qat_sym_session *session);
 
-int
-qat_sym_session_aead_create_cd_cipher(struct qat_sym_session *cd,
-                                               const uint8_t *enckey,
-                                               uint32_t enckeylen);
-
-int
-qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc,
-                                               const uint8_t *authkey,
-                                               uint32_t authkeylen,
-                                               uint32_t aad_length,
-                                               uint32_t digestsize,
-                                               unsigned int operation);
-
 void
 qat_sym_session_clear(struct rte_cryptodev *dev,
                struct rte_cryptodev_sym_session *session);