From patchwork Thu Jun 1 09:03:39 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: 100860 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp711474qge; Thu, 1 Jun 2017 02:21:06 -0700 (PDT) X-Received: by 10.200.52.39 with SMTP id u36mr491584qtb.231.1496308866621; Thu, 01 Jun 2017 02:21:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496308866; cv=none; d=google.com; s=arc-20160816; b=jtXS4eojbWgDqBkrUYigOzM2D01vBT8akt4yxJ61x35PykMwg9gwj+v8MteCwnm1XG V2KhemqsfqUwOxOMq4YGjeOhZ83iZGqlmL3TEd3BmR+Xg5Fd2fCYL4BdveVlcSWzlrgS Azph6Lg1081mBu788jZ6pjrN5FeFadYWLK2ZCXWR4JL5VeZ3KQ+ovw2cYtpXcOPtUA3X Tn2SXozbqppqGaGW33pT9b9qnLcoZJj08Erl8lo4RjQhKDRlcR0YXVa6XNc1fk6Qs7Eo KHLUvwsLUV0e5wyUJrojryAdqiUzmlMzY+Xs68OckFGFKATWfv539w1nfvKOBu3YUCha 9RMA== 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:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=IF+9Eh8eKlQ16FaqJFCrsSZvT/dwb7X5Ay6gDNE/+gs=; b=ACrN8paTn6rssGMnM3jTvVyFHsH0d4x4LZFrB2q08BWFpowBLD7YW6bwiXO3R/mSBi NyaEcvHaZdsAagnylQgUVebJID/SHXu2LcjEN8GszEa0JlXhCOXp2zwS7pOo3EVF1MND IdCOBVagFoCQ9UAb0ctG0FmkD4AU99BpCaOjFero3tKFHJzwYlfpmjMQxm9LUPzX2n64 jyATX+qRzVDTCmcHYrRYoXGydo+fDSb9nWTPkZyewGNHQjFUBQ9ryCn0yB71Cu93s/Hj ukM//9ItILl4XRHMxAEePnGTGkYDngFVJ6fE0ZRDzyw1/ce98gFdI3Qqvaktf82uza/H c1kA== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 54si19136880qtv.288.2017.06.01.02.21.06; Thu, 01 Jun 2017 02:21:06 -0700 (PDT) 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 3AE45609AA; Thu, 1 Jun 2017 09:21:06 +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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, 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 940BD60E80; Thu, 1 Jun 2017 09:07: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 92F3960E80; Thu, 1 Jun 2017 09:07:11 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by lists.linaro.org (Postfix) with ESMTPS id 956E760D3D for ; Thu, 1 Jun 2017 09:04:08 +0000 (UTC) Received: by mail-lf0-f46.google.com with SMTP id c184so17854299lfe.2 for ; Thu, 01 Jun 2017 02:04:08 -0700 (PDT) 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=IF+9Eh8eKlQ16FaqJFCrsSZvT/dwb7X5Ay6gDNE/+gs=; b=SR/PYLNT/o4EEsdfGSO7SPLdIYInnE+t8GFXRvbj/B6m0yx2FfnS9Rdv8GxM51n354 kcBAaNGr50bAv8yn+D/ap8TEDeGEmQFwwj2MAzq44YTxN4Zy6w9MWKKY5+lbCWHTGbA/ dRrpt8gcSvymF2dbW2TNZnA7BDQ8qDpG/evRjYN1Xr2dYjDzbrTqCVr0xNT0MNwTmam5 JgBIrM9gnGAe1m8/+ktqHGtxwho60X+98rT/QBUBg8H+b4ZhyB5TbWRNW31IZAz4pK80 4qhGS+yP14lDnGrpMKVxsZd6aM62/8V7kPzuqgEXlE6TIgSE5WrgygRi3X0JqtRVIwYD qD4g== X-Gm-Message-State: AODbwcBAI8EBUkokPGdhSf59XhDbXZvZIUOuz/tYh/isP2M+kjkf/zZL 1aF+dNPq2X9T+AufTpGrTX3C X-Received: by 10.25.74.196 with SMTP id x187mr196634lfa.164.1496307847323; Thu, 01 Jun 2017 02:04:07 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([188.162.64.12]) by smtp.gmail.com with ESMTPSA id 129sm4232819ljf.36.2017.06.01.02.04.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 02:04:06 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Thu, 1 Jun 2017 12:03:39 +0300 Message-Id: <20170601090339.9313-24-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170601090339.9313-1-dmitry.ereminsolenikov@linaro.org> References: <20170601090339.9313-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [PATCH API-NEXT v5 23/23] 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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -- 2.11.0 diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 3117f65d5601..6fc1907d9dca 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -69,6 +69,10 @@ 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} }, {.digest_len = 32, .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} }, +{.digest_len = 64, .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} } }; @@ -555,7 +559,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; #if ODP_DEPRECATED_API @@ -636,6 +640,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; @@ -761,6 +769,9 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, case ODP_AUTH_ALG_SHA256_HMAC: rc = process_auth_param(session, 32, EVP_sha256()); break; + case ODP_AUTH_ALG_SHA512_HMAC: + rc = process_auth_param(session, 64, EVP_sha512()); + break; #if ODP_DEPRECATED_API case ODP_AUTH_ALG_AES128_GCM: if (param->cipher_alg == ODP_CIPHER_ALG_AES128_GCM)