Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3935587ybl; Tue, 20 Aug 2019 04:40:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5LgMZ8aFFo4P6uiPvZfbPzgZSibjObzZW3AjiR97VOMvvfhpry66r30kWDrYrjkRerRgM X-Received: by 2002:a63:6c7:: with SMTP id 190mr24134672pgg.7.1566301201583; Tue, 20 Aug 2019 04:40:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566301201; cv=none; d=google.com; s=arc-20160816; b=rFiltFibovXCJO6H4um/dp8mEr5wcSErtgQon5cJbOu/1LRG7MPqsEuEbXtAVmL2k6 3AVcSzJjLWGg6SLz+sbFeNNi2WPv0ckvwPPI54XXQdb4s2X0r5w1CoBCp0LWzOQYe2sP aNeOrab0O+VYNW9L/TZoKHgNnqpzMgRvanJEGtmsnNM4tQDsf3DkKx/zRov18bEfDUKv b6H9Rf8Ora/oBbaFey3vdMpSh+36a7r0F95+lxTol9vws3I10HwxUskhX0NdDlKmvVEj 1gpggLQwdii3Bmc+iqsDp2Vm9goBHB6y16ujxGgMCFidHJ1Jp256WVJH8/Anumx27Ver RxWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:cc:to:subject:dkim-signature :dkim-filter; bh=n6I429CajscHYniAY3jHYsJDaBT8WBSam7UO0dax+jM=; b=v6jmcNqleb0Sq/tfA6x0Pa5d7NSGb87ok7YgrI2/mV8wMZlpqOONnEkVmqHW3KRhMa D6DmgzKvjnAnyXoGhpo8vHFxIH9GJ5IPtZK1ynoDYkOF9CTjJngWsbpjrT9qj93GzBWe HqEFCEUvJG9BSVJpk2JEk7cxVhRUbYMRbywCJNEgUsajB7AlDLpKfvIOcuf3QeQ5CsRU qNh6BpLZFjzpt4po1cdDt3xewkWHKA30EIwTZaFj+YNfCZU1JNzTs1Fxz7AiGtHrorA6 ze77odekd1Yj8u/cLbhYSmp/zU5x87qJwH5MDxzTbDrY7mwAnDj0ZDyZS/YDgLAaoT30 CW2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Av80D5WB; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23si11831640pgg.131.2019.08.20.04.39.42; Tue, 20 Aug 2019 04:40:01 -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=@samsung.com header.s=mail20170921 header.b=Av80D5WB; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729611AbfHTLji (ORCPT + 99 others); Tue, 20 Aug 2019 07:39:38 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:34402 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729421AbfHTLji (ORCPT ); Tue, 20 Aug 2019 07:39:38 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190820113936euoutp028cd2a6af7e9fb788becc9a7909f4fb97~8np75qquy0730307303euoutp02g for ; Tue, 20 Aug 2019 11:39:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190820113936euoutp028cd2a6af7e9fb788becc9a7909f4fb97~8np75qquy0730307303euoutp02g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1566301176; bh=n6I429CajscHYniAY3jHYsJDaBT8WBSam7UO0dax+jM=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Av80D5WBlShR59ahNBniCTi2y5pm0SLCBBRz++K+5ejxdVgh9jDYlb3T5YTWgUCs3 UN/tGehxJVpckvdtDgIR7CFYS263U2m9gEbCUNmzg6aanrggJDJS7qWwnFuEF0GFtp NxDA8AofRAtbNq1zRDjuqQc/Qo9KQzUNwGoyCjWk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190820113935eucas1p1722022e5f58ff56139b3adc79be53dc5~8np7dMl3M1692416924eucas1p18; Tue, 20 Aug 2019 11:39:35 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 2F.9E.04374.7FBDB5D5; Tue, 20 Aug 2019 12:39:35 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190820113934eucas1p174389a9f248459b987f7ef08204a2944~8np6tAP_I0897608976eucas1p14; Tue, 20 Aug 2019 11:39:34 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190820113934eusmtrp225acf21e3379a91ffef8555cc379b04d~8np6e9QPE0719607196eusmtrp2H; Tue, 20 Aug 2019 11:39:34 +0000 (GMT) X-AuditID: cbfec7f5-4ddff70000001116-8d-5d5bdbf7dbd1 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 86.D7.04117.6FBDB5D5; Tue, 20 Aug 2019 12:39:34 +0100 (BST) Received: from [106.120.51.18] (unknown [106.120.51.18]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190820113934eusmtip10616ae24cff511076d0077dcfdaebd64~8np6KdosB2413824138eusmtip1A; Tue, 20 Aug 2019 11:39:34 +0000 (GMT) Subject: Re: [PATCH 2/2] crypto: s5p - use correct block size of 1 for ctr(aes) To: Krzysztof Kozlowski , Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, Vladimir Zapolskiy , "linux-samsung-soc@vger.kernel.org" From: Kamil Konieczny Message-ID: <1f932022-0335-1d00-b651-83c82d77fa7a@partner.samsung.com> Date: Tue, 20 Aug 2019 13:39:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEKsWRmVeSWpSXmKPExsWy7djPc7rfb0fHGqzZIGTx/8NuRovuVzIW 589vYLe4f+8nk8WM8/uYLP7/amZ2YPPYdkDVY9OqTjaPO9f2sHn8WziFxePzJrkA1igum5TU nMyy1CJ9uwSujBf34wt281TM7L7P2MA4m7OLkZNDQsBE4uz6VvYuRi4OIYEVjBKrr79hgnC+ MEps7VrMCOF8ZpTYs7qZFaZlZsdvFojEckaJVyf/QlW9ZZTY0n+GBaRKWCBQomPWYqAODg4R gXCJb+36IDXMAmsZJV5eOMkGUsMmYC7xaPsZJhCbV8BNomXmLEaQehYBVYmJW4xBwqICERKf HhxmhSgRlDg58wnYeE6g8Q/v7wcbwywgLnHryXwmCFteYvvbOcwguyQEVrFL3D52mgniaheJ x9N3sUPYwhKvjm+BsmUk/u+cD1VTLvF0YR87RHMLo8SD9o8sEAlricPHL4I9wyygKbF+lz5E 2FHi48tTLCBhCQE+iRtvBSFu4JOYtG06M0SYV6KjTQiiWlXi+akeqE3SEl3/17FOYFSaheSz WUi+mYXkm1kIexcwsqxiFE8tLc5NTy02zkst1ytOzC0uzUvXS87P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cz8ROFX82SyFhb0ryMvXPrv4Takwfh0klegutX/XN76PDx64jx3+uWJgcJey9vOO5 hUBkbPfyjvvF8dMDdj5uZhBymuT/74P/3QQGKW7bYz2KYVOcI6/6lbdt1YtiUWIpzkg01GIu Kk4EAKeo1UTJAgAA X-CMS-MailID: 20190820113934eucas1p174389a9f248459b987f7ef08204a2944 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190820102425epcas2p219b7cac45290fbc87bb62bf446fec345 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190820102425epcas2p219b7cac45290fbc87bb62bf446fec345 References: <20190819142226.1703-1-ard.biesheuvel@linaro.org> <20190819142226.1703-3-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 20.08.2019 12: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. As I remember this case there are allocated buffers with len aligned up AES_BLOCK_SIZE, source data copy to one buf, hw encrypts full block, then nbytes are copy back. -- Best regards, Kamil Konieczny Samsung R&D Institute Poland