From patchwork Fri May 19 06:53:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 9735963 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 07306601C2 for ; Fri, 19 May 2017 06:58:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 002B7288A6 for ; Fri, 19 May 2017 06:58:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8FCD288A9; Fri, 19 May 2017 06:58:33 +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 A931E288A6 for ; Fri, 19 May 2017 06:58:33 +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=XPje81xd3zayWCyP+Z7zvhu7nbJbWGAIKkzCfyPX8EA=; b=AUzt/SyEcscQSKMVarO7pDpXzm 8fOMoxACQjvmYUu2gpvXzqsH9UzXUPP8N1vH69PZtX7YD7L47S/GVFO12QwDwMF9zRLXX9ZOuBqpw SADZEvESWkc6sDMybTX++WP/R9PX4sGZjl+xz2T9az84pSSfUbmjuy6fguTH3SMcWugXJUJ2QFsbl d2374fva5WJYq5MHjyAL8YAgpz1iTaUBbeO/DpTR11X+Uhn4b3QilEsJ1yaVVKoMxpP8GT/t12Bz3 i/Zgr/rTKbr9wVawZbyfQEeNSSSWJ5/StILyT48EpS3Lmf1g7UsvJETUC2OYD08hJP18ZWGAWh719 yvXmr5xQ==; 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 1dBbrr-0006p8-Vi; Fri, 19 May 2017 06:58:32 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dBbpg-0004R0-CO; Fri, 19 May 2017 06:56:18 +0000 Received: by mail-wm0-x241.google.com with SMTP id d127so16122604wmf.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=fdez7CM6gn6RWh3X27XKTmzyJj3Fa5v1Qpu6rjZATkM=; b=ZEknJH9ElpPfzPRbV17bfDcpV5iU52+VibvOHhMmkSFyyJtPt2Ri+/bdG2+FBAmkLV nVtDQCHyqFD2tC2nh4FocYx8QsjicNirTue7yx6grSrCDFpJgQ1p1HR7FxO2JvJ5FnHV vKK+BcK/V3PUFN7QAgUbJE4XmJfaMWOGRyOXbO3jo3B9oRJSa4EkyYIOJkx0Abz8SlZc EsB+AfaCDMy8ot96vDkCvfXSNnT/HEu1auJCC9Aj56nbARDUxZDj+CXgukvZWtuhUUC8 hkpwQlXYfvnDNq4S6PL6g7Y+d8eALIPEqKZJUaoz0Jno5uZpvG1ipMibMN9FL0awk5tL hClg== 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=fdez7CM6gn6RWh3X27XKTmzyJj3Fa5v1Qpu6rjZATkM=; b=ZO6RZSS0bTLVLSlgmLTQmYPMor5LrBg/EF3cIxTsiAPE1hL1DUMz7l92N0xv9+Garb NWbq/gHk1wADej+ttsBAXsCJn2ibiCuOZxs1EVhgS8/snGjFANgh9H74JbfW1Bz/AVEd DP208rTpk/CdlcS8P/cPiMWt+5C9VZhOiovszUxfIkErvGvqNXB+5U33dwzoFuMo/IJz p4Y1hlTB4XIKF43IH+wtX5fT8Pk4QqvG90log6fM2OxorTGWjn3c0lUAMHQfpgQ8WC7o 4yft4XTufdomk36eDhqD5DzS+ACYZXetyu9mnLf55jumngRmTm9yl4NtQ49S0bLJ2xKT MYQA== X-Gm-Message-State: AODbwcCoE4A2a5li+37W/Ei1eR2q4wf+Jmd1yNhy+fp4z+Yx7Ofr6lDO hLDCikJyFbt9iw== X-Received: by 10.28.153.143 with SMTP id b137mr5793376wme.15.1495176954763; Thu, 18 May 2017 23:55:54 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 May 2017 23:55:54 -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 8/9] crypto: mediatek - Use IPAD/OPAD constant Date: Fri, 19 May 2017 08:53:30 +0200 Message-Id: <20170519065331.27670-9-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_235616_570825_C90E2438 X-CRM114-Status: UNSURE ( 9.50 ) X-CRM114-Notice: Please train this message. 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 Reviewed-by: Matthias Brugger --- drivers/crypto/mediatek/mtk-sha.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c index 2226f12d1c7a..5f4f845adbb8 100644 --- a/drivers/crypto/mediatek/mtk-sha.c +++ b/drivers/crypto/mediatek/mtk-sha.c @@ -12,6 +12,7 @@ * Some ideas are from atmel-sha.c and omap-sham.c drivers. */ +#include #include #include "mtk-platform.h" @@ -825,8 +826,8 @@ static int mtk_sha_setkey(struct crypto_ahash *tfm, const u8 *key, memcpy(bctx->opad, bctx->ipad, bs); for (i = 0; i < bs; i++) { - bctx->ipad[i] ^= 0x36; - bctx->opad[i] ^= 0x5c; + bctx->ipad[i] ^= HMAC_IPAD_VALUE; + bctx->opad[i] ^= HMAC_OPAD_VALUE; } return 0;