From patchwork Tue Nov 7 09:00:07 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: 118125 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3722639qgn; Tue, 7 Nov 2017 01:00:36 -0800 (PST) X-Google-Smtp-Source: ABhQp+Ru1MVw2fNN0yved8268nmyKFtla7UmwmBZz95eHDr35VO6PIO9zriGlulg6+6LH6GMasZ9 X-Received: by 10.107.63.67 with SMTP id m64mr22961709ioa.272.1510045236427; Tue, 07 Nov 2017 01:00:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510045236; cv=none; d=google.com; s=arc-20160816; b=Bx3GxsTu2nOX+d3Us0kvVcWaJUog9SUIVAW+8qIjwhIhBVRfXKI0Kh5s1PR6FwE2O1 khTzexdh94egP3f053upcEyNAKUrbm+3lbhlbLwg0144n+lSVeedkn89oxGHf91JQWsv vQVo3l297W5jLgiicejy7W+VxgVlqJ7EyvaiqJH3EGp7Aq91fquK9J0VVzyJH4AaRHIu OHnDivzSxVhB4TezbHs2vd7iA0+UyW1vWU7/7g9z5Ydp8LjxmRhxE1Spg0g0QuMaURkk S9Tnxve66+YsZGmXAMT7Yqlm6OzO/GuHtXInW604o0+oLIYH9fgZs4IjtwS36LKcKfSk iUTg== 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=z6LCGZS5GmOMUqyGVCOsMP4wR7dMXokFhB9f5zjb89U=; b=Ke2/6Jm28Zxtynw4f1Sg1qv3Y1clPULY3G1ZRSR1xydmfibty0zpGY21062qPSqEzf w0ylhfgg0kQz/1lWVGGAKr6RY4tPYpLZ1vaiEjCP2PK/iz8hzfbMQlWK2ZbzRoYkHO4H pou1cpdCuT7o6pGF7GojeLJ0ncgJJhPfLprJT8NDF96d3FYepBSChK0tLU7yLDec9QVx M/7ZuzV3ZGFT6YiTy9ryDgtYXDaow0HeNSjPvtUIvbJUJWZVpA8ipafRn84wDcO0M/5u vqvW9rN1mz3xqmsy6zFlQRofDY3hdHn/zWpYB5nb999gma3ptiK1skJu5DQ362leEzIP 42tA== 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 k12si886462iti.121.2017.11.07.01.00.30; Tue, 07 Nov 2017 01:00:36 -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 5A28C60C2F; Tue, 7 Nov 2017 09:00:30 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 9EEBF60BDF; Tue, 7 Nov 2017 09:00:23 +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 2C66960BDF; Tue, 7 Nov 2017 09:00:18 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 1C3A26069B for ; Tue, 7 Nov 2017 09:00:12 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 37C456A81DEE for ; Tue, 7 Nov 2017 12:00:10 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 3AllbgMyPK-09kmHrR2; Tue, 07 Nov 2017 12:00:10 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id aPdniNIBqG-09g04arN; Tue, 07 Nov 2017 12:00:09 +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, 7 Nov 2017 12:00:07 +0300 Message-Id: <1510045207-24934-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510045207-24934-1-git-send-email-odpbot@yandex.ru> References: <1510045207-24934-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 279 Subject: [lng-odp] [PATCH API-NEXT v1 1/1] api: crypto: session level AAD length 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: Petri Savolainen Added AAD length to crypto session level since it's likely to be constant per session. Also some implementations (such as DPDK) expect a constant AAD length at session create time. Signed-off-by: Petri Savolainen --- /** Email created from pull request 279 (psavol:next-crypto-aad-len) ** https://github.com/Linaro/odp/pull/279 ** Patch: https://github.com/Linaro/odp/pull/279.patch ** Base sha: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: 0e950e0561d1388ab2a90b75dc85bb1a9e47fd04 **/ include/odp/api/spec/crypto.h | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 7dcb71264..7630cc7c9 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -310,6 +310,19 @@ typedef struct odp_crypto_session_param_t { */ uint32_t auth_digest_len; + /** Authentication Additional Authenticated Data (AAD) length in bytes + * + * This parameter is used when AAD length is constant for all + * operations (packets) of the session. When AAD length varies, this + * must be set to zero and operation level AAD length parameter is + * used instead. Both session and operation level parameters must not + * be used simultaneously. + * + * Use odp_crypto_auth_capability() for supported AAD lengths. + * The default value is zero. + */ + uint32_t auth_aad_len; + /** Async mode completion event queue * * The completion queue is used to return completions from @@ -381,8 +394,15 @@ typedef struct odp_crypto_op_param_t { /** Pointer to ADD */ uint8_t *ptr; - /** AAD length in bytes. Use odp_crypto_auth_capability() for - * supported AAD lengths. */ + /** AAD length in bytes. + * + * Used only when AAD length is variable within the session. + * When AAD length is constant, this must be set to zero and + * session level AAD length parameter is used instead. + * + * Use odp_crypto_auth_capability() for supported AAD lengths. + * The default value is zero. + */ uint32_t length; } aad; @@ -422,8 +442,15 @@ typedef struct odp_crypto_packet_op_param_t { /** Pointer to ADD */ uint8_t *ptr; - /** AAD length in bytes. Use odp_crypto_auth_capability() for - * supported AAD lengths. */ + /** AAD length in bytes. + * + * Used only when AAD length is variable within the session. + * When AAD length is constant, this must be set to zero and + * session level AAD length parameter is used instead. + * + * Use odp_crypto_auth_capability() for supported AAD lengths. + * The default value is zero. + */ uint32_t length; } aad;