From patchwork Tue Dec 26 00:00:09 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: 122715 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp344117qgn; Mon, 25 Dec 2017 16:01:03 -0800 (PST) X-Google-Smtp-Source: ACJfBouMADOu3GFAPr8OHRurv4Z5rXYVd6kCgFDrJLHdDBf0KYmBeEeFpIK88kw+1HmaQBJ1dvtp X-Received: by 10.200.48.93 with SMTP id g29mr2330561qte.168.1514246463068; Mon, 25 Dec 2017 16:01:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514246463; cv=none; d=google.com; s=arc-20160816; b=EfmlEH0TqijajT7EoTdiobFHP5qcAf1QyDS/l4hhCqIS/wuCyIulRB1mhWNSlBed2R Su5mKVBSfoLrMPCk/dWsbfXAbNt1uEUG/BQGulaxDKZjWtyZUv3yFCG7VYOdzlrf8jal RKF97X4yJFUvP5RZQKszXUtVxf8ZuBwmnVha4GZz0xuZJZm8NOr1y3coQbgD+nr9eT1K v2eGnJaA4DgaP4LX3Kfy+aEK192QgR6q8ddiemLH4p+JP2TCpucWTAA1X6x35VQqR9zZ 3pStcw2uU/jqt/z12JMq1fzx81EeAjn3iKZjZfQBQH2QPLyJ5Th0HyNBwEG67OTdB6rL ySWQ== 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=4m+cY5tZw58+d1S2hBhf+Poelob18xCYl5Ea+vMC0xU=; b=pOjB7/YnNKmJF0IGhdjL92EZtzAbyORtJY3gXCudE5Qw3L+3unjWIjze1gvLTdF8sG 3DpUvOMt+5qEmAx3CgfjLawUkjPJreFUia+UhvQpURq2LSfPf/EMxn2Z2hWMYoeMUIzs ySIyMK6vdzatLaWqkO2o7vIPsJyw5GhJpDnRzyuxCbSAzwfJNfTC8N+uGwepb74x3P4Z mFd3QClowaZyxtVs6SsqyZiYpIsjKZvErnGQJCHhO61s2i22WZUdPOY6DrwdERkm0CNc 0FEl2DWorGYPriZCovb/3sJQ1sETH9B8mG76z7AdzkJppj5ZkPfcHw5cPFOI8M2T5L3G iCAA== 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 s3si690047qkd.74.2017.12.25.16.01.02; Mon, 25 Dec 2017 16:01: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 ABFB16090D; Tue, 26 Dec 2017 00:01: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_H3,RCVD_IN_MSPIKE_WL,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 D7B526038C; Tue, 26 Dec 2017 00:00:23 +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 8906C60388; Tue, 26 Dec 2017 00:00:17 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id EA55960388 for ; Tue, 26 Dec 2017 00:00:15 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 6C1761803627 for ; Tue, 26 Dec 2017 03:00:14 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id i7WQ74l9ut-0Ei4C7VA; Tue, 26 Dec 2017 03:00:14 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id KJPc042sLp-0D4qWkfe; Tue, 26 Dec 2017 03:00:13 +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 03:00:09 +0300 Message-Id: <1514246413-23329-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> References: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v4 1/5] 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: f8286ad8cd8b0ed8d10af7071eaa5c8cb28520a0 **/ 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 */