From patchwork Tue Jan 30 14:59:59 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: 126239 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp3445333ljd; Tue, 30 Jan 2018 07:09:29 -0800 (PST) X-Google-Smtp-Source: AH8x227VvjpGzWs5BpZcWWuq5emLXPRZCfJlOnCco+ANmMeLoqLN2scbbiLrHHxwNjrqFhH9JaN0 X-Received: by 10.200.5.11 with SMTP id u11mr28386367qtg.196.1517324968921; Tue, 30 Jan 2018 07:09:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517324968; cv=none; d=google.com; s=arc-20160816; b=RbVUlxJ2xgMD+bTO2WpJVSU5hmfUjCnWRN5TTzMiI5AUryqhaBKFeyRwfD5OA5U167 2G/ORCvnvWAzmhQPbjguFncD9BUOxl32ZO8WSNG76MxXtUnprRR8XqagAz7HBZC5GYHh tgEN7Bt+49wuieYQg4vVAmk+HGpEm8pXtCSINT7IHjoWtUrLQqc0KfSaUYWx3MDFV7d2 aq97SAQi87Hp+2LLDrYChW/4Y0saTKiKBsycha34ZbKJBSist8z0Rc+p1J54dxsE4DMJ 2tvQeNNza6L8JejV5nimD5ryEmkktiaq/jSw9ockZIYjMSdgD/lB1oEv6SVu9CnuINGH OOXg== 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=96wkt0SeYL4UgLaVwwn6zOpIZ/4DZN5zT0IXH2Inkfo=; b=tQxxnj7uB0ognU+ECV1uZ92kO1+U6pJMq2DQqwtqnIOl2reOfWdz9rw9NHVLRH85L5 T7/70yq7RTw5/lpdj/DTMuQRqLrXuI2vfGlsbgkaJfBRp00/8E11G4yK/sgULXrZmsab pmfUfDs95+fmdgfnIZZTMBxhhnc+qeeHSFKkNrrmpAeTce+Mpk4Upxzc0c4N3PzVAqxG bSpwGVI7q8wtZNyZP48Vn/YRV9JJcuba5VUasZfKAWH1IWSfTGtBHOx8fTp86JavoCJ9 za79roADZjDRBFjT3UN2NLF32EEbgt8Fyp/Kl2/9PdXghGdCqV/wWTgCC7/0PE2bGF9U uvCQ== 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 r28si2408938qtj.473.2018.01.30.07.09.28; Tue, 30 Jan 2018 07:09:28 -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 76A506176B; Tue, 30 Jan 2018 15:09:28 +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 08E8661739; Tue, 30 Jan 2018 15:01:09 +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 64B8F6099A; Tue, 30 Jan 2018 15:00:29 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id D900B609A2 for ; Tue, 30 Jan 2018 15:00:19 +0000 (UTC) Received: from mxback8j.mail.yandex.net (mxback8j.mail.yandex.net [IPv6:2a02:6b8:0:1619::111]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 7325A1844E9 for ; Tue, 30 Jan 2018 18:00:16 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback8j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id C328ziBtiU-0GfGWiPx; Tue, 30 Jan 2018 18:00:16 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id sxKD104gxy-0FrSISiG; Tue, 30 Jan 2018 18:00:15 +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: Tue, 30 Jan 2018 17:59:59 +0300 Message-Id: <1517324412-24567-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517324412-24567-1-git-send-email-odpbot@yandex.ru> References: <1517324412-24567-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 434 Subject: [lng-odp] [PATCH API-NEXT v3 4/17] api: crypto: add ChaCha20-Poly1305 support 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 ChaCha20-Poly1305 is a promising AEAD algorithm. Add decarations to support it. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 434 (lumag:crypto-upd) ** https://github.com/Linaro/odp/pull/434 ** Patch: https://github.com/Linaro/odp/pull/434.patch ** Base sha: abc7b3bb0babe8efa0fde52752bcd514f2f0d422 ** Merge commit sha: 15e0c830b5937ae889b7bcf6822797dbe0ecb799 **/ include/odp/api/spec/crypto.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 421080c2b..b7ab53620 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -101,6 +101,15 @@ typedef enum { */ ODP_CIPHER_ALG_AES_CCM, + /** ChaCha20-Poly1305 + * + * ChaCha20 with Poly1305 provide both authentication and ciphering of + * data (authenticated encryption) in the same operation. Hence this + * algorithm must be paired always with ODP_AUTH_ALG_CHACHA20_POLY1305 + * authentication. + */ + ODP_CIPHER_ALG_CHACHA20_POLY1305, + /** @deprecated Use ODP_CIPHER_ALG_AES_CBC instead */ ODP_DEPRECATE(ODP_CIPHER_ALG_AES128_CBC), @@ -183,6 +192,15 @@ typedef enum { */ ODP_AUTH_ALG_AES_CMAC, + /** ChaCha20-Poly1305 AEAD + * + * ChaCha20 with Poly1305 provide both authentication and ciphering of + * data (authenticated encryption) in the same operation. Hence this + * algorithm must be paired always with + * ODP_CIPHER_ALG_CHACHA20_POLY1305 cipher. + */ + ODP_AUTH_ALG_CHACHA20_POLY1305, + /** @deprecated Use ODP_AUTH_ALG_MD5_HMAC instead */ ODP_DEPRECATE(ODP_AUTH_ALG_MD5_96), @@ -221,6 +239,9 @@ typedef union odp_crypto_cipher_algos_t { /** ODP_CIPHER_ALG_AES_CCM */ uint32_t aes_ccm : 1; + /** ODP_CIPHER_ALG_CHACHA20_POLY1305 */ + uint32_t chacha20_poly1305 : 1; + /** @deprecated Use aes_cbc instead */ uint32_t ODP_DEPRECATE(aes128_cbc) : 1; @@ -269,6 +290,9 @@ typedef union odp_crypto_auth_algos_t { /** ODP_AUTH_ALG_AES_CMAC*/ uint32_t aes_cmac : 1; + /** ODP_AUTH_ALG_CHACHA20_POLY1305 */ + uint32_t chacha20_poly1305 : 1; + /** @deprecated Use md5_hmac instead */ uint32_t ODP_DEPRECATE(md5_96) : 1;