Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6310670ybf; Thu, 5 Mar 2020 17:52:04 -0800 (PST) X-Google-Smtp-Source: ADFU+vtov4FAQmswBZSRvRZquMXf6/RdM+yhtrNiMuvUdEsCbmdmHO5igmFrfDmiztEB3gi/vyrZ X-Received: by 2002:a9d:ec7:: with SMTP id 65mr651101otj.309.1583459524495; Thu, 05 Mar 2020 17:52:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583459524; cv=none; d=google.com; s=arc-20160816; b=teaxALCTdB4AmgClIyIIno4bcg637YiZQPFv2w3ddVZSmF+/th4OmZUQ+aKFtKMIbt 3Z37qNklBJTw9An0Ewuqs6oZPOsPqieiVqIDYrAyuu6252VWIBw3PF1czt/ACVphoYnU YmgQWx2mONp5QYiUG3Jzs1coUXFGt3VcQalI7QQhB//STQCtQeebQtkR1wu1VNN0OkCg OYoQjPITsU/REod250o6PW238+etbcHEAUOMqmvZ6q552WvYMXGqNf4TlMWylx/rKbzo J/7TIBRBw7T1FK6m7xq3TAmPAmvFF6PC02xG0e2BSFNpe52Ag7QtRRB4OUivtQ67CHnS +j6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lm6rfWBlRlEze1GSJMgHQkLegUjdx0H/L6cXwUZfRZo=; b=D2lDZ8QQM7gVPLYn6ZFqhY/GsqyBKCOvigu+rZMm21wqPeey03o/Stsw8BhDEcXHM0 sUy0awHa3wyCvA94SwZ7dNTRro9v5eUc3kR0+IxXJ0kABy+FKzw0Q9YqXWV6TPcsXTfB SMBRgujNBFNN7Mj3kGXTKLJFpUwniBJjz+XiLE2vSLiu6Antb+wmTrPhdep0oeTb2FSJ 8GBBBXwPjYDLwpJSIX0r7leKPFhjHDLfslDRLhdWTH53e1agUkGZmbla6Zm1u+/Mq8/P Q3PIKeo9gNNDOseNhLR91gbrLHvPUwDHbrLjbsN/E5I5OspBq6DWxqm8JRs98tFTsJee cKUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si427053otr.94.2020.03.05.17.51.53; Thu, 05 Mar 2020 17:52:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726859AbgCFBvw (ORCPT + 99 others); Thu, 5 Mar 2020 20:51:52 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:46144 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726846AbgCFBvw (ORCPT ); Thu, 5 Mar 2020 20:51:52 -0500 Received: from gwarestrin.me.apana.org.au ([192.168.0.7] helo=gwarestrin.arnor.me.apana.org.au) by fornost.hmeau.com with smtp (Exim 4.89 #2 (Debian)) id 1jA29V-0005ta-FA; Fri, 06 Mar 2020 12:51:50 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 06 Mar 2020 12:51:49 +1100 Date: Fri, 6 Mar 2020 12:51:49 +1100 From: Herbert Xu To: Horia =?utf-8?Q?Geant=C4=83?= Cc: "David S. Miller" , Aymen Sghaier , Valentin Ciocoi Radulescu , linux-crypto@vger.kernel.org, NXP Linux Team Subject: Re: [PATCH v2] crypto: caam/qi2 - fix chacha20 data size error Message-ID: <20200306015149.GK30653@gondor.apana.org.au> References: <20200228065123.13216-1-horia.geanta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200228065123.13216-1-horia.geanta@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Feb 28, 2020 at 08:51:23AM +0200, Horia Geantă wrote: > HW generates a Data Size error for chacha20 requests that are not > a multiple of 64B, since algorithm state (AS) does not have > the FINAL bit set. > > Since updating req->iv (for chaining) is not required, > modify skcipher descriptors to set the FINAL bit for chacha20. > > [Note that for skcipher decryption we know that ctx1_iv_off is 0, > which allows for an optimization by not checking algorithm type, > since append_dec_op1() sets FINAL bit for all algorithms except AES.] > > Also drop the descriptor operations that save the IV. > However, in order to keep code logic simple, things like > S/G tables generation etc. are not touched. > > Cc: # v5.3+ > Fixes: 334d37c9e263 ("crypto: caam - update IV using HW support") > Signed-off-by: Horia Geantă > --- > drivers/crypto/caam/caamalg_desc.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt