From patchwork Wed Mar 8 09:45:32 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: 95024 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp2272567qgd; Wed, 8 Mar 2017 01:48:44 -0800 (PST) X-Received: by 10.55.142.69 with SMTP id q66mr5866352qkd.13.1488966524733; Wed, 08 Mar 2017 01:48:44 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j11si2542427qta.53.2017.03.08.01.48.44; Wed, 08 Mar 2017 01:48:44 -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 4720C60991; Wed, 8 Mar 2017 09:48:44 +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_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 DDF386069F; Wed, 8 Mar 2017 09:46:13 +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 CF0C76069F; Wed, 8 Mar 2017 09:46:09 +0000 (UTC) Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) by lists.linaro.org (Postfix) with ESMTPS id 14F3B62C44 for ; Wed, 8 Mar 2017 09:45:43 +0000 (UTC) Received: by mail-wr0-f172.google.com with SMTP id u108so19267264wrb.3 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=5zXd8yVp7b4cgpUWLHIqyZi288Q9HLUmJK2i3PMZB4A=; b=F6Zx5N9jbUfI+WT6iv0ytqUnqL8MYkauLsVETS60kKGei+w522djJsgQgGWC7Gb2KI VbB3mD4BfeiRyn6fDpfeVsXZzF8hDiL3+k6hFU7q3rmeI0h+HPwuw/lwG5o/cJ3sP5SO 3EzZq2z4+5/elytNjfeECzG/sgXQW+UVnpSCRkpQMMNAl8RYXPD3EChilMw7jsY+CJVa LVuR2xtc/CbOYKSXlwNrsCADSHW1J4X28kdGK2QDtyGEbnRt/bN1iJb9bxPZJ7TnSnQk hJHRg7tSMLoxIy8JPP3tan6EZsXZ+FisXA+h3YtLkUbAHBiqn7BOoRxieAuf3xnBLqzz hL8g== X-Gm-Message-State: AMke39mirM6Cswln5lN7QpwLWNecCcHWQgNdp56EXvspstvlO1Pc0BRPtHvNk0eAXzfZ7Ja8QnrFeg== X-Received: by 10.223.175.238 with SMTP id y46mr4153257wrd.63.1488966342015; 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.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Mar 2017 01:45:41 -0800 (PST) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Wed, 8 Mar 2017 12:45:32 +0300 Message-Id: <20170308094533.30795-8-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 7/8] linux-generic: crypto: add SHA-1 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 5078a3b1..ef79d6f6 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -54,6 +54,9 @@ static const odp_crypto_cipher_capability_t cipher_capa_aes_gcm[] = { static const odp_crypto_auth_capability_t auth_capa_md5_hmac[] = { {.digest_len = 12, .key_len = 16, .aad_len = {.min = 0, .max = 0, .inc = 0} } }; +static const odp_crypto_auth_capability_t auth_capa_sha1_hmac[] = { +{.digest_len = 12, .key_len = 20, .aad_len = {.min = 0, .max = 0, .inc = 0} } }; + 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} } }; @@ -447,7 +450,7 @@ int odp_crypto_capability(odp_crypto_capability_t *capa) capa->auths.bit.null = 1; capa->auths.bit.md5_hmac = 1; - capa->auths.bit.sha1_hmac = 0; + capa->auths.bit.sha1_hmac = 1; capa->auths.bit.sha256_hmac = 1; capa->auths.bit.sha512_hmac = 0; capa->auths.bit.aes_gcm = 1; @@ -521,6 +524,10 @@ int odp_crypto_auth_capability(odp_auth_alg_t auth, src = auth_capa_md5_hmac; num = sizeof(auth_capa_md5_hmac) / size; break; + case ODP_AUTH_ALG_SHA1_HMAC: + src = auth_capa_sha1_hmac; + num = sizeof(auth_capa_sha1_hmac) / size; + break; case ODP_AUTH_ALG_SHA256_HMAC: src = auth_capa_sha256_hmac; num = sizeof(auth_capa_sha256_hmac) / size; @@ -626,6 +633,9 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, case ODP_AUTH_ALG_MD5_96: rc = process_auth_param(session, 96, 16, EVP_md5()); break; + case ODP_AUTH_ALG_SHA1_HMAC: + rc = process_auth_param(session, 96, 20, EVP_sha1()); + break; case ODP_AUTH_ALG_SHA256_HMAC: /* deprecated */ case ODP_AUTH_ALG_SHA256_128: