From patchwork Fri May 19 06:53:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 9735941 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 AD616601C2 for ; Fri, 19 May 2017 06:57:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A84BC288A6 for ; Fri, 19 May 2017 06:57:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CD6A288A9; Fri, 19 May 2017 06:57:47 +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=unavailable 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 527EB288A6 for ; Fri, 19 May 2017 06:57:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752411AbdESGzy (ORCPT ); Fri, 19 May 2017 02:55:54 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36090 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752163AbdESGzu (ORCPT ); Fri, 19 May 2017 02:55:50 -0400 Received: by mail-wm0-f67.google.com with SMTP id k15so14862670wmh.3; Thu, 18 May 2017 23:55:50 -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=T9FR8GC4c8ynb0akePyCRKVjbSAcOylo+8iyx/idBfg=; b=vPnbqoDfsscXdIq0ajdLz+y2LoS+mLuCN08HEP+SHDRqxaW2QRrTfFAcl+tnmxccja RpJkeFCMfn+2C2JlBYW3DklRdDopk7aHTAaSsC3EDve8Tl+OmR3XbSQ/7JEzdvgTiyjT CX9Rtjv9s2AdEMNAS/biR128EOMSLo/ndpufWpn/adXeeJGipFwc5RQo+lEhonhs/UAS VLEqWekZzLSWr3CVKKB7NpYZtJ/t80XKDzg+g9WGuVTmJUBUkCeEs/QZVMn6fsXS0RVj Pr0/PWZrz15UJfTlvD2+Jee4LSR5rWgFGNAHtr7I8Tk8q9nQ2q2tF5ZGKpRPQP0b35yp jT8g== 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=T9FR8GC4c8ynb0akePyCRKVjbSAcOylo+8iyx/idBfg=; b=iYZiXTbdP6viRM0wEFUzgOdH1h/2aSArJIZicnC73x2o5IFV2rZH5sim8cNpITQ+i5 5NX7RZF/j5ZaYovWyP6GN6ckd9HtAv9TOUmZ+oZ3rhRIsX2EAxvAipNik8Sm7P/TZNGd mI9y1nLUT6AZf9RV3eGwP3PnqH3DvPAEyn2yt3B/Uiiv1MfTjKPDHbh5kIKLTFEpXPwS +2bVRZ3b/8llZ735cJnxO6vcIDfH6K/tldAQia7msnlhCDil10nsqualc5t6DoTxjMhn zT1Z1JQDuUDwNpoaKYBxCSzkoAoGZJE+P7V0/La+dlKP/Vh3tUdksO1VLNadWEjgYA6Z OLTg== X-Gm-Message-State: AODbwcDYWcrYsc9g5/oUy3VFJJtSf5+nNr5kgtBO7CaHISiMm4Vi2wON GTZFiOX6zcSTXA== X-Received: by 10.28.62.81 with SMTP id l78mr16409334wma.105.1495176948420; Thu, 18 May 2017 23:55:48 -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.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 May 2017 23:55:47 -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 2/9] crypto: brcm - Use IPAD/OPAD constant Date: Fri, 19 May 2017 08:53:24 +0200 Message-Id: <20170519065331.27670-3-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 --- drivers/crypto/bcm/cipher.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index cc0d5b98006e..61393dc70b0b 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -2510,8 +2511,8 @@ static int ahash_hmac_setkey(struct crypto_ahash *ahash, const u8 *key, memcpy(ctx->opad, ctx->ipad, blocksize); for (index = 0; index < blocksize; index++) { - ctx->ipad[index] ^= 0x36; - ctx->opad[index] ^= 0x5c; + ctx->ipad[index] ^= HMAC_IPAD_VALUE; + ctx->opad[index] ^= HMAC_OPAD_VALUE; } flow_dump(" ipad: ", ctx->ipad, blocksize);