Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10186464ybi; Wed, 24 Jul 2019 17:56:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/AeMtuZSyp25GkTEKlYwpiGnOvjlaCiB60pNjHkWgMZnnkMFeQNyWP/n8/lD6ORmvh4hD X-Received: by 2002:a17:902:934a:: with SMTP id g10mr90068656plp.18.1564016176321; Wed, 24 Jul 2019 17:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564016176; cv=none; d=google.com; s=arc-20160816; b=HAfgiGbtDc3cxdJQBa+/OTO25tO2EkahHah97qYELaCn0jfbEZ3CJTwBDAzJx7cw1x qYaZtOpITXkfMi6WL/dV9qLgHju3hU2vqPVGP2DKa/pi+2OGK2HGIpTfL8gImsUQh/W6 JsDCWq2PTy75qZKatAThNaXX4lseusmXNJHfhTu5GwW8GHImdbiJbiIh3iZihZdYwFRM aBTu2a/X3DMfbJ1Q9miXTFNuJjeEMDEp+8T+1Sfj3F0pVPPU3yEjdSWOGPKTjU2dNkik ITdjbhkr3hWUsiDXSXoccmc3/g4iiFeeaz6o1JZ7CI13VSLwurttT5WRL5POxvd5b7Av vSIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TlVuP7TUvVHRT1uCkH0GX9w/9skj7ykuau6UsFNhiRk=; b=hdiOEFEWVzXX7mcRlvzqqOGcZaJDTEgj9wA93+JgvuqicmLwIetLCtvGV0HfSng8BD StAOZUqPp1RpHy5nV5+TfCwvc5ubauReLKsZqzHOPHzKEGnylstz86IKwWAuaNgqPDhB 1bcAJGoZIf4KZ5nNvyfG3bf1ICd00zeVQOrpoNBdOozXnCysvAIg3jQYxPCrKh5WkBLw CoI94y3UVLJxru9mAttUL5EBEo+2ROHMIYmAfCqEcBqjGr8ZFrKHvnszALiWg2ZqIQf0 PLWGmCB+VWltW6W7c2Xb9mjwI4dF/NiUYCpt6stFYp0/1g/4XatTqz7aUMNlmvaX0tBw UQJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zf6ZVDXZ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15si16446195pjv.54.2019.07.24.17.56.01; Wed, 24 Jul 2019 17:56:16 -0700 (PDT) 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=Zf6ZVDXZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389257AbfGXTfn (ORCPT + 99 others); Wed, 24 Jul 2019 15:35:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:33366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389241AbfGXTfk (ORCPT ); Wed, 24 Jul 2019 15:35:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 D7F4020659; Wed, 24 Jul 2019 19:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996940; bh=tUGfxRu2YMxkmJxgngZp/LCB7ckMfZ7RAQfzzTpcoEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zf6ZVDXZxpmuMjUJUeVD1R0wuJBXGxAO+lLRCsXdydPf9Y+0xovInAMWY1pAP7+fL Y722z49788RNDKEaRYGxQ77ulSLXZ116tripqgsywMIy40qGTF73Zyf6tP1TxySG+N HRdAfBI3PGQ4gu44mA7YikBEV5wPI6Z02o5eQJ6Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Lamparter , Herbert Xu Subject: [PATCH 5.2 269/413] crypto: crypto4xx - fix AES CTR blocksize value Date: Wed, 24 Jul 2019 21:19:20 +0200 Message-Id: <20190724191755.470207531@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christian Lamparter commit bfa2ba7d9e6b20aca82b99e6842fe18842ae3a0f upstream. 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 Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/amcc/crypto4xx_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -1243,7 +1243,7 @@ static struct crypto4xx_alg_common crypt .cra_flags = CRYPTO_ALG_NEED_FALLBACK | CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY, - .cra_blocksize = AES_BLOCK_SIZE, + .cra_blocksize = 1, .cra_ctxsize = sizeof(struct crypto4xx_ctx), .cra_module = THIS_MODULE, }, @@ -1263,7 +1263,7 @@ static struct crypto4xx_alg_common crypt .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, .cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY, - .cra_blocksize = AES_BLOCK_SIZE, + .cra_blocksize = 1, .cra_ctxsize = sizeof(struct crypto4xx_ctx), .cra_module = THIS_MODULE, },