Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2314187yba; Fri, 17 May 2019 14:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxY9vkpjJkHWrPhIMjmYXgal/iuV4BY72/99wo3jd4mpzmp00pVTbk0tZnJw205G/Z9f9Ep X-Received: by 2002:a63:40b:: with SMTP id 11mr42829162pge.31.1558129475124; Fri, 17 May 2019 14:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558129475; cv=none; d=google.com; s=arc-20160816; b=tncAkjZO4yksy9xlm4SsGm8bqDTVOzB7NAaECT12TkHwrrJNUaanopntIUUOVU0mDr CWSRFesff4MBIVLmFW+Hb2AKOfKrS67++m94Mri22V/EET65WRGS/jMgeoFmk5n7rC+o j+WhQc3x6+EgWTVLXedn/QVy91434UPuoyewKYcSihFGhcgNMTUqKs/ya688j3vCySqs GVi31yToVr0G7W4cvqYN1WH9SszyEPflrSykhNOZGBz6GgiQuuad3H1gOLzMGLhM173y R5Lanb30DZ9mO8nwZHQEqKf9g/n0jtf2dkKBYCwGBhe73xsAft66goIwyFOccMwDzmH/ vWgg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=m+YbJf9jP7/BEZ4PjaLQYBIWecAPbt3lPv5XSQptNjY=; b=VVaODQy3N1G0ks8sYXt10Ggfhde8GWS611KdJPZz8WfgNNRCjQQchK4VNGiZiQdu2y mslYSLmrt4qajb13ViLQ2vQkolCrjcYluz8kHYyYKAxGW/6pSgGkNj9QZ+hzpGC+RbQ8 18Y+xnFTdEZFCQZPFYcsgMvNOl8Bhf/xhRve75U39E9d2JRyx7tOIZfSxXoYxeNSfJO7 lkB92I1Dot11Fbmo6jTXlA/Lobjhbh/G9C4/x+SFOop3VU+mtNW5YMRAh5HnNLSgeMEj HolAiToJdDQMUA+V1YoocVWgwmjnwNMDDRjpwNBXoMnRw+U9sCiPlaX2Xzd1e4rFjbkI sB5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Bf48I/P4"; 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; 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 m7si8726496pll.403.2019.05.17.14.44.18; Fri, 17 May 2019 14:44:35 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b="Bf48I/P4"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727843AbfEQVmP (ORCPT + 99 others); Fri, 17 May 2019 17:42:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:45572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727771AbfEQVmP (ORCPT ); Fri, 17 May 2019 17:42:15 -0400 Received: from gmail.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 287C6206A3; Fri, 17 May 2019 21:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558129334; bh=QBwVcrPHf5DzWZX3n7Xvd3K3qOgGi6ytpBDnqSCRT9Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Bf48I/P4Iqmr3zsotgxE/tOgDis65ag4NyEYqUCuBGKBQ4xq5FLvrzImKyeL0d8u7 7ACDrBr2VRNFIfX4Wu59pZbsSLyD7h4RejZMpKd5m/p/AUUMK6RY8Ay4mq0XkOy1P3 onj0YNY8mwomxHlf61lXavlDtaA/kIJb8oPn2Vx4= Date: Fri, 17 May 2019 14:42:04 -0700 From: Eric Biggers To: Christian Lamparter Cc: linux-crypto@vger.kernel.org, Herbert Xu Subject: Re: [PATCH] crypto: crypto4xx - fix AES CTR blocksize value Message-ID: <20190517214203.GA153555@gmail.com> References: <20190517211557.25815-1-chunkeey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190517211557.25815-1-chunkeey@gmail.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 Hi Christian, On Fri, May 17, 2019 at 11:15:57PM +0200, Christian Lamparter wrote: > This patch fixes a issue with crypto4xx's ctr(aes) that was > discovered by libcapi's kcapi-enc-test.sh test. > > The some of the ctr(aes) encryptions test were failing on the > non-power-of-two test: > > kcapi-enc - Error: encryption failed with error 0 > kcapi-enc - Error: decryption failed with error 0 > [FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits): > original file (1d100e..cc96184c) and generated file (e3b0c442..1b7852b855) > [FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits) > (openssl generated CT): original file (e3b0..5) and generated file (3..8e) > [PASSED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits) > (openssl generated PT) > [FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (password): > original file (1d1..84c) and generated file (e3b..852b855) > > But the 16, 32, 512, 65536 tests always worked. > > Thankfully, this isn't a hidden hardware problem like previously, > instead this turned out to be a copy and paste issue. > > With this patch, all the tests are passing with and > kcapi-enc-test.sh gives crypto4xx's a clean bill of health: > "Number of failures: 0" :). > > Cc: stable@vger.kernel.org > Fixes: 98e87e3d933b ("crypto: crypto4xx - add aes-ctr support") > Fixes: f2a13e7cba9e ("crypto: crypto4xx - enable AES RFC3686, ECB, CFB and OFB offloads") > Signed-off-by: Christian Lamparter With this patch applied to the latest mainline kernel, did you check whether this driver also passes the in-kernel crypto self-tests when CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y is set? Those should have detected this bug too, maybe even without EXTRA_TESTS. - Eric