From patchwork Tue Dec 19 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: 122411 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4791449qgn; Tue, 19 Dec 2017 15:01:05 -0800 (PST) X-Google-Smtp-Source: ACJfBouCfH5zpdZaxVtfNhxpKUzLrxrsyAP6VHgnNjFZ/8tF01gkoh90d5EHne4AEouFqxUYOk2X X-Received: by 10.200.52.146 with SMTP id w18mr7589811qtb.228.1513724465269; Tue, 19 Dec 2017 15:01:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513724465; cv=none; d=google.com; s=arc-20160816; b=bWx5oQTQ4ISx+J7akn3GlEIU1vmIl3j8JgbBBoogZez6FhUzFeaRTQBceCP0A0RG6p 60LAFlECmU1Fzz0dzNQWyjchl2arT8g2beN09gpD+fXc7jrEtnIiPhYARxYAoN5eMRyC OTRfzCAbc/Oy2XnourrG9QCuxI9qddpeOBQVwTunOL0EZd69Lj1rukWe2xoMF1YeXpD9 BWV2EWcMBXHOGUdZgq5UMLDIW+Uc5C+oEntIAoPvq7WlMH2hOBwZkU7aDKDMAy20llMK 7O6OLnKYdNZ5+0t5+UzJwoCBfKewyqXUOzcJS9tQFvbmMx1CaMXqWwqv/HcPNnI7T0/d ODuQ== 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=W75If70YfGXJHl+ADwGDP4Mmc8J3pWy//2it59CKxEY=; b=Ppna/7n4axSmaPM99FXoDYqpRbn4bZGn43TG2B5gVfuRfW8ikb+gqS6erxbjhEoeDp GzfNGN9BGn1PfbDAZoBUyBaFrQZMlZvDutAtOSE9NUQE7/YZq2YIuWwP4DfpsR4zkwmg qvrdJehk3l4yzDjt0Jb4OOs1ohSXmxCmM2LEHElS+phMJIZIgT7kVH8IMj8aCbmkAcR8 AwB7Dwz3KMF7VOcekVFYgfGyYn/LvFb+ufaPqkV/hndWS89AeOfFYphjbguQG1gJfb4T PJX/toZARBMnH3bGSBM8lBuyvEnBDfInMOVADw7/pxXW1AGWFQm6MMoA9gcI3OUUHGeo iMfA== 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 e17si1636851qki.137.2017.12.19.15.01.04; Tue, 19 Dec 2017 15:01: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 99CFD60922; Tue, 19 Dec 2017 23:01: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,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 7B3C2608CC; Tue, 19 Dec 2017 23:00: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 DE3B3608EE; Tue, 19 Dec 2017 23:00:52 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id F228A608E8 for ; Tue, 19 Dec 2017 23:00:24 +0000 (UTC) Received: from mxback6o.mail.yandex.net (mxback6o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::20]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 77ED72D82710 for ; Wed, 20 Dec 2017 02:00:23 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback6o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id orSZq0A1qk-0ND4Ngpx; Wed, 20 Dec 2017 02:00:23 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id U73IVpNz26-0MNaEsUp; Wed, 20 Dec 2017 02:00:22 +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: Wed, 20 Dec 2017 02:00:13 +0300 Message-Id: <1513724415-24899-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513724415-24899-1-git-send-email-odpbot@yandex.ru> References: <1513724415-24899-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v1 2/4] 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: 12fd3a9224a856271934986a1bad981843915d68 ** Merge commit sha: ceb7bff0f74da9fec7efa8d45d3078c2485ca305 **/ 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 293c15c6e..45cd9c37e 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 @@ -437,6 +443,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 @@ -606,6 +615,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 */