From patchwork Tue Aug 22 08:08:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 9914513 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 ECC2D600C5 for ; Tue, 22 Aug 2017 08:14:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0215728820 for ; Tue, 22 Aug 2017 08:14:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E970B28829; Tue, 22 Aug 2017 08:14:53 +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=-2.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW 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 772B528806 for ; Tue, 22 Aug 2017 08:14:53 +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=k8Tflyx2hL3A5f4E6dpyhEAVonth6UBskV3vgmPhtHA=; b=L2+f9WNZaTXBP6goFd/AMXq8Qu Dw8MO6O4Gh4tAVPRWYMBdDt6atOiyuhQrq3x3Z2fRa8NsEtudPVD9Nj4mQeIkz+eM8nB8VcvlW4Ih 7Fw+kMRr6n7rHVEJ5JfyvOeuIyTUC66Bc/Chz/+fgMYj5Lnt6ZAOLAh0d/V3nDGcxpegGyVKgDdFG zT+8MlwbrYG22r7eDId5TwlR8N9qElWX1/CzSF0UHoOgwPkzTBxgUHefRcrBB3rMrixui0S4sHbXn USpiM44ZoH7uwNClFL4pTGwbkCdB1esR42n5PwFDNp58rbjHFXt6v9ZGMA+vV3DtAuU/wpuxFISsL SA9Azrgg==; 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 1dk4Kq-0005qc-6C; Tue, 22 Aug 2017 08:14:52 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dk4H7-0001QP-Iw; Tue, 22 Aug 2017 08:11:14 +0000 Received: by mail-wr0-x244.google.com with SMTP id p8so18630289wrf.2; Tue, 22 Aug 2017 01:10:41 -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=hypFIm8H7vHplowgkhFkbCQNpzqfpLOkoS9NMohDDe8=; b=abvSZj7Vi8QRoyb1IJ0tc9BmRD60xgUgQ0YxrBn1hlxGtS+dR255yCYT0RRKJJhs7J 5rNPJqDUR+CudJHswaomACVuWpSv52ocqWpj9qvuXY2MdBBWFm7Isln4iK5vvLih3pVT aaIS8LtPzmvD7ADV32vsi440S4GDSG5SIJUmvYtfDqUn9Nv80LEecexRUa4lUX8hu09R EFQhIPPfGVf1uUsrQ8Vapx04yMMZHg3IrjTDwUsxWsW2f5ZRHsysj01r+AlJ9Avzdin4 KEVBjIpkcV4VHCy+62NSu0S2Q9zjAvj6o6QpqSmCBZ2jR50KxuwkKigdGRfwrTSR1FMj D/5w== 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=hypFIm8H7vHplowgkhFkbCQNpzqfpLOkoS9NMohDDe8=; b=XKzbHKEeF5hxgQYup2CONpR5ZtrJVe3/w4xy66PkmnYoi3xtO4XbJ6ovg34BnbBB5r lX44iU36r6Oy4572vUupKLRKARDXp0B2scZt9y/5r2tfbc/xl1l/DchsyTlvXEhOvoOy vi7/6lRbvOktfqFozE19+0YSEa2RLgoKjbsEfXqU46P33pAO6EVndabQCX/onwNoxukW /OxfRcOWyDkKBIc7Kekx/g0DHzIZkyVCAgZWdnx7AIfLkYCiK6UDQUehcWeRPiKTPV1D JKXT8kSuljykJKYvQKe3+STlrDxq5d6MyoPlvNjdju6TnZ34yLidbZ3Sjgl/q4FrNWvj hf1w== X-Gm-Message-State: AHYfb5gpEok4wI+JjHGvloY9f+NS5eAoZUjqgLSiRG4CcRjUI2sRyAwj j8oPK7AhPQyF6w== X-Received: by 10.28.33.67 with SMTP id h64mr6973818wmh.87.1503389439938; Tue, 22 Aug 2017 01:10:39 -0700 (PDT) Received: from Red.local (LFbn1-1-65-78.w90-118.abo.wanadoo.fr. [90.118.156.78]) by smtp.googlemail.com with ESMTPSA id e21sm10778796wme.17.2017.08.22.01.10.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Aug 2017 01:10:39 -0700 (PDT) From: Corentin Labbe To: herbert@gondor.apana.org.au, davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, horia.geanta@nxp.com, dan.douglass@nxp.com, thomas.lendacky@amd.com, gary.hook@amd.com, harsh@chelsio.com, matthias.bgg@gmail.com, leosilva@linux.vnet.ibm.com, pfsmorigo@linux.vnet.ibm.com, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au Subject: [PATCH 05/11] crypto: atmel - Use GCM IV size constant Date: Tue, 22 Aug 2017 10:08:12 +0200 Message-Id: <20170822080818.12486-6-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170822080818.12486-1-clabbe.montjoie@gmail.com> References: <20170822080818.12486-1-clabbe.montjoie@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170822_011102_725456_BDEEC2A0 X-CRM114-Status: UNSURE ( 9.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Corentin Labbe , linux-crypto@vger.kernel.org, linux-mediatek@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch replace GCM IV size value by their constant name. Signed-off-by: Corentin Labbe --- drivers/crypto/atmel-aes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 29e20c37f3a6..903fd43f23a5 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -1532,7 +1533,7 @@ static int atmel_aes_gcm_start(struct atmel_aes_dev *dd) if (err) return atmel_aes_complete(dd, err); - if (likely(ivsize == 12)) { + if (likely(ivsize == GCM_AES_IV_SIZE)) { memcpy(ctx->j0, iv, ivsize); ctx->j0[3] = cpu_to_be32(1); return atmel_aes_gcm_process(dd); @@ -1820,7 +1821,7 @@ static struct aead_alg aes_gcm_alg = { .decrypt = atmel_aes_gcm_decrypt, .init = atmel_aes_gcm_init, .exit = atmel_aes_gcm_exit, - .ivsize = 12, + .ivsize = GCM_AES_IV_SIZE, .maxauthsize = AES_BLOCK_SIZE, .base = {