From patchwork Mon Jan 22 08:00:03 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: 125339 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1023714ljf; Mon, 22 Jan 2018 00:04:45 -0800 (PST) X-Google-Smtp-Source: AH8x227c93jSzzb4TXkamEf4KHXvn2A6+W+WYSePY5YkbaZ/qcfvgI/T6jxpDsxGDQFzdmZupnhY X-Received: by 10.55.43.222 with SMTP id r91mr8991581qkr.309.1516608285806; Mon, 22 Jan 2018 00:04:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516608285; cv=none; d=google.com; s=arc-20160816; b=MSi7ATbjBoJwDmj8vj+BnYE2YGTx9KrRx1NeaNouxpzlCA8CZakVLrvjXnRISk8vSN Ngi47kMlvQLj7QL+oU8Vyq/oyftB2zzk+7UstYxZ6ofHVKSzTLZyFQSZze05VFkKhZwB wmmFlc92BkRMz5HsPeBplCp5qHvLpyBM71NZw54d6Qu6JHTIlz9ehDTYHnFNVyd89FAF /eubUBGADtCN1wrLSgUYxg4QaInTK3gtMg8x5Ao8afAW8qQsbl/vMdD/lko32csd9YT6 2HS/lpg8KUCk4AOvDr5Gushu3KvyfM54cv/DdIdcoG1+7KGGE7EHeIcdtan5yQCIJ4Yo Zd9A== 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=MRBNovQts7KBYOOZfzWLINPk5/9h3Jb0688UqFs4J4w=; b=TxH7ylH7AXalRRTI0YcDeQiTAMccv/1Mqeeknbhi0cPaQ4YifVdWRLdFjSheAbMDaL NkQ2NPjGIH1RoqoviClGiS7otQfkKgy1BIUwzMmCdBwAYei4AvJ7xHSN23YUSMefcBxX kCR2X/qClIlb5svaG6ZJn/7LBoN+Itkm+0cFCsFYEC9+dTB06QFvTgk9tcKNFzYnafqT dfzCUvhKCGXGdlr1RQqBmZHX0lR1fkrIQ9cYVZzf+ewX1XLlmdlprqg+JQYBPYODxVnr cQliQZpqJa4hW0e7j6qp4Pq3+g3JSZy8WjdhZ+ocywss749+A6EgnXIbkY39XnW+elX4 KcjA== 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 x127si4745674qkd.131.2018.01.22.00.04.45; Mon, 22 Jan 2018 00:04:45 -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 754626278B; Mon, 22 Jan 2018 08:04:45 +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 917E6617CB; Mon, 22 Jan 2018 08:01:16 +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 8599761520; Mon, 22 Jan 2018 08:00:37 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 4D5C560674 for ; Mon, 22 Jan 2018 08:00:18 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward102p.mail.yandex.net (Yandex) with ESMTP id BF8B8430346D for ; Mon, 22 Jan 2018 11:00:16 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VlisgJQfQn-0GMSlH37; Mon, 22 Jan 2018 11:00:16 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id yORTcTkY7i-0GHCRZdt; Mon, 22 Jan 2018 11: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: Mon, 22 Jan 2018 11:00:03 +0300 Message-Id: <1516608010-2535-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516608010-2535-1-git-send-email-odpbot@yandex.ru> References: <1516608010-2535-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 413 Subject: [lng-odp] [PATCH v1 5/12] 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 Reviewed-by: Bill Fischofer Reviewed-by: Petri Savolainen Signed-off-by: Maxim Uvarov --- /** Email created from pull request 413 (SonicwallYhe:api-next) ** https://github.com/Linaro/odp/pull/413 ** Patch: https://github.com/Linaro/odp/pull/413.patch ** Base sha: 5a4502fc6bc53e6503169da3028f456b64811a0b ** Merge commit sha: 6669be7b55ab094f9e27d2101a6bb005ca87e405 **/ 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 */