Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3918953ybl; Tue, 20 Aug 2019 04:24:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnH7+HSkhQNIVa+hJoUamWCBmCBx9HKTvgswCYlUMrkiyHTmOc3jue6+AHkIPeTObrKJ0V X-Received: by 2002:a65:5188:: with SMTP id h8mr24214574pgq.294.1566300276944; Tue, 20 Aug 2019 04:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566300276; cv=none; d=google.com; s=arc-20160816; b=dGkizNpmUsmcUwgcFmiJo8T8wm2VcZ1Mea51dGQPhHdf+k8eUwQhA8pPfOwib0w+9V BCZbEU9+Nr7by8o2H7PPHDgW2egovlIR+7Yn89FRXhETOMHacB09T9HVaAQAAYioZkFx 936wKj8V5rBOSm3gUlFEKyUVDZQ05neOLAqtfWqBYLdODVMJt8pmFtVBkmAqEyzTPLjm rUUG7I11qCrbfavpwHVVnYvbT+m1GEP93xHw4I0qBYHEhCm450vZkWLOhcZkhmVfV1eZ iC1rOrbzcuTQjsSsVYkfxe4oqGUCFVyUEsRitZe8VPKjgews2VoXj4U7uMPFjZSDDO3+ 6t2g== 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=320tA3k60X4eIUHLUG7C3siMVsuI69qpMnCCZY9s7lI=; b=s6IOPQuaHbc+9dLKwRXbk+aMaak0Osc0gpFyv/2me42zYXYtRbg8UKH4gIlCEp3umN 7gQ8T1wu5mOA6WBcZg7V3WbhOz+BbySxMCkTtktIEhNWgWTZ8LCZ6l628WMnHKNUCVrn GliABYmtkBVuOtehiadTBo4txIhKwN4rv1SV4/mj3ewbTzyFzJC8bsb+dvRutXYC3yno i+mnVWANv2n4ElgLGQAy9caLUgsZ2a0H7uk3PeZKGkl2z1WEr9ICmFy27RGn0wrdf3py bsA/WurYIM9L5f2j5VlPsQFM+X5wa1Q2VS/QUrkwngfbjmruBRu6F5xAwhZQdNqYB9wM 5Qqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rPDLY8JG; 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 36si12370947pld.289.2019.08.20.04.24.15; Tue, 20 Aug 2019 04:24:36 -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=rPDLY8JG; 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 S1729428AbfHTLYN (ORCPT + 99 others); Tue, 20 Aug 2019 07:24:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:40428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729383AbfHTLYN (ORCPT ); Tue, 20 Aug 2019 07:24:13 -0400 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (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 54B572082F; Tue, 20 Aug 2019 11:24:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566300251; bh=5WCmJYRjGpn+/SzaeT1Y1kTMHP0lsFrPkA4AnobQEis=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rPDLY8JGRAPctm5VksmKdMerPoVtblNx+7xLzl0wLrqOdswPZKJuVf1rvv3xmpNKQ ezgDI2o+sjOIaNVOGRl8aL661w8B0rE6Mo9v63rMFLu/E6xozrEAyB9eu4MivnuDM3 A+rR9ydi4Ua/m4AWbTC5NpNhbrtdZV84dwJjS48U= Received: by mail-lj1-f181.google.com with SMTP id x4so4764284ljj.6; Tue, 20 Aug 2019 04:24:11 -0700 (PDT) X-Gm-Message-State: APjAAAWyzfwKn4KczLC9ZxOuQeotnEUfZCNIR4bVwZioO3mq0eFgw0+L 3TFfKMEXPWiDegLQnjWhqoPES8iGJ765HSbg6tA= X-Received: by 2002:a2e:9acf:: with SMTP id p15mr15670614ljj.13.1566300249554; Tue, 20 Aug 2019 04:24:09 -0700 (PDT) MIME-Version: 1.0 References: <20190819142226.1703-1-ard.biesheuvel@linaro.org> <20190819142226.1703-3-ard.biesheuvel@linaro.org> In-Reply-To: From: Krzysztof Kozlowski Date: Tue, 20 Aug 2019 13:23:58 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] crypto: s5p - use correct block size of 1 for ctr(aes) To: Ard Biesheuvel Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Herbert Xu , Vladimir Zapolskiy , Kamil Konieczny , "linux-samsung-soc@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, 20 Aug 2019 at 12:57, Ard Biesheuvel wrote: > > On Tue, 20 Aug 2019 at 13:24, Krzysztof Kozlowski wrote: > > > > On Mon, 19 Aug 2019 at 16:24, Ard Biesheuvel wrote: > > > > > > Align the s5p ctr(aes) implementation with other implementations > > > of the same mode, by setting the block size to 1. > > > > > > Signed-off-by: Ard Biesheuvel > > > --- > > > drivers/crypto/s5p-sss.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c > > > index ef90c58edb1f..010f1bb20dad 100644 > > > --- a/drivers/crypto/s5p-sss.c > > > +++ b/drivers/crypto/s5p-sss.c > > > @@ -2173,7 +2173,7 @@ static struct crypto_alg algs[] = { > > > .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | > > > CRYPTO_ALG_ASYNC | > > > CRYPTO_ALG_KERN_DRIVER_ONLY, > > > - .cra_blocksize = AES_BLOCK_SIZE, > > > + .cra_blocksize = 1, > > > > This makes sense but I wonder how does it work later with > > s5p_aes_crypt() and its check for request length alignment > > (AES_BLOCK_SIZE). With block size of 1 byte, I understand that > > req->nbytes can be for example 4 bytes which is not AES block > > aligned... If my reasoning is correct, then the CTR mode in s5p-sss is > > not fully working. > > > > > I re-ran the kernelci.org tests with this change, and I saw no more failures. > > https://kernelci.org/boot/all/job/ardb/branch/for-kernelci/kernel/v5.3-rc1-197-gc8809c50be4f/ Indeed, self tests are passing. Anyway the change is correct so: Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof