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: 9735965 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 763AC601C2 for ; Fri, 19 May 2017 06:58:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F006288A6 for ; Fri, 19 May 2017 06:58:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 635CF288A9; Fri, 19 May 2017 06:58:48 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E6056288A7 for ; Fri, 19 May 2017 06:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=6DOBaMm53q7VJQjOqrKJfT7tQNuHQH9/fe94i+jdvL4=; b=ud6FDbIJiBv3wCz8eANACWlEc1 69WstyJBpV4JGy+blV4GpZ7sc3+6e5h+uiYBg6+YJwQi2Ay/Ead+wbqFQR7N0uadB9U8oef6qRVEP zzJO3YqgdpcD48ZN+xhfnGLtxyCSwB9Gk8vv7dRtMOTRuqNRg4eSfOY3tfkUSRr/NmSqrgboXJuq4 SIxEpxYeZSamRXknSIpN2zdOqXVLdPv3/sPyMF1DX7rs/k656Ss6XAAVl516Zm81Gzf439+WQyiut +D4dFoUlhwEbCvV2vCHBd1mJ9boAR9krJ0Mo+VCt59J7vdIqjobf/UU1nvCr7oK6vhpz6fNOlCjKR TvuKELjQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dBbs6-0007AP-4F; Fri, 19 May 2017 06:58:46 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dBbph-0004R1-Gr; Fri, 19 May 2017 06:56:19 +0000 Received: by mail-wm0-x242.google.com with SMTP id k15so14863315wmh.3; Thu, 18 May 2017 23:55:57 -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=tvjauaxOBZcpH+zkpH9kHOkeA9W+l7p43uhyv/EqvULHrXoGnureYF5eD23Avw2dbu 40vI4tW//0PTnYPW+bicrcOQGGKRF3bRlZcx9vRyY/ISDZdz6eQZu6Lf8fzaaSbEXPpa zfSvuesTN1IvdB/nZvjcWXazsLfXUzjtNaNlLMMnsZ4xFoOd0ElVLOaIUc5eWo87UE4z wTvLFCnh8O7qcrA7iwnI5S6hE5DOIm6UPwThg91S17u+gGjRyzhYRRVBCsFtKuTvkb9U OSyg0/OC4mIUt73OuJYov2631lJHADA9ygv2T2eTEo3EMFJb0ve9PckDQoaO+xUuQ4q2 0QLg== X-Gm-Message-State: AODbwcA3C5Ei/iv1ITdoM5Xk4ya4sCA1xWE6PKXtY92/Co9bLRS2ZDKs Yo8wkBQdR8+bsg== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170518_235617_740501_7C5EC721 X-CRM114-Status: GOOD ( 10.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qat-linux@intel.com, linux-kernel@vger.kernel.org, Corentin Labbe , linux-crypto@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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);