From patchwork Wed Mar 8 09:45:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 95025 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp2272720qgd; Wed, 8 Mar 2017 01:49:17 -0800 (PST) X-Received: by 10.237.57.169 with SMTP id m38mr6895072qte.196.1488966557822; Wed, 08 Mar 2017 01:49:17 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w63si2529919qkc.198.2017.03.08.01.49.17; Wed, 08 Mar 2017 01:49:17 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6899B608E1; Wed, 8 Mar 2017 09:49:17 +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, 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 29CEB607AA; Wed, 8 Mar 2017 09:46:15 +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 6C0EE6069F; Wed, 8 Mar 2017 09:46:10 +0000 (UTC) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by lists.linaro.org (Postfix) with ESMTPS id DE5AC62C4D for ; Wed, 8 Mar 2017 09:45:43 +0000 (UTC) Received: by mail-wm0-f50.google.com with SMTP id t189so25945498wmt.1 for ; Wed, 08 Mar 2017 01:45:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=SN8OZA3tvS91kBQFLwuw7CGFRwjKjJF8schYpCY5hQA=; b=GFga//sRZtg9FnEXTcmZl26URYHInW518qKiF+1nhqv1MoO9qluqF1Kwc3QzweqbpU DNUEiJkDcD8gN1AmIzBAP0XERJCNGv9PDwqhxjThewcD7fOb19pmiSNvO15GjkLxc+yv ECwgWtWia/rtCKtoEKk016MakDnXeEZ0grhCR24HkSWWKC3oYo4PDCCVT3YEQ71831JT zsqIVz8/BpdfMryBft8+uaPSFIgVtwdgQeJ20KLJHScoEeUkJgq2q8UIs/zVRP7fR2Nb /Qlu2YqePY7R2zqYb0OaSvPPvRMUdzyiZ9uROkHzA2Fa5p9OMmD2vlLQ2vuwdI4Dwy6w KTfQ== X-Gm-Message-State: AMke39nvFVqG/yDb9s4xJCW90vg6qUkfl1Zsin/yuJTQbb1zGs36EpxqptJQMylvI69A8Mtcx0Z7qw== X-Received: by 10.28.109.70 with SMTP id i67mr4851230wmc.48.1488966342836; Wed, 08 Mar 2017 01:45:42 -0800 (PST) Received: from forlindon.c.hoisthospitality.com ([109.74.56.122]) by smtp.gmail.com with ESMTPSA id x133sm22515934wme.22.2017.03.08.01.45.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Mar 2017 01:45:42 -0800 (PST) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Wed, 8 Mar 2017 12:45:33 +0300 Message-Id: <20170308094533.30795-9-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170308094533.30795-1-dmitry.ereminsolenikov@linaro.org> References: <20170308094533.30795-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [API-NEXT 8/8] linux-generic: crypto: add HMAC-SHA-512 authentication 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" Signed-off-by: Dmitry Eremin-Solenikov --- platform/linux-generic/odp_crypto.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.11.0 diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index ef79d6f6..0f2a227f 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -60,6 +60,9 @@ static const odp_crypto_auth_capability_t auth_capa_sha1_hmac[] = { static const odp_crypto_auth_capability_t auth_capa_sha256_hmac[] = { {.digest_len = 16, .key_len = 32, .aad_len = {.min = 0, .max = 0, .inc = 0} } }; +static const odp_crypto_auth_capability_t auth_capa_sha512_hmac[] = { +{.digest_len = 32, .key_len = 64, .aad_len = {.min = 0, .max = 0, .inc = 0} } }; + static const odp_crypto_auth_capability_t auth_capa_aes_gcm[] = { {.digest_len = 16, .key_len = 0, .aad_len = {.min = 8, .max = 12, .inc = 4} } }; @@ -452,7 +455,7 @@ int odp_crypto_capability(odp_crypto_capability_t *capa) capa->auths.bit.md5_hmac = 1; capa->auths.bit.sha1_hmac = 1; capa->auths.bit.sha256_hmac = 1; - capa->auths.bit.sha512_hmac = 0; + capa->auths.bit.sha512_hmac = 1; capa->auths.bit.aes_gcm = 1; /* Deprecated */ @@ -532,6 +535,10 @@ int odp_crypto_auth_capability(odp_auth_alg_t auth, src = auth_capa_sha256_hmac; num = sizeof(auth_capa_sha256_hmac) / size; break; + case ODP_AUTH_ALG_SHA512_HMAC: + src = auth_capa_sha512_hmac; + num = sizeof(auth_capa_sha512_hmac) / size; + break; case ODP_AUTH_ALG_AES_GCM: src = auth_capa_aes_gcm; num = sizeof(auth_capa_aes_gcm) / size; @@ -641,6 +648,9 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, case ODP_AUTH_ALG_SHA256_128: rc = process_auth_param(session, 128, 32, EVP_sha256()); break; + case ODP_AUTH_ALG_SHA512_HMAC: + rc = process_auth_param(session, 256, 64, EVP_sha512()); + break; case ODP_AUTH_ALG_AES_GCM: /* deprecated */ case ODP_AUTH_ALG_AES128_GCM: