From patchwork Tue Dec 19 23:00:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122413 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4793277qgn; Tue, 19 Dec 2017 15:02:28 -0800 (PST) X-Google-Smtp-Source: ACJfBouL6zGDUoL9+XXTM6S2xJ5wWrWz+qhVpBCoYWKPLOzl9tgw3dblm+WWF53wsNtcS7sye4UY X-Received: by 10.55.197.6 with SMTP id p6mr6887903qki.223.1513724548120; Tue, 19 Dec 2017 15:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513724548; cv=none; d=google.com; s=arc-20160816; b=upAV8drGVOpPsv/9ZqN8iM17so+Hi1P8WNCoERZfEw6vikBblpQPPZeTahhz4/zcaB wWuOpzB22Hi9bELuxNJll0K0iI3gn9l9/9bc0grNKu2k47iESU1btig3oJ2KheXK+OjP xFbgbTTz99qQalR87i5CSjETRC/9DVj39n5GriaN5GxK0e7RTIFeLyVn58vBEeygTQ7g 3bWLdOC9TRH2uYZyLNH9ms/yFMU8j1CNi0JtAQEM5SKdf3N0RA/QCFEU42VDWH1Sg/y7 mw6e3V0Zt//NYDskJEfKfqskVs6c6M84w4HL5dUDb5mzPKENgYiCrO8a4V/8Cdyk9hq8 48CQ== 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=K2XGw7uSs/L5/LW6chulgvy6wsshCUYRfPzQsM3otzs=; b=xnSPA3MtTWr2AisOQB30EJFPfumkIUuXQMHFb57UXsWh1bLzZ+kQBWut4tKvHIm/SM Svue03iuglZ/1cKKkakgUYPWIJstZzfqLGSR3W2RrUvCfmyiiV0J40WDjDolZ/MGirON Y11niT98sjhxtV/XN4krCDkv0z+TgVaK9E8SDdtNVFydqcmpWZ+HVF+V9tCxtr7wsF6/ pQvtfTH/alTo9YfiYD1+bM/fLN+pVzK9WAWiYUboQlbeksoFrRPXLP2J0FdnJElPJSl9 3B8oGsUoLDkxIOOPBempp9l1DJAORnz3zMFuepkRqIvIdqpulo5nJoWaAiCr9jEwgDrr Ck4g== 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 t69si8741444qka.467.2017.12.19.15.02.27; Tue, 19 Dec 2017 15:02:28 -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 C24DB608FD; Tue, 19 Dec 2017 23:02:27 +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, URIBL_BLOCKED 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 5DC4B60911; Tue, 19 Dec 2017 23:01:05 +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 40CCD608E7; Tue, 19 Dec 2017 23:00:54 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 391DB608FD for ; Tue, 19 Dec 2017 23:00:25 +0000 (UTC) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward101o.mail.yandex.net (Yandex) with ESMTP id E4EBA1341A0E for ; Wed, 20 Dec 2017 02:00:23 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id gVFyQElq36-0NTKQHq6; Wed, 20 Dec 2017 02:00:23 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id U73IVpNz26-0NNGxh8u; Wed, 20 Dec 2017 02:00:23 +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: Wed, 20 Dec 2017 02:00:14 +0300 Message-Id: <1513724415-24899-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513724415-24899-1-git-send-email-odpbot@yandex.ru> References: <1513724415-24899-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v1 3/4] validation: crypto: use auth IV for GMAC test case 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 Change GMAC testing code to use new auth IV fields. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 352 (lumag:crypto_gmac_iv) ** https://github.com/Linaro/odp/pull/352 ** Patch: https://github.com/Linaro/odp/pull/352.patch ** Base sha: 12fd3a9224a856271934986a1bad981843915d68 ** Merge commit sha: ceb7bff0f74da9fec7efa8d45d3078c2485ca305 **/ test/validation/api/crypto/odp_crypto_test_inp.c | 11 +++++++++-- test/validation/api/crypto/test_vectors.h | 8 +++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index cba472ded..9c2303ac5 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -314,6 +314,10 @@ static void alg_test(odp_crypto_op_t op, .data = ovr_iv ? NULL : ref->iv, .length = ref->iv_length }; + odp_crypto_iv_t auth_iv = { + .data = ovr_iv ? NULL : ref->auth_iv, + .length = ref->auth_iv_length + }; int num, i; int found; @@ -407,6 +411,7 @@ static void alg_test(odp_crypto_op_t op, /* Search for the test case */ for (i = 0; i < num; i++) { if (auth_capa[i].digest_len == ref->digest_length && + auth_capa[i].iv_len == auth_iv.length && auth_capa[i].key_len == auth_key.length) { found = 1; break; @@ -415,8 +420,9 @@ static void alg_test(odp_crypto_op_t op, if (!found) { printf("\n Unsupported: alg=%s, key_len=%" PRIu32 ", " - "digest_len=%" PRIu32 "\n", auth_alg_name(auth_alg), - auth_key.length, ref->digest_length); + "digest_len=%" PRIu32 ", iv_len=%" PRIu32 "\n", + auth_alg_name(auth_alg), auth_key.length, + ref->digest_length, auth_iv.length); return; } @@ -432,6 +438,7 @@ static void alg_test(odp_crypto_op_t op, ses_params.output_pool = suite_context.pool; ses_params.cipher_key = cipher_key; ses_params.iv = iv; + ses_params.auth_iv = auth_iv; ses_params.auth_key = auth_key; ses_params.auth_digest_len = ref->digest_length; ses_params.auth_aad_len = ref->aad_length; diff --git a/test/validation/api/crypto/test_vectors.h b/test/validation/api/crypto/test_vectors.h index f2ce9eb2f..90b020356 100644 --- a/test/validation/api/crypto/test_vectors.h +++ b/test/validation/api/crypto/test_vectors.h @@ -16,6 +16,8 @@ typedef struct crypto_test_reference_s { uint8_t auth_key[MAX_KEY_LEN]; uint32_t iv_length; uint8_t iv[MAX_IV_LEN]; + uint32_t auth_iv_length; + uint8_t auth_iv[MAX_IV_LEN]; uint32_t length; uint8_t plaintext[MAX_DATA_LEN]; uint8_t ciphertext[MAX_DATA_LEN]; @@ -447,9 +449,9 @@ static crypto_test_reference_t aes_gmac_reference[] = { .auth_key_length = AES128_GCM_KEY_LEN, .auth_key = { 0x4c, 0x80, 0xcd, 0xef, 0xbb, 0x5d, 0x10, 0xda, 0x90, 0x6a, 0xc7, 0x3c, 0x36, 0x13, 0xa6, 0x34}, - .iv_length = AES_GCM_IV_LEN, - .iv = { 0x22, 0x43, 0x3c, 0x64, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 }, + .auth_iv_length = AES_GCM_IV_LEN, + .auth_iv = { 0x22, 0x43, 0x3c, 0x64, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }, .length = 68, .plaintext = { 0x00, 0x00, 0x43, 0x21, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,