From patchwork Sat Feb 3 04:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126774 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp191870ljc; Fri, 2 Feb 2018 20:00:48 -0800 (PST) X-Google-Smtp-Source: AH8x225k/XVDnh7L8v9lfT2hX3WsY6gBcIGnlPK16PUhkkXvDYqsjiMjwND9Gun5cFftPybFxoHP X-Received: by 10.55.125.197 with SMTP id y188mr55889409qkc.111.1517630448486; Fri, 02 Feb 2018 20:00:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517630448; cv=none; d=google.com; s=arc-20160816; b=lkVMuNpwiFGlzR/vKFQE+AmPgS4P2Tj47VLTIMQ0IRGljmttzdCbQqehHNx3W10/rM SZ/NmvjFuwC87ETfo4ijEppfq6VREfM/YaAiPi7NN4WcclSQLdFcqd2OobIu4SNoJEYh slGKb/qvdv6E5RBA5aTRQopl0m0hEZe5O/f04wid7s+JXG4gbVONdO+sh4Uwpp4U/UiU X8tf6fzy6vfk7Ha+tzDkNxMdbnz1UI0BgimqBQAAO9Z6VpmPQGs33ZXO805OCoBLtEoA qPjLXOPZc8bz/mh+dJo2FWcgXVku0sA1A973vPcBVLx7yEukp0AkYaQqkF8t+yNYJnL3 0/JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=DLgoz2nJcmZT5RK7deHFPwNanDgMntAZraAYg1FbsXg=; b=Mq6xKZv2tOMat7wvbBb7a71BoYMJuNm5wQv8g1rTDekUfSJn2pRysKQNOkYnnZSIDO L8VIy3qGzqnlR9MoMbSSbHb0XKetyQB8chNkWi8Nobjga2J5q7hgvL3a4j9s+zTEGeSo AAWh5GfFvYzw9k2OeomcI8FhjewYWHNNHj2hv9elKM1V1trYp/ABENs2EUHfK3ujVD0n C6JVTj+grZOAwd1tZn7aky9AWXsKYjixAZQGCDnoDuNDWwYqtxfg/qAQe6cU7wyS0wyg dbBHcHreZ1GEDiakD22DtDkNmkHUc+K7LnSKknanDlDF618y1k8pNNtxt05MoYK7snjH wS5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id r32si1023734qkh.423.2018.02.02.20.00.48; Fri, 02 Feb 2018 20:00:48 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 25E9F6180E; Sat, 3 Feb 2018 04:00:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 0A73F617B4; Sat, 3 Feb 2018 04:00:19 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E20996179D; Sat, 3 Feb 2018 04:00:14 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 8F42660698 for ; Sat, 3 Feb 2018 04:00:11 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward101o.mail.yandex.net (Yandex) with ESMTP id EDD311345B02 for ; Sat, 3 Feb 2018 07:00:09 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ZiEwp94KwB-09biIDdL; Sat, 03 Feb 2018 07:00:09 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WkVUmNhduh-097O0fE3; Sat, 03 Feb 2018 07:00:09 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Sat, 3 Feb 2018 07:00:08 +0300 Message-Id: <1517630408-15320-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517630408-15320-1-git-send-email-odpbot@yandex.ru> References: <1517630408-15320-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 451 Subject: [lng-odp] [PATCH API-NEXT v1 1/1] validation: crypto: properly use check_alg for GMAC/CMAC testing X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Use check_alg instead of alg_test for GMAC/CMAC testing. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 451 (lumag:crypto-fix) ** https://github.com/Linaro/odp/pull/451 ** Patch: https://github.com/Linaro/odp/pull/451.patch ** Base sha: 7cc568a011f1623a343399f5cff6688baf834639 ** Merge commit sha: f20a7e9abfe5728c1b0eef83d3d8dd512898513b **/ test/validation/api/crypto/odp_crypto_test_inp.c | 66 +++++++++--------------- 1 file changed, 24 insertions(+), 42 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index f310329ab..8c0ef5bca 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -1243,31 +1243,22 @@ static int check_alg_aes_gmac(void) static void crypto_test_gen_alg_aes_gmac(void) { - unsigned int test_vec_num = (sizeof(aes_gmac_reference) / - sizeof(aes_gmac_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_AES_GMAC, - aes_gmac_reference, - ARRAY_SIZE(aes_gmac_reference), - false); + check_alg(ODP_CRYPTO_OP_ENCODE, + ODP_CIPHER_ALG_NULL, + ODP_AUTH_ALG_AES_GMAC, + aes_gmac_reference, + ARRAY_SIZE(aes_gmac_reference), + false); } static void crypto_test_gen_alg_aes_gmac_ovr_iv(void) { - unsigned int test_vec_num = (sizeof(aes_gmac_reference) / - sizeof(aes_gmac_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_AES_GMAC, - &aes_gmac_reference[i], - true); + check_alg(ODP_CRYPTO_OP_ENCODE, + ODP_CIPHER_ALG_NULL, + ODP_AUTH_ALG_AES_GMAC, + aes_gmac_reference, + ARRAY_SIZE(aes_gmac_reference), + true); } static void crypto_test_check_alg_aes_gmac(void) @@ -1282,16 +1273,12 @@ static void crypto_test_check_alg_aes_gmac(void) static void crypto_test_check_alg_aes_gmac_ovr_iv(void) { - unsigned int test_vec_num = (sizeof(aes_gmac_reference) / - sizeof(aes_gmac_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_AES_GMAC, - &aes_gmac_reference[i], - true); + check_alg(ODP_CRYPTO_OP_DECODE, + ODP_CIPHER_ALG_NULL, + ODP_AUTH_ALG_AES_GMAC, + aes_gmac_reference, + ARRAY_SIZE(aes_gmac_reference), + false); } static int check_alg_aes_cmac(void) @@ -1301,17 +1288,12 @@ static int check_alg_aes_cmac(void) static void crypto_test_gen_alg_aes_cmac(void) { - unsigned int test_vec_num = (sizeof(aes_cmac_reference) / - sizeof(aes_cmac_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_AES_CMAC, - aes_cmac_reference, - ARRAY_SIZE(aes_cmac_reference), - false); + check_alg(ODP_CRYPTO_OP_ENCODE, + ODP_CIPHER_ALG_NULL, + ODP_AUTH_ALG_AES_CMAC, + aes_cmac_reference, + ARRAY_SIZE(aes_cmac_reference), + false); } static void crypto_test_check_alg_aes_cmac(void)