Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3750345pxj; Tue, 11 May 2021 11:02:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxalJt6iHc1iIU4O9VdQofu+RYWHNx4DgSfpR28Bxx9RaVLepTg9EKnafFcBUxnJC+D4LXf X-Received: by 2002:a17:906:2e97:: with SMTP id o23mr32977358eji.315.1620756168556; Tue, 11 May 2021 11:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620756168; cv=none; d=google.com; s=arc-20160816; b=aYGk47MbEvCkNYGPngGj4hsIeJf6JGaDN/P4P6DKfyRjJaMZliUAlcPzwQfakqR3oH /3LjHhX/qkjetMmLiYMtChc2aWb19uKbe4KSzUIUE5HZ0CqrRfUCmgzR4YEV8Pnn0kdC 99LxeexvvuS8/zFNBuZN9uPb4ufOP8/rsymESR3GmR9FNBL27ANBavjCOQ4J3HgX/N0V FRSzNWpFSjR4exz715IJ7pH1aOMjkY3U2KmkkFErdSDqECaGbKY84RG+cPRtfHynqKCB NXWncC8iH310VJ5xSIUAIKlvC4WK7420bs/+nLcyiiX5tStnDnGWjjQCCWLM/8aK0j+r IYZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Z84ojFnO3I63AGsBdQQkFvZgYzhCDyhB8tix9vTvfK0=; b=vWy/Xq7J22N181lk4VJPMhL944d9WnW2xi1JqBupxIJelQoXI8BUy6DKpJiOuSC+x/ 9VNcYWbHHW5nD/Ld3iic3+CVCnBcUOZ5Qi6XwMmNwKtN1vt3P4skvORwlNG7TVbFxfVd McUxmXRbS7fPa9VejvFJJSGURIxLeywjfG1ixWfmRrTqtP+eNYEfeD4tuktbOAtOffj8 NjEdHgRmiTzKheP65qZxRIb5VU+aoRUo7+3rbq7pK4VUOX+xIgRMCagigQR/+Evula5Q MTk/gUXfY1RPVcU7rE6yNvkCqqemOjjqtZq3ddKml78sHR29Pyy0Lf2hYzWDREVFzc6v 57sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ib.tc header.s=google header.b=ccUzi5CH; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si17306634ejl.147.2021.05.11.11.02.14; Tue, 11 May 2021 11:02:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ib.tc header.s=google header.b=ccUzi5CH; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbhEKSCb (ORCPT + 99 others); Tue, 11 May 2021 14:02:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231459AbhEKSCb (ORCPT ); Tue, 11 May 2021 14:02:31 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 725E6C061574 for ; Tue, 11 May 2021 11:01:24 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id j3-20020a05600c4843b02901484662c4ebso1712584wmo.0 for ; Tue, 11 May 2021 11:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ib.tc; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z84ojFnO3I63AGsBdQQkFvZgYzhCDyhB8tix9vTvfK0=; b=ccUzi5CHn97bVf/XuZWiU0UtC1uFvLROzJ1gIjX9+ZvEWsBHB+C07HYNxo3rrAh3xI oHhUPAb099gY1DH5aXUhQZdm2+6IFqkmqpCf3G+XEeW684kazyPAyEz4+UK6FvLY6m4z pfkMUO+XztmLMJLSdZsTtq2pbzw6X1U0+YDIXjyGsLhVZOaidCmchGtSYmzikolaZUFP WLikfvj37FyGxw4q1FBhSpHwErCp10FvwVwQcdfXduOmYFH2GKGPmXNEQOCiNy/eDWvb YAaMHFaHexvhBe3u187kIGrNpXMuoNqAkY9Y4Qh/kOdb7KYdmuxbhrZzEIV0eG6b1o86 7t+Q== 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=Z84ojFnO3I63AGsBdQQkFvZgYzhCDyhB8tix9vTvfK0=; b=giT8sulce6EQmZlZj3V7+6S+NlGieNt5Iv3aAzk3Jw95mC8vmY4KCPAiHuY+LfjvNi GPs6RMyipnVMwKBC2l7Q2BDxqRlK8hSchNjkTWIeJTiG9RIoP37kKCkZQ2qQyGZLEimN Iv/vBJk0VNEr59PG1f2zdN5dBFSVVkyvMhlGff/GYAnSWet7zbx34taVWCXfA7DTppt8 eW3eyQvTLNZrTESoF/ItwN5VWEkr8/qGc7bJPXDNJU09uUG0F/OouULJtYsq0BvJHzSC VnETSbop1jI0o2nDzd5IH1Y5PJw+E1wa25TdVmD0Y0fPEy/akNF4iuMIybrIustlYgU+ t7gA== X-Gm-Message-State: AOAM530H4RxufzSWI0ejlJyrbT1i4t/tC12GFc8E1Z4ErLKLhSmUzAKr yVPnrCNqgzb3jklLXpP5qIbl/xaKzioaYXUMpveaqst+4+77dQ== X-Received: by 2002:a7b:c0c4:: with SMTP id s4mr6837739wmh.174.1620756083172; Tue, 11 May 2021 11:01:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mike Brooks Date: Tue, 11 May 2021 11:01:11 -0700 Message-ID: Subject: Re: or should block size for xts.c set to 1 instead of AES block size? To: Ard Biesheuvel Cc: Kestrel seventyfour , Herbert Xu , Eric Biggers , Linux Crypto Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org xst(ecb()) can only produce a minimum of AES_BLOCK_SIZE of data - sending in a smaller dataset will still return AES_BLOCK_SIZE of data. If you try and pass in lets say 4 bytes - and then you truncate the response to 4 bytes you'll lose data. Moving to a smaller size is asking for trouble. IMHO. -Michael Brooks On Tue, May 11, 2021 at 8:48 AM Ard Biesheuvel wrote: > > On Fri, 7 May 2021 at 08:12, Kestrel seventyfour > wrote: > > > > Hi, > > > > one more thought, shouldn't the block size for generic xts set to 1 in > > order to reflect that any input size length is allowed to the > > algorithm? > > > > I think this was discussed at some point on the list, and Herbert > seemed to suggest that 1 was a better choice than AES_BLOCK_SIZE. > You'd have to set the chunksize, though, to ensure that the input is > presented in the right granularity, i.e., to ensure that the skcipher > walk layer never presents less than chunksize bytes unless it is the > end of the input. > > However, this is a flag day change, so you'd need to update all > implementations at the same time. Otherwise, the extended tests (which > compare accelerated implementations with xts(ecb(aes-generic))) will > start failing on the cra_blocksize mismatch.