From patchwork Mon Apr 3 15:15:24 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: 96645 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp146378qgd; Mon, 3 Apr 2017 08:16:01 -0700 (PDT) X-Received: by 10.200.39.56 with SMTP id g53mr18093287qtg.134.1491232561378; Mon, 03 Apr 2017 08:16:01 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 96si6576139qkt.215.2017.04.03.08.16.01; Mon, 03 Apr 2017 08:16:01 -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 006786074D; Mon, 3 Apr 2017 15:16:00 +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 0815D63DF3; Mon, 3 Apr 2017 15:15:33 +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 6687763DB1; Mon, 3 Apr 2017 15:15:30 +0000 (UTC) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) by lists.linaro.org (Postfix) with ESMTPS id 3EB13634EA for ; Mon, 3 Apr 2017 15:15:29 +0000 (UTC) Received: by mail-lf0-f41.google.com with SMTP id x137so76901872lff.3 for ; Mon, 03 Apr 2017 08:15:29 -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=5Vsz0CQXNWuby7k/OTDT8W0eIXXLJZscnM9FsAg/8x0=; b=daQWSTumIR+3P88DoRncAAvP1jfixObD5f3UckWHFQKmddjfJqVeCHijW8zXPhSkTx DDclvFY2q18/uuEpcJTJTGX1jw64xROHt0JUjQgj7Fs6dhnxLf9/FsAFWcrToYDi87ta 9ml4EA432iyOyB0kUobPNxQlQS7TEzDv0Z3/mX2wopZdh0ebmCPpIioFsczuFtKSyJhZ 3d3j/XVG4o9uF+XMkWQ1e/kjNiQV9Q/EoyZr9dlYJKjzqYPYo/eeCQOhX9LmS1l8jQ7Q yFHMExZWjY8cenFX6dKhYwoM3vEgKfgw+L3av6x3jopxQCINmp1I9ydQtNXfTXUV8G3O eYYw== X-Gm-Message-State: AFeK/H0353Qv0Ex8Aqb6AZ9cxVe+hUDu0N3LzGZjgZPWH+6GlnQpsJVBmYElO5eat34WO8PO6EP1DhZQ X-Received: by 10.25.196.68 with SMTP id u65mr5589475lff.50.1491232527801; Mon, 03 Apr 2017 08:15:27 -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.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 08:15:27 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Mon, 3 Apr 2017 18:15:24 +0300 Message-Id: <20170403151524.20547-2-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170403151524.20547-1-dmitry.ereminsolenikov@linaro.org> References: <20170403114212.23355-1-dmitry.ereminsolenikov@linaro.org> <20170403151524.20547-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [API-NEXT v2 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 6663e48f..9ce98a1c 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} } }; @@ -437,7 +440,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 */ @@ -517,6 +520,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; @@ -626,6 +633,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: