Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3889060ybl; Tue, 20 Aug 2019 03:58:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzdD+i49AEoow8zhGGeh2HEFntNpSjVO9cXPW3WBU6yvrFNWTeg9d6C28bvSkrA40jECDW X-Received: by 2002:a17:90a:f0c6:: with SMTP id fa6mr25935819pjb.131.1566298699346; Tue, 20 Aug 2019 03:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566298699; cv=none; d=google.com; s=arc-20160816; b=sxVIwrhPOIQ7pDQxktup4A7uPhbg1UyUAqvjdhWcddSdJR/cU3rG86xQChuprxxUSM +w/w+ciAcgvl9MaBJlss5V6CWgN54yPhZ3KliiXI/PHmh6PCeTPAaw01FYnoLGhU0D9I H9tK0i8XzCJiuDF5FydTZuDeZ6pc4mNA5KEBOTY/oQJdrU7w8H45jhYFcOxehcuiAKT4 DJwQDND49W2OhnD6yc1dzkONoa7n3N1OeXXW+iJ8ksW1T7ZUFg1SAsTiu3/VOKHpqidb XW3RBp/HyutdeauBaOWWFRUGPATPJ/5jgDigvh7s/JoSfVzTOTvrfvgNMLN8WdIiearQ wFHA== 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=98qjiU0RLQfpP+E/K7E40DkhQrUVY99Cv4VbFwpXIdE=; b=CeHbwim0Ehfz18SUK7q53oTTUy0fYCSDWH29RAecY017QqjgEfqMQOldrfXDcF4wos w0Faju+58PdEjxdusae+EqXCVslIb95xNfIGCXVqGdoc6xYlhWP0ftG3QXpxlxLiSS39 D5/0OBsJehnYmrgLfxow6mNwE/ePUWJh105B69T8JWWqDiuMZOZBZg6uTRn+bqobvRBN bP738BAn+Z4A7NMAUMx8t69eI4YfVTMetiiHqOzoJtfk5ShRVHfUse5q/nY/cOBdT4FU ftxFvaY+z7gHsJi35IYcQKP7xormNI+Nka3XOj5ttEhuBaAtQjp04/a9v1PAlQUT2wTD gMFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NZhc5g6P; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f128si11829327pgc.55.2019.08.20.03.57.58; Tue, 20 Aug 2019 03:58:19 -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=@linaro.org header.s=google header.b=NZhc5g6P; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729409AbfHTK5O (ORCPT + 99 others); Tue, 20 Aug 2019 06:57:14 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40271 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728545AbfHTK5O (ORCPT ); Tue, 20 Aug 2019 06:57:14 -0400 Received: by mail-wr1-f68.google.com with SMTP id c3so11915581wrd.7 for ; Tue, 20 Aug 2019 03:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=98qjiU0RLQfpP+E/K7E40DkhQrUVY99Cv4VbFwpXIdE=; b=NZhc5g6Po0y7fipk5LSU9It+yU/8zmVLvWKenSr8A5F3380M4mvYyj7fAZsrQTxUbY MyLtrqnOvdOwpFZN0iQxUyVpMdJvqQOCiBNRVu+xrOUQCIFp/yfN/YQUZYiN8RmlFAvD d/QGouxgcqyNUxtNKwDnBcvm2SNoiNXukEXx6x6/rveKbOSvfBAOS/M3PYQojxg/lIMV nUxZ9Av6auRom3qUM1o5fRY3wdhp9GbPaZBB6KLnNNJQg2hBDUizjxNzBhUaozIeUxbB LZDgJD7Guo5b0M3P6j0k02pvGaH+UJptmi7cc0N/VLWTyF/OPb78dYwBv2IQnmfKVXM3 WWMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=98qjiU0RLQfpP+E/K7E40DkhQrUVY99Cv4VbFwpXIdE=; b=j4Gvtfq7BlOrgd5uuHZf/A1uPvT1MDY2lkxG9H87r09y1tSPQ6DGx/qU8tuaNI92Ur t1hysJZTnra7SIMcIdYi3cwfOZdOdfqi5tdnvLElJCO/K4TdDooOpAF7Lhb0FVC/74/2 OqvMOQLY2oUTGHRvsj3XwsUo9FAzqWd2tV+s/GTV+dK3D5PtkFD5UCWqqjo7MyPR8DdP GfWF003/ZacSWx4n5GW4QOxdwwtXluhdLoqlK3CoCj3WbaJ2piVyCBe2KFbp11TDow3P kqk1BE6YF2FOyG7B1nYIFmIdc/SO4+ikT55xiTB7UWW2/Zbe3dVAL+lyr5jUGjXwZvQE rbvg== X-Gm-Message-State: APjAAAU/LY2Niso0MyWKYUNEf4CzXe//pzOFK1MGiXxhB819Jtox/cRc swcq1zTJVQYSAm8jv5IWlHGGHepMQC9UimdCDCDoJHBAiIoO42bu X-Received: by 2002:adf:9222:: with SMTP id 31mr18050325wrj.93.1566298631670; Tue, 20 Aug 2019 03:57:11 -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: Ard Biesheuvel Date: Tue, 20 Aug 2019 13:57:00 +0300 Message-ID: Subject: Re: [PATCH 2/2] crypto: s5p - use correct block size of 1 for ctr(aes) To: Krzysztof Kozlowski 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 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/