From patchwork Mon Dec 25 23:00:12 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: 122709 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp306282qgn; Mon, 25 Dec 2017 15:01:21 -0800 (PST) X-Google-Smtp-Source: ACJfBosk+3DGInBoNfjQI3HIUfDcivxHUssTrOyXoJvNsQw5TWmRQBu5BJCtthUNvp9UNS4E3tBc X-Received: by 10.200.8.172 with SMTP id v41mr30081154qth.111.1514242881532; Mon, 25 Dec 2017 15:01:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514242881; cv=none; d=google.com; s=arc-20160816; b=lEJ7LD35rYtEKJegapmM/L42zm49rtPBP8nUOwD99c+fnjO75PeSMmW8WfCaNJY9Fi yuPQa//bUyOO6HPKXF7eMaZbzM179x7Lun+El7vbDKlwozN+UEZY8tNooqCkMrI43R0Q cxjlRkZ+kT28VqLOTs+TlAEOoO2ZSxemYr7aP2CRYjSfy1drARlTxtwEZ4dnpO9ufDzA Ekbmn6Y1+B/wLEEGVdfnLDRsitcJMwMfLqHQrJsxiSe8+x0eLMGrxMIWEbxsp7C28X4n VGzU2xA4jsCqNBpu6fCSot/+8fU8LLV5aa4o1p1Ulm0Ztse6kqqFSwe5r1hjPI5BuNOk g6Xg== 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=uhShBL/z/+RHb+lkocFcMJOmdF/mqXM489A0Rs38/LE=; b=I980Ph+EgqFkqNoVDQPX0wSQiSxzKPrBTfBquOh+xjCJFRpDUblTIid+SFeN2TSc/U DEHI8uli+wHYFzn9zvp/pc3MxZAFTo5YKXalrQvaOw+6l2lpXL1yQKbVBYfYvJCX7+XD frutr4yH9m4R4r2PVAaoZBCGMfgUfgbZRhJgkLlHIMZdG+fZ8vTOUtKs7iDnqKmdaVtE viPSLXNY32pfMuvCRt8RHT8EtzLxlfpSEUp1w3RbZsJoKtlJx+sw0mHzwuvRbqecsjMB GWAOnm5orYlp4rripTLPeDPhX8lUDYPiwuQ15kTiReyegppnvgEGrJ2sHjuwk1nUEd9O KPYw== 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 x12si4548361qta.298.2017.12.25.15.01.21; Mon, 25 Dec 2017 15:01:21 -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 3FB0B608B5; Mon, 25 Dec 2017 23:01:21 +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 4A1856038C; Mon, 25 Dec 2017 23:01:11 +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 743D460840; Mon, 25 Dec 2017 23:01:05 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 680A560862 for ; Mon, 25 Dec 2017 23:00:33 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward100j.mail.yandex.net (Yandex) with ESMTP id C2F095D82FCF for ; Tue, 26 Dec 2017 02:00:31 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id pqvLh7ry9t-0Vq8ZR31; Tue, 26 Dec 2017 02:00:31 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rho8WkqRtC-0PYW3lv2; Tue, 26 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: Tue, 26 Dec 2017 02:00:12 +0300 Message-Id: <1514242817-22123-2-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 1/6] linux-gen: crypto: move session type to odp_crypto module 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 There is no point in having odp_crypto_generic_session_t definition in global include file. Move it to odp_crypto module. 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 **/ platform/linux-generic/Makefile.am | 1 - .../linux-generic/include/odp_crypto_internal.h | 73 ---------------------- platform/linux-generic/odp_crypto.c | 46 +++++++++++++- 3 files changed, 44 insertions(+), 76 deletions(-) delete mode 100644 platform/linux-generic/include/odp_crypto_internal.h diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 4371e7a99..5f00e3f6e 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -138,7 +138,6 @@ noinst_HEADERS = \ include/odp_classification_inlines.h \ include/odp_classification_internal.h \ include/odp_config_internal.h \ - include/odp_crypto_internal.h \ include/odp_debug_internal.h \ include/odp_errno_define.h \ include/odp_forward_typedefs_internal.h \ diff --git a/platform/linux-generic/include/odp_crypto_internal.h b/platform/linux-generic/include/odp_crypto_internal.h deleted file mode 100644 index 32178d9de..000000000 --- a/platform/linux-generic/include/odp_crypto_internal.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_CRYPTO_INTERNAL_H_ -#define ODP_CRYPTO_INTERNAL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define MAX_IV_LEN 64 -#define OP_RESULT_MAGIC 0x91919191 - -/** Forward declaration of session structure */ -typedef struct odp_crypto_generic_session odp_crypto_generic_session_t; - -/** - * Algorithm handler function prototype - */ -typedef -odp_crypto_alg_err_t (*crypto_func_t)(odp_packet_t pkt, - const odp_crypto_packet_op_param_t *param, - odp_crypto_generic_session_t *session); - -/** - * Per crypto session data structure - */ -struct odp_crypto_generic_session { - struct odp_crypto_generic_session *next; - - /* Session creation parameters */ - odp_crypto_session_param_t p; - - odp_bool_t do_cipher_first; - - struct { - /* Copy of session IV data */ - uint8_t iv_data[MAX_IV_LEN]; - uint8_t key_data[EVP_MAX_KEY_LENGTH]; - - const EVP_CIPHER *evp_cipher; - crypto_func_t func; - } cipher; - - struct { - uint8_t key[EVP_MAX_KEY_LENGTH]; - uint32_t key_length; - union { - const EVP_MD *evp_md; - const EVP_CIPHER *evp_cipher; - }; - crypto_func_t func; - } auth; -}; - -/** - * Per session creation operation result - */ -typedef struct odp_crypto_generic_session_result { - odp_crypto_ses_create_err_t rc; - odp_crypto_session_t session; -} odp_crypto_generic_session_result_t; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 69e6d0dad..ea47f1de2 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -89,6 +88,49 @@ static const odp_crypto_auth_capability_t auth_capa_aes_gcm[] = { static const odp_crypto_auth_capability_t auth_capa_aes_gmac[] = { {.digest_len = 16, .key_len = 16, .aad_len = {.min = 0, .max = 0, .inc = 0} } }; +/** Forward declaration of session structure */ +typedef struct odp_crypto_generic_session_t odp_crypto_generic_session_t; + +/** + * Algorithm handler function prototype + */ +typedef +odp_crypto_alg_err_t (*crypto_func_t)(odp_packet_t pkt, + const odp_crypto_packet_op_param_t *param, + odp_crypto_generic_session_t *session); + +/** + * Per crypto session data structure + */ +struct odp_crypto_generic_session_t { + odp_crypto_generic_session_t *next; + + /* Session creation parameters */ + odp_crypto_session_param_t p; + + odp_bool_t do_cipher_first; + + struct { + /* Copy of session IV data */ + uint8_t iv_data[EVP_MAX_IV_LENGTH]; + uint8_t key_data[EVP_MAX_KEY_LENGTH]; + + const EVP_CIPHER *evp_cipher; + crypto_func_t func; + } cipher; + + struct { + uint8_t key[EVP_MAX_KEY_LENGTH]; + uint32_t key_length; + uint32_t bytes; + union { + const EVP_MD *evp_md; + const EVP_CIPHER *evp_cipher; + }; + crypto_func_t func; + } auth; +}; + typedef struct odp_crypto_global_s odp_crypto_global_t; struct odp_crypto_global_s { @@ -860,7 +902,7 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, /* Copy parameters */ session->p = *param; - if (session->p.iv.length > MAX_IV_LEN) { + if (session->p.iv.length > EVP_MAX_IV_LENGTH) { ODP_DBG("Maximum IV length exceeded\n"); *status = ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER; goto err; From patchwork Mon Dec 25 23:00:13 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: 122710 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp306989qgn; Mon, 25 Dec 2017 15:02:03 -0800 (PST) X-Google-Smtp-Source: ACJfBoup1Z546qEnoSHjE6y+khDPzv5khVOba7sDadYPURdZUTSs/UYOPzdLnYeqsXg64MEPoYqp X-Received: by 10.200.28.7 with SMTP id a7mr32656830qtk.206.1514242923673; Mon, 25 Dec 2017 15:02:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514242923; cv=none; d=google.com; s=arc-20160816; b=GNsetqcGbydxFjGu8grIONUEznpKsRzVmnuaSQiYLsBrYAk8foe6UCs7VcJDC1qeGX IdLLrTGS00o2ZYwhDw2mTXctAl4+gt8Ew2oJZYeUVrjMjmalKu9F9HPxpMIOlSOioSsp JdxATIxAhsRoXdUBAqP6Dv02qCOXfNOa5MjLao/NKtF6pmddJnOq/BR4gm++Q3qYa5Fr tY4ZWk4Wc/xWXLyICKqHFUNaOiP+zjNnMULqDwrO5wA2SdN+fpO4uXglVRmEAoWDTjXL zMgxQYenuqBj0PCXTxgDINu5PsuAFtVBlfcYjmhIIt/m6mIlnOSt7GF3o3blCO1XCa6e kA2g== 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=Ci9KpzYZQ+Dfelk+tBwPcHbH2xU700hdr0c1XizyBKw=; b=cujMrF+9fBsD7JkSt6/odGC00HG9NMDNbtRMMJHybQ8chVo7BBgbOIGN0GDz3peT2f zhD7l5jmGnAsmvPVVm7rk3cncBDLCiWWKGRJRcK6Sz7klv0QgBOaQ1utwYkC9G72OBeg CgY38hxzKfoIS/HkLVYCOGA5yRGejOyz0GSRAStGmtWIuidBlgTSdk53WPE2gOonjTQ7 j6TZRvd9tSOsad1CQjib/I2ASNZY2+iWN/PTCA1OuNwBbAQyblrbFdGJihteAim5+FXh gU3OuAxh7Cu6lPYvaOAf2oCYhn0S4EwsyEAUU9iHHTpQrSrXplpcP1elim+DADWJuh/6 8rYA== 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 z64si2740019qtc.296.2017.12.25.15.02.03; Mon, 25 Dec 2017 15:02:03 -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 6483A6090D; Mon, 25 Dec 2017 23:02:03 +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,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 CF09D60862; Mon, 25 Dec 2017 23:01:14 +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 038A36085F; Mon, 25 Dec 2017 23:01:06 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id B33F4608B5 for ; Mon, 25 Dec 2017 23:00:39 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 70FE62D82CE9 for ; Tue, 26 Dec 2017 02:00:38 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 9Ra74S6890-0cru67S7; Tue, 26 Dec 2017 02:00:38 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rho8WkqRtC-0VYKHrTG; Tue, 26 Dec 2017 02:00:31 +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:13 +0300 Message-Id: <1514242817-22123-3-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 2/6] api: crypto: add separate auth IV 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 GMAC auth algorithm requires IV to work. Instead of hacking the ODP_CIPHER_ALG_NULL iv to include value for ODP_AUTH_ALG_GMAC, provide separate iv (in auth capability, session params and operation params). 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 **/ include/odp/api/spec/crypto.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 81fecbc36..033056591 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -327,6 +327,9 @@ typedef struct odp_crypto_session_param_t { */ odp_crypto_key_t auth_key; + /** Authentication Initialization Vector (IV) */ + odp_crypto_iv_t auth_iv; + /** Authentication digest length in bytes * * Use odp_crypto_auth_capability() for supported digest lengths. @@ -397,6 +400,9 @@ typedef struct odp_crypto_op_param_t { /** Override session IV pointer */ uint8_t *override_iv_ptr; + /** Override session authentication IV pointer */ + uint8_t *override_auth_iv_ptr; + /** Offset from start of packet for hash result * * Specifies the offset where the hash result is to be stored. In case @@ -433,6 +439,9 @@ typedef struct odp_crypto_packet_op_param_t { /** Override session IV pointer */ uint8_t *override_iv_ptr; + /** Override session authentication IV pointer */ + uint8_t *override_auth_iv_ptr; + /** Offset from start of packet for hash result * * Specifies the offset where the hash result is to be stored. In case @@ -598,6 +607,9 @@ typedef struct odp_crypto_auth_capability_t { /** Key length in bytes */ uint32_t key_len; + /** IV length in bytes */ + uint32_t iv_len; + /** Additional Authenticated Data (AAD) lengths */ struct { /** Minimum AAD length in bytes */ 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, From patchwork Mon Dec 25 23:00:15 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: 122712 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp308425qgn; Mon, 25 Dec 2017 15:03:39 -0800 (PST) X-Google-Smtp-Source: ACJfBouU6ddDlJdLIk3N2tqzd0g8XjkFwIqgd2B6ceo1eL9R5JR6FT0nWuQvJp3KM1qDicCB720t X-Received: by 10.55.174.134 with SMTP id x128mr32159213qke.167.1514243019098; Mon, 25 Dec 2017 15:03:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514243019; cv=none; d=google.com; s=arc-20160816; b=CAgbc4ZdQ5h1vV/NYRlZeOQwu2U6tdQfYknGnvIX6ufVrJssZETEtSUnwIBOBqANiA 3oBUUN4aru1HTLVrqosXTs8F8UyySEkhf645GiLCDg5+2cMq5KTIRsBM0p78j8Ed4U+I w+ox4aMeLTM1CoVDcv1a0B2RYcxvdSpZvHRdtQi8wJqJ5OQsXYskWi5hS7l6T6scHb5V 079Y8+YVmoReSUcaLEWLx2xsTLFcOauuiI3B30H2K4Xx1CUvU6qIZhkTVyD6HyfdEI2X eYBJZ+NWyY9yOdiz0SivqFHeShI0CCCL5jiCI7sndpPmCY6kjPjwWa/0nmPVr+0UTXmE 00fw== 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=9sRDnX5zWAHux5jMEKHtgFbWA9P1w4b/t1O7nIo67aY=; b=QRZ+htCvIraE5OYs+TVSP6t6E9948jINWWaBWYAV7UUVe5uuPKdJqQjjtpP0mxQA+U 7WZeCwbgZNrR7f2svX7H7X9ywdP2OL8q8ZaSqfN7X1ZNffVGoa0NRJuG+4QLvOKoLyFr +GDphNlAZwcv8reqyRG3TgqtSVl/SdGvnBXWvEB3e63M/y6TIHB+B68YI7RCuSfpfnJP MxM2dpTy9QjA2Fdkj5XgI1Eydc2YFdIJjox8Tr1DQMa1BweN+4jQF/V4G0IkTUad1Fdb FB/h0+i77sg5UyJdL0b9DRkB1MUaXwI9wuVyBjqy9NqT7yiH0CcTwmGWWOmqXttILmic aa7w== 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 p70si2740761qka.3.2017.12.25.15.03.38; Mon, 25 Dec 2017 15:03:39 -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 C8444608E8; Mon, 25 Dec 2017 23:03:38 +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 7C03E60509; Mon, 25 Dec 2017 23:02:46 +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 7F891608C9; Mon, 25 Dec 2017 23:02:38 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id C413E608E6 for ; Mon, 25 Dec 2017 23:01:28 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward100j.mail.yandex.net (Yandex) with ESMTP id C8C255D830C7 for ; Tue, 26 Dec 2017 02:01:27 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id E3MinzYGXv-1R0K9SV7; Tue, 26 Dec 2017 02:01:27 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rho8WkqRtC-1LYies5o; Tue, 26 Dec 2017 02:01:21 +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:15 +0300 Message-Id: <1514242817-22123-5-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 4/6] linux-generic: crypto, ipsec: use auth_iv. 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 Separate handling of authentication IV data. 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 **/ platform/linux-generic/odp_crypto.c | 35 ++++++++++++++++++++++------------ platform/linux-generic/odp_ipsec.c | 6 ++++-- platform/linux-generic/odp_ipsec_sad.c | 2 +- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index ea47f1de2..e3c30e841 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -36,9 +36,7 @@ * Keep sorted: first by key length, then by IV length */ static const odp_crypto_cipher_capability_t cipher_capa_null[] = { -{.key_len = 0, .iv_len = 0}, -/* Special case for GMAC */ -{.key_len = 0, .iv_len = 12} }; +{.key_len = 0, .iv_len = 0} }; static const odp_crypto_cipher_capability_t cipher_capa_trides_cbc[] = { {.key_len = 24, .iv_len = 8} }; @@ -86,7 +84,8 @@ static const odp_crypto_auth_capability_t auth_capa_aes_gcm[] = { {.digest_len = 16, .key_len = 0, .aad_len = {.min = 8, .max = 12, .inc = 4} } }; static const odp_crypto_auth_capability_t auth_capa_aes_gmac[] = { -{.digest_len = 16, .key_len = 16, .aad_len = {.min = 0, .max = 0, .inc = 0} } }; +{.digest_len = 16, .key_len = 16, .aad_len = {.min = 0, .max = 0, .inc = 0}, + .iv_len = 12 } }; /** Forward declaration of session structure */ typedef struct odp_crypto_generic_session_t odp_crypto_generic_session_t; @@ -121,6 +120,7 @@ struct odp_crypto_generic_session_t { struct { uint8_t key[EVP_MAX_KEY_LENGTH]; + uint8_t iv_data[EVP_MAX_IV_LENGTH]; uint32_t key_length; uint32_t bytes; union { @@ -640,10 +640,10 @@ odp_crypto_alg_err_t aes_gmac_gen(odp_packet_t pkt, uint8_t block[EVP_MAX_MD_SIZE]; int ret; - if (param->override_iv_ptr) - iv_ptr = param->override_iv_ptr; - else if (session->p.iv.data) - iv_ptr = session->cipher.iv_data; + if (param->override_auth_iv_ptr) + iv_ptr = param->override_auth_iv_ptr; + else if (session->p.auth_iv.data) + iv_ptr = session->auth.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID; @@ -679,10 +679,10 @@ odp_crypto_alg_err_t aes_gmac_check(odp_packet_t pkt, uint8_t block[EVP_MAX_MD_SIZE]; int ret; - if (param->override_iv_ptr) - iv_ptr = param->override_iv_ptr; - else if (session->p.iv.data) - iv_ptr = session->cipher.iv_data; + if (param->override_auth_iv_ptr) + iv_ptr = param->override_auth_iv_ptr; + else if (session->p.auth_iv.data) + iv_ptr = session->auth.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID; @@ -908,11 +908,21 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, goto err; } + if (session->p.auth_iv.length > EVP_MAX_IV_LENGTH) { + ODP_DBG("Maximum auth IV length exceeded\n"); + *status = ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER; + goto err; + } + /* Copy IV data */ if (session->p.iv.data) memcpy(session->cipher.iv_data, session->p.iv.data, session->p.iv.length); + if (session->p.auth_iv.data) + memcpy(session->auth.iv_data, session->p.auth_iv.data, + session->p.auth_iv.length); + /* Derive order */ if (ODP_CRYPTO_OP_ENCODE == param->op) session->do_cipher_first = param->auth_cipher_text; @@ -1101,6 +1111,7 @@ odp_crypto_operation(odp_crypto_op_param_t *param, packet_param.session = param->session; packet_param.override_iv_ptr = param->override_iv_ptr; + packet_param.override_auth_iv_ptr = param->override_auth_iv_ptr; packet_param.hash_result_offset = param->hash_result_offset; packet_param.aad_ptr = param->aad_ptr; packet_param.cipher_range = param->cipher_range; diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index b023d308d..d8c8fc0f0 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -478,6 +478,7 @@ static int ipsec_in_esp(odp_packet_t *pkt, state->in.hdr_len - ipsec_sa->icv_len; param->override_iv_ptr = state->iv; + param->override_auth_iv_ptr = state->iv; state->esp.aad.spi = esp.spi; state->esp.aad.seq_no = esp.seq_no; @@ -560,7 +561,7 @@ static int ipsec_in_ah(odp_packet_t *pkt, return -1; } - param->override_iv_ptr = state->iv; + param->override_auth_iv_ptr = state->iv; state->in.hdr_len = (ah.ah_len + 2) * 4; state->in.trl_len = 0; @@ -1080,6 +1081,7 @@ static int ipsec_out_esp(odp_packet_t *pkt, } param->override_iv_ptr = state->iv; + param->override_auth_iv_ptr = state->iv; memset(&esp, 0, sizeof(esp)); esp.spi = odp_cpu_to_be_32(ipsec_sa->spi); @@ -1229,7 +1231,7 @@ static int ipsec_out_ah(odp_packet_t *pkt, return -1; } - param->override_iv_ptr = state->iv; + param->override_auth_iv_ptr = state->iv; if (odp_packet_extend_head(pkt, hdr_len, NULL, NULL) < 0) { status->error.alg = 1; diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 845a73dea..56a75f3e5 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -409,7 +409,7 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param) ipsec_sa->use_counter_iv = 1; ipsec_sa->esp_iv_len = 8; ipsec_sa->esp_block_len = 16; - crypto_param.iv.length = 12; + crypto_param.auth_iv.length = 12; break; default: break; From patchwork Mon Dec 25 23:00:16 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: 122713 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp308933qgn; Mon, 25 Dec 2017 15:04:24 -0800 (PST) X-Google-Smtp-Source: ACJfBovuaPIDzhK/m6bI9VxkgulVdgLWFPq5DGSZtrt/CYMYe6ZEQ73xIu6nfFcPCbf4HZ4jumsY X-Received: by 10.55.104.148 with SMTP id d142mr17176021qkc.251.1514243064244; Mon, 25 Dec 2017 15:04:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514243064; cv=none; d=google.com; s=arc-20160816; b=P2OEYqfrZ2moMEHYk8TjutdSKTkwIDD+klK6lIwHaIL1FDhPQlt5rVKEYie2dpKQ/8 0lLbIby4caydewLLgj2zkFo8hsKQihdUl1UfxDjbj0DDkUx8u42GctMSbtvNScTEElDs 7OndEj6nh4wrr3qTd2GuNx1kF3KdRXXEuCU98S7pM+qiNQfCpGmhS0J4CFwvpHwJPogJ +gik2HMMkO6gQpc96dJxwTv95+7RW5SynSw4nsslomY5HhCPsHrjzaGkkkXnXjgzx350 CZepXO2BmYz8b7m25VHsBjZCm4hMsHBikV+6b2t/iIlSIVSjBmIjuDlYj/pi1BhhoxKI XCQw== 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=6h/xMhXP8KBDAHkPbEC/9sWhj8kPTdCX1cXb9TkJJuY=; b=T7tidia8Uhf2ZhP1qO6/a+vaExMakhk+b5KX5W4xNZm7woQBs8i28NxdROrOjhYR6t bUStcUhFJkyA7Cd96Zg40BDCZaTsJC4Tik5d7Ybce7G3PilXq8Z3B7I6v6QyLNBp8Eu+ wxpGX0HQiG+niAhoMYXx7O4SnOoqMuPNvcV3vIz0G9qFOMW6s16R3QcMRapXyj5GHmcJ jT8W+mW6AP4dJE5gRrHaKbzVobuGKG9DTcShubHgjEIP92ceOVPYi5F01bAnMzKKrJlH RYwkDqP08vP8Z1fsVDyqRCA+3CRrq3ilpjmUHuJZsHCt9RIVVGFhhzfRrIyFCu9G4ADo yiDQ== 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 r32si4844184qtr.253.2017.12.25.15.04.24; Mon, 25 Dec 2017 15:04:24 -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 F05E760940; Mon, 25 Dec 2017 23:04:23 +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 D9DF160862; Mon, 25 Dec 2017 23:02:52 +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 93413608F8; Mon, 25 Dec 2017 23:02:42 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id BBB09608ED for ; Mon, 25 Dec 2017 23:01:36 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 703662181A30 for ; Tue, 26 Dec 2017 02:01:34 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id auQl70mWm7-1YmKXxKl; Tue, 26 Dec 2017 02:01:34 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rho8WkqRtC-1RYW08es; Tue, 26 Dec 2017 02:01:27 +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:16 +0300 Message-Id: <1514242817-22123-6-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 5/6] validation: crypto: stop declaring test functions as public 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 There is no use to declare test functions as public, they are defined and used in the same file. 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/crypto.h | 30 ------------- test/validation/api/crypto/odp_crypto_test_inp.c | 56 ++++++++++++------------ 2 files changed, 28 insertions(+), 58 deletions(-) diff --git a/test/validation/api/crypto/crypto.h b/test/validation/api/crypto/crypto.h index 078a1909f..7c248d9eb 100644 --- a/test/validation/api/crypto/crypto.h +++ b/test/validation/api/crypto/crypto.h @@ -9,36 +9,6 @@ #include "odp_cunit_common.h" -/* test functions: */ -void crypto_test_enc_alg_null(void); -void crypto_test_dec_alg_null(void); -void crypto_test_enc_alg_3des_cbc(void); -void crypto_test_enc_alg_3des_cbc_ovr_iv(void); -void crypto_test_dec_alg_3des_cbc(void); -void crypto_test_dec_alg_3des_cbc_ovr_iv(void); -void crypto_test_enc_alg_aes_cbc(void); -void crypto_test_enc_alg_aes_cbc_ovr_iv(void); -void crypto_test_dec_alg_aes_cbc(void); -void crypto_test_dec_alg_aes_cbc_ovr_iv(void); -void crypto_test_enc_alg_aes_ctr(void); -void crypto_test_enc_alg_aes_ctr_ovr_iv(void); -void crypto_test_dec_alg_aes_ctr(void); -void crypto_test_dec_alg_aes_ctr_ovr_iv(void); -void crypto_test_enc_alg_aes_gcm(void); -void crypto_test_enc_alg_aes_gcm_ovr_iv(void); -void crypto_test_dec_alg_aes_gcm(void); -void crypto_test_dec_alg_aes_gcm_ovr_iv(void); -void crypto_test_gen_alg_hmac_md5(void); -void crypto_test_check_alg_hmac_md5(void); -void crypto_test_gen_alg_hmac_sha1(void); -void crypto_test_check_alg_hmac_sha1(void); -void crypto_test_gen_alg_hmac_sha256(void); -void crypto_test_check_alg_hmac_sha256(void); -void crypto_test_gen_alg_hmac_sha512(void); -void crypto_test_check_alg_hmac_sha512(void); -void crypto_test_gen_alg_aes_gmac(void); -void crypto_test_check_alg_aes_gmac(void); - /* test arrays: */ extern odp_testinfo_t crypto_suite[]; diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 7e7bc5c1c..748a64dcf 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -635,7 +635,7 @@ static int check_alg_null(void) return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_NULL); } -void crypto_test_enc_alg_null(void) +static void crypto_test_enc_alg_null(void) { unsigned int test_vec_num = (sizeof(null_reference) / sizeof(null_reference[0])); @@ -649,7 +649,7 @@ void crypto_test_enc_alg_null(void) false); } -void crypto_test_dec_alg_null(void) +static void crypto_test_dec_alg_null(void) { unsigned int test_vec_num = (sizeof(null_reference) / sizeof(null_reference[0])); @@ -672,7 +672,7 @@ static int check_alg_3des_cbc(void) * operation for 3DES_CBC algorithm. IV for the operation is the session IV. * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer.*/ -void crypto_test_enc_alg_3des_cbc(void) +static void crypto_test_enc_alg_3des_cbc(void) { unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / sizeof(tdes_cbc_reference[0])); @@ -689,7 +689,7 @@ void crypto_test_enc_alg_3des_cbc(void) /* This test verifies the correctness of encode (plaintext -> ciphertext) * operation for 3DES_CBC algorithm. IV for the operation is the operation IV. * */ -void crypto_test_enc_alg_3des_cbc_ovr_iv(void) +static void crypto_test_enc_alg_3des_cbc_ovr_iv(void) { unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / sizeof(tdes_cbc_reference[0])); @@ -708,7 +708,7 @@ void crypto_test_enc_alg_3des_cbc_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_3des_cbc(void) +static void crypto_test_dec_alg_3des_cbc(void) { unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / sizeof(tdes_cbc_reference[0])); @@ -727,7 +727,7 @@ void crypto_test_dec_alg_3des_cbc(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_3des_cbc_ovr_iv(void) +static void crypto_test_dec_alg_3des_cbc_ovr_iv(void) { unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / sizeof(tdes_cbc_reference[0])); @@ -750,7 +750,7 @@ static int check_alg_aes_gcm(void) * operation for AES128_GCM algorithm. IV for the operation is the session IV. * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer.*/ -void crypto_test_enc_alg_aes_gcm(void) +static void crypto_test_enc_alg_aes_gcm(void) { unsigned int test_vec_num = (sizeof(aes_gcm_reference) / sizeof(aes_gcm_reference[0])); @@ -769,7 +769,7 @@ void crypto_test_enc_alg_aes_gcm(void) * operation for AES128_GCM algorithm. IV for the operation is the session IV. * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer.*/ -void crypto_test_enc_alg_aes_gcm_ovr_iv(void) +static void crypto_test_enc_alg_aes_gcm_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_gcm_reference) / sizeof(aes_gcm_reference[0])); @@ -789,7 +789,7 @@ void crypto_test_enc_alg_aes_gcm_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_gcm(void) +static void crypto_test_dec_alg_aes_gcm(void) { unsigned int test_vec_num = (sizeof(aes_gcm_reference) / sizeof(aes_gcm_reference[0])); @@ -809,7 +809,7 @@ void crypto_test_dec_alg_aes_gcm(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_gcm_ovr_iv(void) +static void crypto_test_dec_alg_aes_gcm_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_gcm_reference) / sizeof(aes_gcm_reference[0])); @@ -833,7 +833,7 @@ static int check_alg_aes_cbc(void) * operation for AES128_CBC algorithm. IV for the operation is the session IV. * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer.*/ -void crypto_test_enc_alg_aes_cbc(void) +static void crypto_test_enc_alg_aes_cbc(void) { unsigned int test_vec_num = (sizeof(aes_cbc_reference) / sizeof(aes_cbc_reference[0])); @@ -851,7 +851,7 @@ void crypto_test_enc_alg_aes_cbc(void) /* This test verifies the correctness of encode (plaintext -> ciphertext) * operation for AES128_CBC algorithm. IV for the operation is the operation IV. * */ -void crypto_test_enc_alg_aes_cbc_ovr_iv(void) +static void crypto_test_enc_alg_aes_cbc_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_cbc_reference) / sizeof(aes_cbc_reference[0])); @@ -871,7 +871,7 @@ void crypto_test_enc_alg_aes_cbc_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_cbc(void) +static void crypto_test_dec_alg_aes_cbc(void) { unsigned int test_vec_num = (sizeof(aes_cbc_reference) / sizeof(aes_cbc_reference[0])); @@ -891,7 +891,7 @@ void crypto_test_dec_alg_aes_cbc(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_cbc_ovr_iv(void) +static void crypto_test_dec_alg_aes_cbc_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_cbc_reference) / sizeof(aes_cbc_reference[0])); @@ -915,7 +915,7 @@ static int check_alg_aes_ctr(void) * operation for AES128_CTR algorithm. IV for the operation is the session IV. * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer.*/ -void crypto_test_enc_alg_aes_ctr(void) +static void crypto_test_enc_alg_aes_ctr(void) { unsigned int test_vec_num = (sizeof(aes_ctr_reference) / sizeof(aes_ctr_reference[0])); @@ -933,7 +933,7 @@ void crypto_test_enc_alg_aes_ctr(void) /* This test verifies the correctness of encode (plaintext -> ciphertext) * operation for AES128_CTR algorithm. IV for the operation is the operation IV. * */ -void crypto_test_enc_alg_aes_ctr_ovr_iv(void) +static void crypto_test_enc_alg_aes_ctr_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_ctr_reference) / sizeof(aes_ctr_reference[0])); @@ -953,7 +953,7 @@ void crypto_test_enc_alg_aes_ctr_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_ctr(void) +static void crypto_test_dec_alg_aes_ctr(void) { unsigned int test_vec_num = (sizeof(aes_ctr_reference) / sizeof(aes_ctr_reference[0])); @@ -973,7 +973,7 @@ void crypto_test_dec_alg_aes_ctr(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_ctr_ovr_iv(void) +static void crypto_test_dec_alg_aes_ctr_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_ctr_reference) / sizeof(aes_ctr_reference[0])); @@ -1000,7 +1000,7 @@ static int check_alg_hmac_md5(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_md5(void) +static void crypto_test_gen_alg_hmac_md5(void) { unsigned int test_vec_num = (sizeof(hmac_md5_reference) / sizeof(hmac_md5_reference[0])); @@ -1014,7 +1014,7 @@ void crypto_test_gen_alg_hmac_md5(void) false); } -void crypto_test_check_alg_hmac_md5(void) +static void crypto_test_check_alg_hmac_md5(void) { unsigned int test_vec_num = (sizeof(hmac_md5_reference) / sizeof(hmac_md5_reference[0])); @@ -1040,7 +1040,7 @@ static int check_alg_hmac_sha1(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_sha1(void) +static void crypto_test_gen_alg_hmac_sha1(void) { unsigned int test_vec_num = (sizeof(hmac_sha1_reference) / sizeof(hmac_sha1_reference[0])); @@ -1054,7 +1054,7 @@ void crypto_test_gen_alg_hmac_sha1(void) false); } -void crypto_test_check_alg_hmac_sha1(void) +static void crypto_test_check_alg_hmac_sha1(void) { unsigned int test_vec_num = (sizeof(hmac_sha1_reference) / sizeof(hmac_sha1_reference[0])); @@ -1080,7 +1080,7 @@ static int check_alg_hmac_sha256(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_sha256(void) +static void crypto_test_gen_alg_hmac_sha256(void) { unsigned int test_vec_num = (sizeof(hmac_sha256_reference) / sizeof(hmac_sha256_reference[0])); @@ -1094,7 +1094,7 @@ void crypto_test_gen_alg_hmac_sha256(void) false); } -void crypto_test_check_alg_hmac_sha256(void) +static void crypto_test_check_alg_hmac_sha256(void) { unsigned int test_vec_num = (sizeof(hmac_sha256_reference) / sizeof(hmac_sha256_reference[0])); @@ -1120,7 +1120,7 @@ static int check_alg_hmac_sha512(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_sha512(void) +static void crypto_test_gen_alg_hmac_sha512(void) { unsigned int test_vec_num = (sizeof(hmac_sha512_reference) / sizeof(hmac_sha512_reference[0])); @@ -1134,7 +1134,7 @@ void crypto_test_gen_alg_hmac_sha512(void) false); } -void crypto_test_check_alg_hmac_sha512(void) +static void crypto_test_check_alg_hmac_sha512(void) { unsigned int test_vec_num = (sizeof(hmac_sha512_reference) / sizeof(hmac_sha512_reference[0])); @@ -1153,7 +1153,7 @@ static int check_alg_aes_gmac(void) return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_AES_GMAC); } -void crypto_test_gen_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])); @@ -1167,7 +1167,7 @@ void crypto_test_gen_alg_aes_gmac(void) false); } -void crypto_test_check_alg_aes_gmac(void) +static void crypto_test_check_alg_aes_gmac(void) { unsigned int test_vec_num = (sizeof(aes_gmac_reference) / sizeof(aes_gmac_reference[0])); From patchwork Mon Dec 25 23:00:17 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: 122714 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp309867qgn; Mon, 25 Dec 2017 15:05:35 -0800 (PST) X-Google-Smtp-Source: ACJfBotDaPLmsV3J5C2njwy9MG9Zm4IJ4ETcvPjAP8j5XnPeeedtG1b81WsS/E6YIn8C1F430uip X-Received: by 10.55.131.196 with SMTP id f187mr29562558qkd.222.1514243135022; Mon, 25 Dec 2017 15:05:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514243135; cv=none; d=google.com; s=arc-20160816; b=VDYFpm7QuWfiXqLxGqDBt8+I2xfX3wOtmHDaSEI6TfYPHBkbtMPXXXAq+JLPUq7MZR Y14elU+6YkqM34+aW7Ztwo+Xpm0gqDgBmKKnqa7osD1IJ+PTfaBlLT+7JadU7XYL6Rey qeuiZY/hhe4lkqEMMw9neWQoJqi/vQm2tx4KVhfDRUmPSdZNoFKl0xn+uqi3Y7WzFWFD dNGfKxwUql9ZACt5G12osX3NPgT1gTtHuffAycf7RFqbE3SpWcpWEZqgRiAiSpBPui48 bBUfjh8V8sLVOT8W8o6Vc1/tiNNNUXi52f/i/GMjo/LhV5NNKHquGk8M0lJid4qk5z9f S0Iw== 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=eHgmD8XooW3XDxEpip/Qp5h0GUrh0DDuwdQEvCwyTuo=; b=B4rqjum1tfcwQuupcTc2YbhKkRFc/BLIX7FRZ+3VaWNbWb4k0vCRQc3Fvn94vogXNt KPaHUuG0eiMctYYWdO36vKu87i91Dl/yoOp/f9AXOEJmfipVmTD9d9ebGP/1tU8FUMof Y97O5LKstLt0x3BI36tyt7xOxK7qI5+hE9ZS/+4xBuhjBlCk1t6+PJX8cN8qPNpFrMTf 71SdqbtMsFmPNQKJVQDgrtyG+c4MmG9/yqH8DxeGaHS05oyoMlUfxM5Mtd2eHCObScWG gk4Qt5BACgf+b5J9McNz2uBif0RG526WFnJapVpm/YBMnbDzhF59K/9fdj0uHUxGljZY mJeQ== 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 m32si3074051qtk.191.2017.12.25.15.05.34; Mon, 25 Dec 2017 15:05:35 -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 AA30E60922; Mon, 25 Dec 2017 23:05:34 +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 28B44608B5; Mon, 25 Dec 2017 23:02:57 +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 61F7F608ED; Mon, 25 Dec 2017 23:02:44 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id CB1B9608FD for ; Mon, 25 Dec 2017 23:01:42 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward105o.mail.yandex.net (Yandex) with ESMTP id EE1DD44409B4 for ; Tue, 26 Dec 2017 02:01:40 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id PY5W7Exmu1-1e8OXrn7; Tue, 26 Dec 2017 02:01:40 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rho8WkqRtC-1YYu1pgm; Tue, 26 Dec 2017 02:01:34 +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:17 +0300 Message-Id: <1514242817-22123-7-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 6/6] fixup! 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 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 | 50 ++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 748a64dcf..d9b43c0b1 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -79,6 +79,7 @@ static int alg_op(odp_packet_t pkt, odp_bool_t *ok, odp_crypto_session_t session, uint8_t *op_iv_ptr, + uint8_t *op_auth_iv_ptr, odp_packet_data_range_t *cipher_range, odp_packet_data_range_t *auth_range, uint8_t *aad, @@ -99,8 +100,10 @@ static int alg_op(odp_packet_t pkt, op_params.cipher_range = *cipher_range; op_params.auth_range = *auth_range; - if (op_iv_ptr) + if (op_iv_ptr) { op_params.override_iv_ptr = op_iv_ptr; + op_params.override_auth_iv_ptr = op_auth_iv_ptr; + } op_params.aad_ptr = aad; @@ -154,6 +157,7 @@ static int alg_packet_op(odp_packet_t pkt, odp_bool_t *ok, odp_crypto_session_t session, uint8_t *op_iv_ptr, + uint8_t *op_auth_iv_ptr, odp_packet_data_range_t *cipher_range, odp_packet_data_range_t *auth_range, uint8_t *aad, @@ -171,8 +175,10 @@ static int alg_packet_op(odp_packet_t pkt, op_params.cipher_range = *cipher_range; op_params.auth_range = *auth_range; - if (op_iv_ptr) + if (op_iv_ptr) { op_params.override_iv_ptr = op_iv_ptr; + op_params.override_auth_iv_ptr = op_auth_iv_ptr; + } op_params.aad_ptr = aad; @@ -211,6 +217,7 @@ static int alg_packet_op_enq(odp_packet_t pkt, odp_bool_t *ok, odp_crypto_session_t session, uint8_t *op_iv_ptr, + uint8_t *op_auth_iv_ptr, odp_packet_data_range_t *cipher_range, odp_packet_data_range_t *auth_range, uint8_t *aad, @@ -229,8 +236,10 @@ static int alg_packet_op_enq(odp_packet_t pkt, op_params.cipher_range = *cipher_range; op_params.auth_range = *auth_range; - if (op_iv_ptr) + if (op_iv_ptr) { op_params.override_iv_ptr = op_iv_ptr; + op_params.override_auth_iv_ptr = op_auth_iv_ptr; + } op_params.aad_ptr = aad; @@ -494,16 +503,19 @@ static void alg_test(odp_crypto_op_t op, if (!suite_context.packet) rc = alg_op(pkt, &ok, session, ovr_iv ? ref->iv : NULL, + ovr_iv ? ref->auth_iv : NULL, &cipher_range, &auth_range, ref->aad, ref->length); else if (ODP_CRYPTO_ASYNC == suite_context.op_mode) rc = alg_packet_op_enq(pkt, &ok, session, ovr_iv ? ref->iv : NULL, + ovr_iv ? ref->auth_iv : NULL, &cipher_range, &auth_range, ref->aad, ref->length); else rc = alg_packet_op(pkt, &ok, session, ovr_iv ? ref->iv : NULL, + ovr_iv ? ref->auth_iv : NULL, &cipher_range, &auth_range, ref->aad, ref->length); if (rc < 0) @@ -1167,6 +1179,20 @@ static void crypto_test_gen_alg_aes_gmac(void) 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); +} + static void crypto_test_check_alg_aes_gmac(void) { unsigned int test_vec_num = (sizeof(aes_gmac_reference) / @@ -1181,6 +1207,20 @@ static void crypto_test_check_alg_aes_gmac(void) false); } +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); +} + int crypto_suite_sync_init(void) { suite_context.pool = odp_pool_lookup("packet_pool"); @@ -1288,8 +1328,12 @@ odp_testinfo_t crypto_suite[] = { check_alg_hmac_sha512), ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_aes_gmac, check_alg_aes_gmac), + ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_aes_gmac_ovr_iv, + check_alg_aes_gmac), ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_aes_gmac, check_alg_aes_gmac), + ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_aes_gmac_ovr_iv, + check_alg_aes_gmac), ODP_TEST_INFO_NULL, };