From patchwork Thu Sep 22 10:45:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 16020 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 3ED9D689B; Thu, 22 Sep 2016 12:46:18 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 2AC0A592F for ; Thu, 22 Sep 2016 12:46:15 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 22 Sep 2016 03:46:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,378,1470726000"; d="scan'208";a="882625425" Received: from sivswdev03.ir.intel.com (HELO localhost.localdomain) ([10.237.217.157]) by orsmga003.jf.intel.com with ESMTP; 22 Sep 2016 03:46:13 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: fiona.trahe@intel.com, deepak.k.jain@intel.com, pablo.de.lara.guarch@intel.com, john.griffin@intel.com, Arek Kusztal Date: Thu, 22 Sep 2016 11:45:55 +0100 Message-Id: <1474541155-29367-4-git-send-email-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1474541155-29367-1-git-send-email-arkadiuszx.kusztal@intel.com> References: <1474541155-29367-1-git-send-email-arkadiuszx.kusztal@intel.com> Subject: [dpdk-dev] [PATCH v2 3/3] app/test: fix verification of digest in GCM crypto test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes verification of digest in test_cryptodev.c file for AES GCM test cases Fixes: eec136f3c54f ("aesni_gcm: add driver for AES-GCM crypto operations") Signed-off-by: Arek Kusztal Acked-by: Deepak Kumar Jain --- app/test/test_cryptodev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index db5606a..d744b37 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -3164,13 +3164,13 @@ test_kasumi_cipher_auth_test_case_1(void) static int create_gcm_session(uint8_t dev_id, enum rte_crypto_cipher_operation op, const uint8_t *key, const uint8_t key_len, - const uint8_t aad_len, const uint8_t auth_len) + const uint8_t aad_len, const uint8_t auth_len, + enum rte_crypto_auth_operation auth_op) { uint8_t cipher_key[key_len]; struct crypto_unittest_params *ut_params = &unittest_params; - memcpy(cipher_key, key, key_len); /* Setup Cipher Parameters */ @@ -3178,7 +3178,7 @@ create_gcm_session(uint8_t dev_id, enum rte_crypto_cipher_operation op, ut_params->cipher_xform.next = NULL; ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_GCM; - ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; + ut_params->auth_xform.auth.op = auth_op; ut_params->cipher_xform.cipher.op = op; ut_params->cipher_xform.cipher.key.data = cipher_key; ut_params->cipher_xform.cipher.key.length = key_len; @@ -3233,8 +3233,6 @@ create_gcm_operation(enum rte_crypto_cipher_operation op, struct rte_crypto_sym_op *sym_op = ut_params->op->sym; - - sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append( ut_params->ibuf, auth_tag_len); TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data, @@ -3311,7 +3309,8 @@ test_mb_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata) retval = create_gcm_session(ts_params->valid_devs[0], RTE_CRYPTO_CIPHER_OP_ENCRYPT, tdata->key.data, tdata->key.len, - tdata->aad.len, tdata->auth_tag.len); + tdata->aad.len, tdata->auth_tag.len, + RTE_CRYPTO_AUTH_OP_GENERATE); if (retval < 0) return retval; @@ -3441,7 +3440,8 @@ test_mb_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata) retval = create_gcm_session(ts_params->valid_devs[0], RTE_CRYPTO_CIPHER_OP_DECRYPT, tdata->key.data, tdata->key.len, - tdata->aad.len, tdata->auth_tag.len); + tdata->aad.len, tdata->auth_tag.len, + RTE_CRYPTO_AUTH_OP_VERIFY); if (retval < 0) return retval;