From patchwork Thu Dec 21 23:00:21 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: 122606 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1510579qgn; Thu, 21 Dec 2017 15:04:13 -0800 (PST) X-Google-Smtp-Source: ACJfBosZM3+Ojy3tc0Sdr8/dbh82FGIr9gMuSRANCqzykJuf7C6DHWasQBpXlharyadmkLsOJ+Z7 X-Received: by 10.55.53.75 with SMTP id c72mr17237726qka.2.1513897452975; Thu, 21 Dec 2017 15:04:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513897452; cv=none; d=google.com; s=arc-20160816; b=dU9U5LEJg3fJun/uzDcFWmuL9RAtQ8AUcciN8s9wbNbRt9OeSbMnX+xR6+DUQDwrJI iBR+3SCXG+57P0YhWeOdi1mu6c47GGQgjIxeDU9ck6oworuxoK41MHZo/jseCTZuLEIz NAlHyrtXQlwyw1nuZqcbUDWUeXq4ps+0vSb6rjWnljcCWHeO0wG7jmzmwaURWcyoL4EQ zu+d2Ut1fmm4OX5dhHOfjsXji9JbW9yQw04ZuFYgs+f7hVucARZ0CCLpyW2Qtuwrsa9K 4/ExN4GjmDNKvWEnnV4cpcd6wwJtGffBA0JFf5ObZfETrS+fNOlghoB0KdmQoYWiZo8m EiZg== 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=Z3AT5424hVuz1cNhOGKPMbJ5kej8WmGp7jPo8IacndM=; b=ZkkfWPY8C3Yq0Y8CIfTUKvMlYVrTOPImB5HmZ9Mb39HNN5pp748dPxe/OSkFAXaUvP 3cYdKE31gOEQbdh5YfDmuRECOdC65u2LPdQxQm7omseiNBc/y1jtCQMrnuZxjXdVOaMi YrRSk/FzUdnKJR/ppb1oBg5l/+ycbihJVzJC15gx9mvU1JOHBp0xBO0l4n10oxrhuv5u gCHLJtI6kS6aIgBmwxzAAgpzV90o28ruqHHH7VSQDtx0sCgWitJTBnCTevlDzJrcHhup WukqH6oSuADq54mXP7GMQX7naRhaTjopFeFDpGJ27XadVJq21Ce+nkijZgjnSZJHXeeF ptXw== 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 n5si6431914qtf.1.2017.12.21.15.04.12; Thu, 21 Dec 2017 15:04:12 -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 90B9061514; Thu, 21 Dec 2017 23:04:12 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 C04AB61527; Thu, 21 Dec 2017 23:01:27 +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 460AC6150E; Thu, 21 Dec 2017 23:01:21 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 0B4C461508 for ; Thu, 21 Dec 2017 23:00:27 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward100j.mail.yandex.net (Yandex) with ESMTP id A73CF5D8411C for ; Fri, 22 Dec 2017 02:00:25 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id jZGRpYiuGk-0PMGfi8R; Fri, 22 Dec 2017 02:00:25 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id B287xXhYac-0PV0214O; Fri, 22 Dec 2017 02:00:25 +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: Fri, 22 Dec 2017 02:00:21 +0300 Message-Id: <1513897223-21131-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513897223-21131-1-git-send-email-odpbot@yandex.ru> References: <1513897223-21131-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v2 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: 177eeff39e19289e771119cfdffc515cb16f9db5 ** Merge commit sha: ea71bf34033ee74ce7f090f0212b9285ca13b1fe **/ 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 */