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 */