From patchwork Fri May 19 06:53:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 9735921 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D142E601C2 for ; Fri, 19 May 2017 06:57:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE433288AD for ; Fri, 19 May 2017 06:57:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C29DE288B2; Fri, 19 May 2017 06:57:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66626288A6 for ; Fri, 19 May 2017 06:57:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754271AbdESG47 (ORCPT ); Fri, 19 May 2017 02:56:59 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34659 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752558AbdESGz5 (ORCPT ); Fri, 19 May 2017 02:55:57 -0400 Received: by mail-wm0-f65.google.com with SMTP id d127so16122725wmf.1; Thu, 18 May 2017 23:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WNt21YJaIRvij0MV9CEzPmkkjMcC5UAoCsslSgLX5Vg=; b=Z87+lIjxUIGFmnbZJEt/QBbvn9OTHn9Ml5AJ0VHs59oSUTDHMa3UhaMS/pe8wXdZQG wbOHzt4zEVLYagoRyU00wZQOjvmo/1wKiI1fo7Mv4zv4wEg2Zvvyl9t7brWj7lkP9UlO cqQ350SjcuDSQFcakdkRq6LyFzz4ZLkWwhRdj9ONqFZsw/afFzm5OrrQ54RLgTingfau o9Xp/qTBcUfB2jZnf0R+usCoGU/VwXP7QLFiG+1C8q5zCTb8W/8FymKcdHc+z7leGWGR qaFCxljwpk4ItPP0VQLoxCv/eWFaOJNi/wVXcl/JqJX26GdQsMYnqC1kX5fxD1XQ/HDk IVMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WNt21YJaIRvij0MV9CEzPmkkjMcC5UAoCsslSgLX5Vg=; b=Gvoy0VJ72rWHmPgMOjET8qRSTqMuYB5hI1UXoIWojWkPfFXkCC3DaYn7eeKI1BIMQ6 oNSnMZSm7iBmV4cHB7VKIzSIn4ViZjD9AmrHSq6g/Z8m3S8BGYleHoycfnAh5zvUiK2w RSff7LuydpzxVfQqZC+Dih3WdBnJcswq+H8RxvX40sFniXqnzHsqZqrShqF9PFGjbQKZ 7IgGvAtqanu7KeNHnMZnSjV4LZs2VNaqwPm3C56oClSmwoMX8JwdJ2hr+h9307Guo1Ta wlDVRM6ru4TVl9uzfGFhjCkmJG4rOoEWYyYxU60mJWknAAfzYT3S7LKeYVCO9jWc/6Rb g4vw== X-Gm-Message-State: AODbwcAiyFRGQUcshu5wgLxlxw9LuFNS953xVcud30VzrmSV8WfDi6qC 1SPlDVKoWEkBbQ== X-Received: by 10.28.23.198 with SMTP id 189mr5906607wmx.38.1495176955818; Thu, 18 May 2017 23:55:55 -0700 (PDT) Received: from Red.local (LFbn-1-7035-57.w90-116.abo.wanadoo.fr. [90.116.208.57]) by smtp.googlemail.com with ESMTPSA id 1sm3256734wrw.32.2017.05.18.23.55.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 May 2017 23:55:55 -0700 (PDT) From: Corentin Labbe To: herbert@gondor.apana.org.au, davem@davemloft.net, thomas.lendacky@amd.com, gary.hook@amd.com, boris.brezillon@free-electrons.com, arno@natisbad.org, matthias.bgg@gmail.com, giovanni.cabiddu@intel.com, salvatore.benedetto@intel.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, qat-linux@intel.com, Corentin Labbe Subject: [PATCH v2 9/9] crypto: ccp - Use IPAD/OPAD constant Date: Fri, 19 May 2017 08:53:31 +0200 Message-Id: <20170519065331.27670-10-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170519065331.27670-1-clabbe.montjoie@gmail.com> References: <20170519065331.27670-1-clabbe.montjoie@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe Acked-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-sha.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c index 6b46eea94932..ce97b3868f4a 100644 --- a/drivers/crypto/ccp/ccp-crypto-sha.c +++ b/drivers/crypto/ccp/ccp-crypto-sha.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -308,8 +309,8 @@ static int ccp_sha_setkey(struct crypto_ahash *tfm, const u8 *key, } for (i = 0; i < block_size; i++) { - ctx->u.sha.ipad[i] = ctx->u.sha.key[i] ^ 0x36; - ctx->u.sha.opad[i] = ctx->u.sha.key[i] ^ 0x5c; + ctx->u.sha.ipad[i] = ctx->u.sha.key[i] ^ HMAC_IPAD_VALUE; + ctx->u.sha.opad[i] = ctx->u.sha.key[i] ^ HMAC_OPAD_VALUE; } sg_init_one(&ctx->u.sha.opad_sg, ctx->u.sha.opad, block_size);