From patchwork Mon Dec 25 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: 122711 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp307937qgn; Mon, 25 Dec 2017 15:03:02 -0800 (PST) X-Google-Smtp-Source: ACJfBoualjX9kdfOB4sWnTPrsj4vT3XRry44MqnJgKqTH62VAJieffuQODmy2s/FLtLU9nhTOblP X-Received: by 10.55.8.136 with SMTP id 130mr32593715qki.146.1514242982602; Mon, 25 Dec 2017 15:03:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514242982; cv=none; d=google.com; s=arc-20160816; b=I/K6zjb5u/q53GLtMJZGjwANCq610+XfmVnHPakNdX9NbXjNQbeWh31ffWWysG69sW KvtFjvX20cmHvGajPq6tO4wE2HJNsHIzZ7zzWcf/0HcKwGm2cUO5lAxewKs6ExRzHsui TQ574W2bKh3IGJr5ex6JBheaXgTiG8b6egn5iD7TPfmA8aXGb/FBw79fE4ZngfT/IS8F 5EFc43jTQWtjvcEnpliSAy6iB/JwfSl4dMar1sTR3XHH3WEIF1XZBYikydHWReTXzAJW Tn1sFbU265rs88VwTcRXrF6fBu0hVMc3ckh5Q314OZuVI/uaHwfhv9J4gMZXROxZGM4p LG/Q== 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=OWDUID0+xbfIXLF718tgmqxaajlqthPyM4YAm6y0OPo=; b=pQVoVSKoN7yIaWrAwVB1UiErjFCIH/WCSXr19OwoZ6NV0X6qXtbfRmGTKSFZUVkXLj TK3qO/KVI33AI+RwyT5k2lDh9XJ8pdbhU9ixwTNrtuTDD5uTzntCCeA0Eqo082faBjvG HGzUl0LgRmJQWyTYbR/6jyIcaa5e9K+7RILyN2KkDJ6BE8UxCfDNzmuETWDSBplG8ARG 6y7y1hApD2BK6z4n5lH22+UrP8MfvbEGkjBoS5j1vZ3JHtLiHzYs1eoPPrEjIGgvjU+x IJ4JlW37dpePdkwd81msMWrfPexBNaaWYoB7TR0j55+ZymGZryOycqlsYgpKJ4mzgrXf eqKg== 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 h1si2501439qkf.394.2017.12.25.15.03.02; Mon, 25 Dec 2017 15:03:02 -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 4CB2660903; Mon, 25 Dec 2017 23:03:02 +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 E9357608E2; Mon, 25 Dec 2017 23:02:41 +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 1F60F60862; Mon, 25 Dec 2017 23:02:35 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id 8EC48608B5 for ; Mon, 25 Dec 2017 23:01:22 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 302761242601 for ; Tue, 26 Dec 2017 02:01:21 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Ht9xHwkDUo-1KSSc1qw; Tue, 26 Dec 2017 02:01:21 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rho8WkqRtC-0cYKi9ue; Tue, 26 Dec 2017 02:00:38 +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: Tue, 26 Dec 2017 02:00:14 +0300 Message-Id: <1514242817-22123-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514242817-22123-1-git-send-email-odpbot@yandex.ru> References: <1514242817-22123-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v3 3/6] 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: a5f07dbf95f982b7c5898434e56164ff976c0a0f ** Merge commit sha: 17da319d68f1b79fbec6d76e925b5d4c9665aaf3 **/ 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 f1da6989c..7e7bc5c1c 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -321,6 +321,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; @@ -414,6 +418,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; @@ -422,8 +427,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; } @@ -439,6 +445,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,