From patchwork Fri Feb 16 21:00:17 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: 128639 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp975627ljc; Fri, 16 Feb 2018 13:01:57 -0800 (PST) X-Google-Smtp-Source: AH8x2272hlpM8SnfCnlRoCXQ5akIlA6k+IigRyYzTGcpebzgexF4/yZWOandwQEcepfZSWAO1sRq X-Received: by 10.200.0.17 with SMTP id a17mr949092qtg.46.1518814917122; Fri, 16 Feb 2018 13:01:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518814917; cv=none; d=google.com; s=arc-20160816; b=bdJYe49MvundvcgjNb7/WEQJAtH2cHAfKhSgQacY+1kMTL/lCOQTGDxK1vgcTV9gv7 2HWFQ2XOILgpEJiYhQmJUgetMNj+gtPMv4w88yrhnxCdSbfShnCHh78WCGUozZXTnNyK 2Opc7XtniGdOnBcFzdDtsXuXxWPKitL/Ue51m8HtHHhW68sutPRHbkSCZ7Fq/Hs0n5K3 6cVMxogpXR750/TT5iFk0L1bdvQ0RVrJ3+1Px8LdC5xmCOq116J//T17r3P0GATdkyM6 Lzj/ffaXC6qPVhqX0Of7/AZ/tsG90npZtTsNELwaj5IW01RRQ32zyyY74eV+wgsJTaMx tAcg== 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=Y/bC0AHAchZy815AUwqV2SvgDBsmFcZLhr6epR/2LwQ=; b=hv0vIyURkNVBnaD6D0dFwdzpDtjvWQXzghykGA/oh1g4mOy/fqRaGR2Rs6JnvTcj7h PxYwjM8ggfO14CAJffHOKVq+f56MYmxL3ZSuteGBsmmOeZxo1KGPpvQ8ajI0vAMgYHoG 1WILhB/wNKEUPQKKlkN8UfyUlrCOG1PNBpx8Y6OOX+k6adFIsb3EWT8SkI+snpUVaTIp IPkmcDXTCSx8Y+k164pDoFcXiA7dX8eVpN/hT8Syh1Ch8S7CdWnOKrv/P97G4AS5ZtP5 NBmZXe8542x6pkta/xDW1/uIoDLdwZyKrOwVdHwnqr/3ohC+hD7/lj8HIQAb/zf68mtB eKiw== 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 m11si5319821qkl.455.2018.02.16.13.01.49; Fri, 16 Feb 2018 13:01:57 -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 5DA8C617DC; Fri, 16 Feb 2018 21:01:49 +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 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 3567260CBD; Fri, 16 Feb 2018 21:00:37 +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 BB660608DF; Fri, 16 Feb 2018 21:00:27 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id BBED660B5F for ; Fri, 16 Feb 2018 21:00:23 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 5315034C4F10 for ; Sat, 17 Feb 2018 00:00:22 +0300 (MSK) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [2a02:6b8:0:801::ac]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id zzzYdXOUpH-0Ln8GGk6; Sat, 17 Feb 2018 00:00:21 +0300 Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id A5sQrqtPc3-0KxO9hM4; Sat, 17 Feb 2018 00:00:20 +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: Sat, 17 Feb 2018 00:00:17 +0300 Message-Id: <1518814818-27115-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518814818-27115-1-git-send-email-odpbot@yandex.ru> References: <1518814818-27115-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 464 Subject: [lng-odp] [PATCH API-NEXT v1 2/3] api: crypto: add bitstring operation capability 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 For several wireless communication algorithms it is expected that they operate on bit strings, which are not byte-aligned. Add cipher and auth flags, denoting that this cipher/auth can be enabled to work in bit-string mode. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 464 (lumag:crypto-3gpp) ** https://github.com/Linaro/odp/pull/464 ** Patch: https://github.com/Linaro/odp/pull/464.patch ** Base sha: af7be638ef9ac98bdb1f2e4917f152889eb1850f ** Merge commit sha: da657b8b144e5fd9f465c0a4a0698ecd7dad4eef **/ include/odp/api/spec/crypto.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 654ae7bb9..03bb69775 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -510,6 +510,15 @@ typedef struct odp_crypto_session_param_t { */ odp_pool_t output_pool; + /** Bitstring mode + * + * Cipher and auth will operate in bitstring mode. Fields cipher_range + * and auth_range will count bits for offset and length, rather than + * full bytes. Note: not algorithms support this mode of operation, it + * has to be reported via bitstring field in cipher and auth + * capability. */ + odp_bool_t bitstring; + } odp_crypto_session_param_t; /** @deprecated Use odp_crypto_session_param_t instead */ @@ -755,6 +764,14 @@ typedef struct odp_crypto_cipher_capability_t { /** IV length in bytes */ uint32_t iv_len; + /** Bitstring operation is supported + * + * Support operation on unaligned bit strings, rather than byte-aligned + * strings: cipher_range in parameter in odp_crypto_op_param_t and + * odp_crypto_packet_op_param_t will be expressed in bits, rather than + * bytes */ + odp_bool_t bitstring; + } odp_crypto_cipher_capability_t; /** @@ -783,6 +800,14 @@ typedef struct odp_crypto_auth_capability_t { uint32_t inc; } aad_len; + /** Bitstring operation is supported + * + * Support operation on unaligned bit strings, rather than byte-aligned + * strings: auth_range in parameter in odp_crypto_op_param_t and + * odp_crypto_packet_op_param_t will be expressed in bits, rather than + * bytes */ + odp_bool_t bitstring; + } odp_crypto_auth_capability_t; /**