Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3461218imj; Tue, 19 Feb 2019 04:03:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IbgwRwWdPbFWC3Edd9ipKALNxR7p7KCz+1rTv2ZgT/tVuYvbDAnPChrrUb0uygBHynXAa42 X-Received: by 2002:aa7:8212:: with SMTP id k18mr29233245pfi.48.1550577796557; Tue, 19 Feb 2019 04:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550577796; cv=none; d=google.com; s=arc-20160816; b=KEN7IzsUXmtUOd+cod3oagvx/FFDQH0bU7pOAwN/HlcOK61cy9QL7MY6y/HWPreWjG UWa+cJREXXrWp/f7D7rmfAUu5LacxZPAFtbAP4kI+vD73hoZaATsQquj9NfHe6cwjMJn 2dYKVZdXBlTO4gox0h4+27n6VKFHSxhCO65XbEU5nH/+yvfCExtw9t7FvZIQ2TjYoPLl QlSL588Cut68fQ1/qXrbHIz76XwBUckriFcqtDZ9h87z1K+xxAMqgqViGA2EzAtXNU2G hvI6h6nnoK1h/xaFj+DA7hoiztRdfTLHq8wJBIPS5+nAfoObAdUH+lpJqHdlmKc+xEpA M4WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/l5sIeZp76YzU4cp9nueGtq9KLxsY6L96EBuCMRL83k=; b=ml6qu+fO93BElrtKxIgqPiLCMpDFIhPryUA36ACbM0ISxjE/Rh4Urj+GxvnTBCqhvt yqp9VPm4tcwwJUQz1a7c5WEJDuqFLzr2598VaqlUkMSf75UhS7MaBvJ7rNssj4oFYz+e Nz02dX2SN1bVIFT1fPHQytxg5yKcCfCTYyB1Rduuh8uJ+Vu93p3c/HsrIMyFVv5E63Tl FTlbPZh87+uoHii4QlKrb77qA7psJ1ZCsIFwUJ5m3/2mVX6tp9M9QocOcfaImv+SGjR/ yqpuLS2CO4L8Pb/qlmdDRzX3O60LYZssmNcHDSqrtbrEQ0JHIorZwOuWIxc7jOb206im sRag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O5JB5PSx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si10707265pli.428.2019.02.19.04.02.55; Tue, 19 Feb 2019 04:03:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O5JB5PSx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728018AbfBSMCX (ORCPT + 99 others); Tue, 19 Feb 2019 07:02:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:34270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbfBSMCX (ORCPT ); Tue, 19 Feb 2019 07:02:23 -0500 Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 39BEF21738; Tue, 19 Feb 2019 12:02:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550577742; bh=vvgPUmPHLHFQpog5R2xIDB0Imy2VOr9vESE13puopzc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=O5JB5PSxWhS6eJvCFTL5MKUNnWCFciIzdfvP3uX6MIbqEDvT71G21oV9lkJXPqxud OkWDzQ5Kn5Bl3WRiXDfAAXCP75x6o1RnXZ9gbfime6SwKnuzUTjmb5sT4TZ6eeFw4I Jat5BJMlYznIGcDWcTJKh3ZYNWM8NLwJlhQy005c= Received: by mail-lj1-f182.google.com with SMTP id a17so862473ljd.4; Tue, 19 Feb 2019 04:02:22 -0800 (PST) X-Gm-Message-State: AHQUAub+hho4tdlsU23P6lNdTaFqQcBy9tQOOjlefrse1J0Y3bpVk0L8 J/itTlGjiOiLXPFc4gAazn461wK/NbuNtwjJ0ak= X-Received: by 2002:a2e:4a19:: with SMTP id x25-v6mr14923974lja.19.1550577740347; Tue, 19 Feb 2019 04:02:20 -0800 (PST) MIME-Version: 1.0 References: <20190218160046.6387-1-k.konieczny@partner.samsung.com> In-Reply-To: <20190218160046.6387-1-k.konieczny@partner.samsung.com> From: Krzysztof Kozlowski Date: Tue, 19 Feb 2019 13:02:08 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] crypto: s5p: update iv after AES op end To: Kamil Konieczny Cc: Vladimir Zapolskiy , Herbert Xu , "David S. Miller" , Eric Biggers , linux-crypto@vger.kernel.org, "linux-samsung-soc@vger.kernel.org" , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Feb 2019 at 17:01, Kamil Konieczny wrote: > > Fix bug "s5p-sss crypto driver doesn't set next AES-CBC IV". This should > also fix AES-CTR mode. Tested on Odroid U3 with Eric Biggers branch > "iv-out-testing". > > Signed-off-by: Kamil Konieczny > --- > drivers/crypto/s5p-sss.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c > index 0064be0e3941..3ea058addad3 100644 > --- a/drivers/crypto/s5p-sss.c > +++ b/drivers/crypto/s5p-sss.c > @@ -463,6 +463,9 @@ static void s5p_sg_copy_buf(void *buf, struct scatterlist *sg, > > static void s5p_sg_done(struct s5p_aes_dev *dev) > { > + struct ablkcipher_request *req = dev->req; > + struct s5p_aes_reqctx *reqctx = ablkcipher_request_ctx(req); > + > if (dev->sg_dst_cpy) { > dev_dbg(dev->dev, > "Copying %d bytes of output data back to original place\n", > @@ -472,6 +475,11 @@ static void s5p_sg_done(struct s5p_aes_dev *dev) > } > s5p_free_sg_cpy(dev, &dev->sg_src_cpy); > s5p_free_sg_cpy(dev, &dev->sg_dst_cpy); > + if (reqctx->mode & FLAGS_AES_CBC) > + memcpy_fromio(req->info, dev->aes_ioaddr + SSS_REG_AES_IV_DATA(0), 0x10); > + 0x10 -> AES_BLOCK_SIZE > + if (reqctx->mode & FLAGS_AES_CTR) if -> else if Beside that looks good. Best regards, Krzysztof