From patchwork Thu Jan 4 00:00:11 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: 123370 Delivered-To: patch@linaro.org Received: by 10.80.135.92 with SMTP id 28csp6101340edv; Wed, 3 Jan 2018 16:05:39 -0800 (PST) X-Google-Smtp-Source: ACJfBotEghKBEa7nj6AQM9E4WX4A8EHBNnuOApkfBMnBeExg1BfHnhiEQgNtvGa2a9fvMW4L8Kf/ X-Received: by 10.200.36.212 with SMTP id t20mr4180395qtt.202.1515024245021; Wed, 03 Jan 2018 16:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515024245; cv=none; d=google.com; s=arc-20160816; b=JMjHU2vtBfb6nJ1DlpzQH8ziBArUfDq2huv5QuQuK4lgVKPVc+0oWo9K1FfcPLC3q6 sgjKfTzl6DklrWOQpPxAe/2VQpYDzh4DRV/ob3jMbt2/zOXb83BLU9SscoKcp8xFEW4G KzIrJFTJtDKPI5jAgkXKTUkc+GYX5Hw+d8Fvs8Ny7god65bgnx0c3J0IRIMRu+GuFiTH YXNeyZGpHjNzZUj2z3kbLqByXDqvteB3ECdXWlUOROmr0JqlCqvRuUZLnDSRGaGLecRJ Ni4GmpBYcQWmad36CKrfCKaAdsqgQylpjxpcPBC+Nn/jO7f1w61tCgEGFCXVwpL8wiP2 O4rg== 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=CmC8nMw4ZCsgy8wbPiKJm58AoJCY+E3nQa3rc5OX+DM=; b=uguWpeV70fl97UfbvguGVLbUSyT0kmv+Teal2YwB2c7nSanzztOdAOOLwCCrkDjQyC hFQZGBjBlwLrsCGdiJNF+jmzNd3+cRcaLn+txImprRtw2WEOhdD+vfIxJF3S+lY1ejk5 SFuDEoPURSCCq9IGZb9aQsO5ELbmNL4BVbXM/yfSx6pN38ZG9f5K8sEcR7su9klNECgY x5F9hlfTY9BH9+ifP8nMWAoBGoelBJ2xrtbmDlJU2BTcTs52W/mUfUsk8z4gl6DdSlp+ YVNGqhOqF7Vo+SFN+ioOEBONxMh680RAhasnkGTEjIb/6MYnv5p1EEgcM4MteFRmXRnY 1Q7g== 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 y126si1711955qkc.333.2018.01.03.16.04.04; Wed, 03 Jan 2018 16:04:05 -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 B2AF161505; Thu, 4 Jan 2018 00:04:04 +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 BF28660BF4; Thu, 4 Jan 2018 00:00:48 +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 871A8608F7; Thu, 4 Jan 2018 00:00:25 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id D70DF6095D for ; Thu, 4 Jan 2018 00:00:18 +0000 (UTC) Received: from mxback9j.mail.yandex.net (mxback9j.mail.yandex.net [IPv6:2a02:6b8:0:1619::112]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 39E6812425FC for ; Thu, 4 Jan 2018 03:00:17 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback9j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LNSmunk86k-0Ho0KhR0; Thu, 04 Jan 2018 03:00:17 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lrM9dmOAE5-0G4Gkks8; Thu, 04 Jan 2018 03:00:16 +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: Thu, 4 Jan 2018 03:00:11 +0300 Message-Id: <1515024013-30222-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515024013-30222-1-git-send-email-odpbot@yandex.ru> References: <1515024013-30222-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v5 4/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: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4 ** Merge commit sha: 5a1e35f8e8d8df2bc17b098f7c9c92611ea98e23 **/ 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 25ce2f86c..99ae4576a 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. @@ -403,6 +406,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 @@ -439,6 +445,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 @@ -604,6 +613,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 */