From patchwork Mon Jan 15 00:03:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 124461 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp505827lje; Sun, 14 Jan 2018 16:18:44 -0800 (PST) X-Google-Smtp-Source: ACJfBosxSnVhTYPgDd8fWNm9kPE4BAQsXHxYw9y+g8iaBHGlTXY/vhmbpprd0zOrfuF0Wk14GgAP X-Received: by 10.200.35.186 with SMTP id q55mr45593977qtq.73.1515975524085; Sun, 14 Jan 2018 16:18:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515975524; cv=none; d=google.com; s=arc-20160816; b=JktJ4R78Tzte3UDKPAsOsPPEeS6TArYCGyrwj9GE151UP83IYCiuWq1dnr/AhkUzCR 1GUm6pakUF0EmqpuG/uzxlOWDZtx4cGA1EkjuFlKNMNhQTc5S2LuiaPYTqBedlrVdB7k HMFMzcG9Bo7jnzGCuihxpwb+K3D5lQaTtQD00iFTIu/4fJUuQHycnnz7hBRfCGmnY2vY b+yt6jDElcuB3Mgm4DTEUhUT7K6wtKtFjzJ9LtCUzurLnllPD235vff7eSahQzj7PWbr G63OnPnUYdCK3Lx9KDk+degM9ftHL463hvLrcqfA8xylfHo1L4r9VYgZR1gv+PZyXz/B 6Zxg== 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=5CPs14SLo3jqVGFXee6uLlXaDTV42nmyHXq9o9sAWaQ=; b=drEQP6XK4bu+GPsobyMDfdRTrA256KRa4v2+xEPuXtcLAoNpx0aLM3hdEaCcil/HD9 eReqNXbCZAWWjGNXyTj1LPFJbYvgEQfsniIxZRnPGYhPoV/nfaHeYYhDhGCAHxSLGBps QcpI7gw61nZOmqgppPvQKSI235r2zDJ/fC3SrqPFb9v2zY1obR/aTFS/3aPgQokavkrM vXSl6JLTwbQWsApXkoHVAVtI4mhNmSkA5RK3OTp2qyi/V9/PvT2MiEZfgn5cCqLaf9Ru e1ClkI/ExQ8mZSvXPB96L5YnfrN9WyazsYLEGAkS+XxPoONUtQiZJAji7jLK6qEL/QZU RM3Q== 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 4si3007790qtn.177.2018.01.14.16.18.43; Sun, 14 Jan 2018 16:18:44 -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 BBFDA61757; Mon, 15 Jan 2018 00:18:43 +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 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 D2B3A6176B; Mon, 15 Jan 2018 00:06:03 +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 4FA7061785; Mon, 15 Jan 2018 00:05:46 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id B20F46176C for ; Mon, 15 Jan 2018 00:03:46 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 868132A2248D for ; Mon, 15 Jan 2018 03:03:45 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id py6temxo7M-3jRSo9qd; Mon, 15 Jan 2018 03:03:45 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id HWZU16MmnE-3jKaRDcT; Mon, 15 Jan 2018 03:03:45 +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: Mon, 15 Jan 2018 03:03:39 +0300 Message-Id: <1515974621-25987-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515974621-25987-1-git-send-email-odpbot@yandex.ru> References: <1515974621-25987-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v7 5/7] 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: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4 ** Merge commit sha: 8b925492ef06bf633b8767bba97bd6ec68547618 **/ 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 e44892fbf..ea2a14d65 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -333,6 +333,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. @@ -408,6 +411,9 @@ typedef struct odp_crypto_op_param_t { uint8_t *cipher_iv_ptr; }; + /** Override session authentication IV pointer */ + uint8_t *auth_iv_ptr; + /** Offset from start of packet for hash result * * Specifies the offset where the hash result is to be stored. In case @@ -449,6 +455,9 @@ typedef struct odp_crypto_packet_op_param_t { uint8_t *cipher_iv_ptr; }; + /** Override session IV pointer for authentication */ + uint8_t *auth_iv_ptr; + /** Offset from start of packet for hash result * * Specifies the offset where the hash result is to be stored. In case @@ -614,6 +623,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 */