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: 804320 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xc3QH48g0z9sRm for ; Tue, 22 Aug 2017 18:20:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="abvSZj7V"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xc3QH2qyPzDqkY for ; Tue, 22 Aug 2017 18:20:07 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="abvSZj7V"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xc3CQ3StdzDr54 for ; Tue, 22 Aug 2017 18:10:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="abvSZj7V"; dkim-atps=neutral Received: by mail-wr0-x242.google.com with SMTP id f8so16134549wrf.3 for ; Tue, 22 Aug 2017 01:10:42 -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=bGgALQtVviwE4l3oA1dnx6rI28C74SDtZIiDdkqPOayrY7XzoZ8ouR4BbZ79JNQEsn 3o/oMSHhWBn1tsz7hCb5nUEE6VPXuuV2KstvTd2RU11IAfU2aKEMgPPvbJpt5amTYytf ph/AdO46mclQHw6YpTkJRurt7yUlKJ+kwL8th20DTO3A0hUhyFLm7ENQjw5iFtNQhUjK SM8c1NYzha+xDjihpgtI1cqnsrjIn2MIlp6OfiCaMjeEcOeCa8ZaHCQsQwLudiP3F7Nl 6yW+wojZr4H5d2NEEkXM8XlJyC/ffywKV0OkbT5TRYqT1qxfYDpSX4w6JumGdgI5ehNn hhyg== X-Gm-Message-State: AHYfb5gpQaRHs1ewP5oTWY8d25cP4wq5vQMosK3Bf5AWVYVf6G/+1Lqw 8SwdkwLClCoQOw== 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-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List 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 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 = {