From patchwork Mon Apr 3 15:15:23 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: 96644 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp146230qgd; Mon, 3 Apr 2017 08:15:36 -0700 (PDT) X-Received: by 10.200.57.1 with SMTP id s1mr16694848qtb.236.1491232536259; Mon, 03 Apr 2017 08:15:36 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q3si12145651qte.107.2017.04.03.08.15.35; Mon, 03 Apr 2017 08:15:36 -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 772B463DFB; Mon, 3 Apr 2017 15:15:35 +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.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, 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 A2EB1634EA; Mon, 3 Apr 2017 15:15:31 +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 C1F6163DF0; Mon, 3 Apr 2017 15:15:29 +0000 (UTC) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) by lists.linaro.org (Postfix) with ESMTPS id 8776F634E4 for ; Mon, 3 Apr 2017 15:15:28 +0000 (UTC) Received: by mail-lf0-f42.google.com with SMTP id z15so76733389lfd.1 for ; Mon, 03 Apr 2017 08:15:28 -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=/iyizSYXqhWly8Lf2WZ3lBVd/v8OEb1HygwwxsTcLkA=; b=BkMPkT88rN0abdheccjcnapGLmZ1FErrnFD6L6k5nPQplRJV8RZd3WiFE7U8Gw64Rh +whEzW97yKQZ1J9hc8bePWh0e781dEe65OvV5ABz+RpouyKiIAIsl66ZApR17LawYTlo Cfygyy1ZmJQYkwXoh0KEujDFTMPoX5VR9ilc9051ZgqAgwralRaIF7+YTwXGoesL7+9F 25Ql38yF/ECypbYtfu1SIHEDG3kyVd4A08U3HnwNlDKL1KW8MlDaEXgLwhP1V7AefWm6 DhxctC7ed/+ErUlpCpMjZs98sdx+P50hBd/X/mlicpGJ7lkgf31jmlsIgEr0K+eZNqSF 3sTQ== X-Gm-Message-State: AFeK/H14ZA7LigNbMbLAypmJipPsFvNuLpQFD9avZP0SDYk40KsGmIGCejGLZqpY2g8lX1Qpmpmu6W9k X-Received: by 10.25.163.68 with SMTP id m65mr4894715lfe.152.1491232526891; Mon, 03 Apr 2017 08:15:26 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([188.162.64.93]) by smtp.gmail.com with ESMTPSA id 26sm2577375lfs.19.2017.04.03.08.15.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 08:15:26 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Mon, 3 Apr 2017 18:15:23 +0300 Message-Id: <20170403151524.20547-1-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170403114212.23355-1-dmitry.ereminsolenikov@linaro.org> References: <20170403114212.23355-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [API-NEXT v2 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 ad4d169c..6663e48f 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} } }; @@ -432,7 +435,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; @@ -506,6 +509,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; @@ -611,6 +618,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: