Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp777440rdb; Thu, 22 Feb 2024 22:09:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUYrUzWiKyNHtrwLrQnvoXiY16wNIwacLSMSKfeeIFRHpqRe+VJ4JpJcTFCRE9t65VsQFE9uyVkh1G9lKhNYK+FrxgpcSmGfVB43gnkHA== X-Google-Smtp-Source: AGHT+IE5U3RZ3jUjlrzA0h61ObqvAVGBPu5JzNRpvWEY036zh8Artay585EXWaL58EKedY2k33kX X-Received: by 2002:a0c:e446:0:b0:68f:2e0d:8163 with SMTP id d6-20020a0ce446000000b0068f2e0d8163mr1089102qvm.15.1708668577585; Thu, 22 Feb 2024 22:09:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708668577; cv=pass; d=google.com; s=arc-20160816; b=KHko3BKJdKjWfe9qjgP95kwZlrqy+9udMv4AEHn3MvlLUuyWS6IqVBguwt/HwkhHD9 r+GK50L+ikXoC+xwo9oFfeEHmgGmwuZ5D+Gl4it9edPQIEoZnUCPWUWPCEBYfHzuYSdz GOS47Liy8G1JlL5GXFeQSiqG9X1NXHLIx/XECSDz2uwILRhYhKVdk6pNZsgOVgAK+0NC wvV9AUuT6L7lYbm8p1u2++GSswKOLeao2oOn8+kXM1DsdQIBcxZ4/lul2OJkrjk+9Y3h 1red02Y8Fkz/uMbA1hNLtsYhfSCr9ioaMsPTB8B7cl5n8TU4gp8YqVwrqo3qx5oiVsc+ Q0Tg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=p906wqjbw8SHRHmxaNEe1jLGbSc99uFOgK5tU3LuhgI=; fh=OUpgHz8gu+EFyREjScBnwgXxe9p5hHef04jJGlkpTWE=; b=aovwVOYhbtCFKOz5+vI3Xev3LDh/KRZv3HTy9vVJ2bkuAzC6pIBLNDhulv+bhGk/la apqnTr8ttgYwf8qmKfm/wkgiNPeBXxrWJdYpO9GJWo835IjV7zGHQ2U1dBDTPCCivSIM 64X6ABtSrO7BADJf/+MRHZ/Ct+uJH4XQultPXDh3ZfAp7gKU5I1HaIGXhyR4BLuf9LnK 48XmyJID6byX7TlXhblhvhQ8Iy+/mmM7z/9I7UNn89HHF7yWU6ClpDyN/iDJNBVMRZ8+ fyLNVkv10yLP16Qex4vSwF3FVgR/9oepZ5yNiW+wHpAgV9dcp/cAAl0ay1mejzKEIcR7 4new==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QdF2miBW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-2266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h15-20020a0562140daf00b0068f12128636si14753238qvh.21.2024.02.22.22.09.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 22:09:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QdF2miBW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-2266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 32A111C21674 for ; Fri, 23 Feb 2024 06:09:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45AD4125D9; Fri, 23 Feb 2024 06:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QdF2miBW" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 020D012B78 for ; Fri, 23 Feb 2024 06:09:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708668557; cv=none; b=DpSLudOFMgfBpQcajCH4IMfvRPEGuTB4/YTSkdSFg25ECpKx9y2GWhkaTzAtGWpz5g7qz/Qd3rgjEfqeqj/Y6u/pM6ki/BpYiJMw9ovV5748f9XysaHGmLujnSwG60T1J1dLGVxuGS2yJ9KFucm+QwftXERKu8/VKTQz6sNTbw8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708668557; c=relaxed/simple; bh=q2eyXMPh7Kjf6+KRRv1NhFS1KW07y22cJChsrDaetIE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VIz6O5ooNIqnBFWCkJYG0I7/lWBt8qp4dPrVxvZghFT267KlQnGSzHV9TzzptFNbtQTK23DkGZvmE+plOaaER8PZk61eucRjpCP5vHjS1i5F7kgw4LuTb0Cv8ZgXCgcRyIRwGxqt9vvxkk5mXT4yADgHRcv6vdAz10Bou56nC0c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QdF2miBW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BEEBC43394; Fri, 23 Feb 2024 06:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708668556; bh=q2eyXMPh7Kjf6+KRRv1NhFS1KW07y22cJChsrDaetIE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QdF2miBWkR2DfA76mt7rl8MuSIaUEaHbuFyNUmYRsrAOgOT1G1AjGnZvfpZcrOHTd /BWXWRDhxcZ3b6NyP0QokBGDc95Y02mcUyEW4CWlqEYJ4uGZ7Ldts4YjLvObfE1ZBB SBS6Am5fKLBzNNZ/YkBIzGY6HiUAa2OfJTiis7Tqe1TtBuxWXzWAApDuFPHQkr/bd8 kXuEg7tQKRI5U8fKeF6fOazrY0qTvtgxsG2McGMWxbRPZQ4RdaunUL3j9hoIm4kN9q spBfrLpxqaaS3oLhdzCcYLg8dXfivSC6elIxMaAcDBbnp0foiCpidtH0H783F4Lx7q lYIH6LxUOE49g== Date: Thu, 22 Feb 2024 22:09:14 -0800 From: Eric Biggers To: Herbert Xu Cc: Linux Crypto Mailing List Subject: Re: [PATCH 13/15] crypto: cts,xts - Update parameters blocksize/chunksize/tailsize Message-ID: <20240223060914.GH25631@sol.localdomain> References: <20240214230021.GC1638@sol.localdomain> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Feb 15, 2024 at 03:57:38PM +0800, Herbert Xu wrote: > On Wed, Feb 14, 2024 at 03:00:21PM -0800, Eric Biggers wrote: > > > > Before messing around with cra_blocksize, it needs to be decided what it > > actually means, and document it appropriately. According to the current > > specification, AES_BLOCK_SIZE is correct here, not 1: > > Block size should always be set to 1 unless the algorithm is only > capable of handling input data that is a multiple of block size. > > > * @cra_blocksize: Minimum block size of this transformation. The size in bytes > > * of the smallest possible unit which can be transformed with > > * this algorithm. The users must respect this value. > > * In case of HASH transformation, it is possible for a smaller > > * block than @cra_blocksize to be passed to the crypto API for > > * transformation, in case of any other transformation type, an > > * error will be returned upon any attempt to transform smaller > > * than @cra_blocksize chunks. > > OK this is wrong. We should fix it. For skciphers, the input > length must be a multiple of blocksize. That seems logical, but everything needs to be updated to be consistent. Note that adiantum and hctr2 also use the currently documented convention, i.e. they support byte-aligned messages but they set cra_blocksize to 16 because that's their minimum message size. Also, while the proposed definition seems logical, do you have any more specific rationale for wanting to make this change? - Eric