From: Corentin Labbe 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> References: <20170822080818.12486-1-clabbe.montjoie@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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 Return-path: In-Reply-To: <20170822080818.12486-1-clabbe.montjoie@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: linux-crypto.vger.kernel.org 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 = { -- 2.13.0