From patchwork Thu Dec 21 23:00:22 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: 122607 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1511429qgn; Thu, 21 Dec 2017 15:04:56 -0800 (PST) X-Google-Smtp-Source: ACJfBosrHU/b91cFqd1jTZe0T8xEGXIa1TCRd8GRYU8vJj0IYRYjhdPnwrHIlsrsmpxZEqJJNWvF X-Received: by 10.200.44.243 with SMTP id 48mr16084579qtx.99.1513897495918; Thu, 21 Dec 2017 15:04:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513897495; cv=none; d=google.com; s=arc-20160816; b=EdCzA0k7KcTvISQF9r0LfbdfxY0fDibR+DjKsxoqKpwFydzTEy0xLzu2gPgW0U8vld oD8LF/KpSz7cKh9YttLI/v8nYQcHv0I69dwO08CZcTeU5CR7ytfVkCWjYw+/zCWNbWN5 5OBEa2KlpMb0kT1VVumFifnAkMwVniwQYcHD9iLZy+CBA55Det9B6JTgMp/dFL0AMBpz zQISBM1ISD5dZwg/K1EIDpwBOv6J3A080h4kI9foy/X3KIh/CwFrf7QahEFiDc0N4Ohe uSWGk/6Ykru2Z+0DxHJM9PfNMeivJumVAGZiYWNylMOsN+AVxSMPNCzCSYz02JIP6paz pwtw== 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=5Gw3UpjQPZ2L2Vys0aQewFVfJX1Q2k8UF8OhF/kIwHI=; b=xpVKhUkzbYH2+uxuaj+jVvvmwhKfaxC7RNbRD0GYqj/Q15jAL6WJHDn14qe5mTa1rA PPDKlpKmJhV3gVxSk2DeFn8Ah0C6lJs3u5TvOblM+pN5DjqPebX4G/hdveLmsAE/Nr06 +JsLD/vt8p6DkN3CB0XnkjaUaBVTXP6KNXU+CV9krl1bXFUJeTh+a3GTnxr2JkTEV+n2 y2Z4CzWV3MfgZGc+AYZXwWdytpU+UIsVKPr3s9VOwIvQ8cgosq6sP/r4Kr2sMTYtf9DH qvvGUNY+Njw4li0n5kp90zQ4U5J9g85mE17BtXvp1dVhSdGzrBtCJ9azYgGrxrADI+F8 2ciw== 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 s125si1601107qkb.412.2017.12.21.15.04.55; Thu, 21 Dec 2017 15:04:55 -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 9AF766152C; Thu, 21 Dec 2017 23:04:55 +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 0C2B161516; Thu, 21 Dec 2017 23:01:32 +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 5CA0C61505; Thu, 21 Dec 2017 23:01:21 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 6E3B56150A for ; Thu, 21 Dec 2017 23:00:27 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 35961408478E for ; Fri, 22 Dec 2017 02:00:26 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id aqxq5jg5JO-0QheiJP1; Fri, 22 Dec 2017 02:00:26 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id B287xXhYac-0PVWMsYG; Fri, 22 Dec 2017 02:00:25 +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: Fri, 22 Dec 2017 02:00:22 +0300 Message-Id: <1513897223-21131-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513897223-21131-1-git-send-email-odpbot@yandex.ru> References: <1513897223-21131-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v2 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: 177eeff39e19289e771119cfdffc515cb16f9db5 ** Merge commit sha: ea71bf34033ee74ce7f090f0212b9285ca13b1fe **/ 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 7ad2889f5..cbf7bbd40 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,