diff mbox series

[API-NEXT,v8,9/10] linux-gen: crypto: drop duplicate authentication field

Message ID 1510689611-17861-10-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v8,1/10] api: crypto: add AES-GMAC declarations | expand

Commit Message

Github ODP bot Nov. 14, 2017, 8 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


session->auth.bytes duplicates session->p.auth_digest_len, so let's drop
first field.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 288 (lumag:gmac)
 ** https://github.com/Linaro/odp/pull/288
 ** Patch: https://github.com/Linaro/odp/pull/288.patch
 ** Base sha: ba93e355ddf151215aa18b59cbfca08fe175fe65
 ** Merge commit sha: 8363c3a4073075d0f3dd68864b9a33819005aab4
 **/
 platform/linux-generic/include/odp_crypto_internal.h | 1 -
 platform/linux-generic/odp_crypto.c                  | 7 +++----
 2 files changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/include/odp_crypto_internal.h b/platform/linux-generic/include/odp_crypto_internal.h
index 21174daa4..32178d9de 100644
--- a/platform/linux-generic/include/odp_crypto_internal.h
+++ b/platform/linux-generic/include/odp_crypto_internal.h
@@ -50,7 +50,6 @@  struct odp_crypto_generic_session {
 	struct {
 		uint8_t  key[EVP_MAX_KEY_LENGTH];
 		uint32_t key_length;
-		uint32_t bytes;
 		union {
 			const EVP_MD *evp_md;
 			const EVP_CIPHER *evp_cipher;
diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c
index 1cc2d7018..6d0ad709a 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -207,7 +207,7 @@  odp_crypto_alg_err_t auth_gen(odp_packet_t pkt,
 	/* Copy to the output location */
 	odp_packet_copy_from_mem(pkt,
 				 param->hash_result_offset,
-				 session->auth.bytes,
+				 session->p.auth_digest_len,
 				 hash);
 
 	return ODP_CRYPTO_ALG_ERR_NONE;
@@ -218,7 +218,7 @@  odp_crypto_alg_err_t auth_check(odp_packet_t pkt,
 				const odp_crypto_packet_op_param_t *param,
 				odp_crypto_generic_session_t *session)
 {
-	uint32_t bytes = session->auth.bytes;
+	uint32_t bytes = session->p.auth_digest_len;
 	uint8_t  hash_in[EVP_MAX_MD_SIZE];
 	uint8_t  hash_out[EVP_MAX_MD_SIZE];
 
@@ -703,8 +703,7 @@  static int process_auth_param(odp_crypto_generic_session_t *session,
 	session->auth.evp_md = evp_md;
 
 	/* Number of valid bytes */
-	session->auth.bytes = session->p.auth_digest_len;
-	if (session->auth.bytes < (unsigned)EVP_MD_size(evp_md) / 2)
+	if (session->p.auth_digest_len < (unsigned)EVP_MD_size(evp_md) / 2)
 		return -1;
 
 	/* Convert keys */