Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp786335rdb; Thu, 22 Feb 2024 22:39:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV8Wy2XR0ie+O1A8qjR6ppSPeUfX9qu7lRcevfKdTO+kFXwshLlvE8UwUw8EYVMy3rPCFoMUiflSJqPuLdf5yUboIq7C00HsUNXkparwQ== X-Google-Smtp-Source: AGHT+IE0ITCupVOtQREcLtQUIxL8stw5xoMYWB9LF8VmgKKvLJG+YRFofjltodFyOm9ufrofJ18M X-Received: by 2002:a05:6808:23c2:b0:3c0:33b5:d1b0 with SMTP id bq2-20020a05680823c200b003c033b5d1b0mr1159478oib.10.1708670359188; Thu, 22 Feb 2024 22:39:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708670359; cv=pass; d=google.com; s=arc-20160816; b=v6agwE6ifVTVZRXVE6BS8doHCSzRYkna/Q42tAQMT58FlZkTaHJknRRO2pLuX+GkCl V0UOXO323F+MB6XQLvPDuoRqfLitc8IdBq5ZYvWp6XTUDx4u8wWpWLwZQA+X3IaRYqNf hHdIz1CdQaOobfF/RMBlKIR7MGjqkkMm52Gfg9EjlLQkFsKHEtc8YAfyj3w9glfeweKD BDm8wiAFzZOaV1h0PRnKLozbhtoW9yhZd40kkHPiLJSx6VsrbXLQ6PZUwy7TSA0VH/ii 2Ov0jRfNI1PUoJcGDGeUEJbMbTy157d4ekJekSsDFxBCY5rKsBUzi3qIbvse9k1LL0cm f5dw== 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=Rx0Gl1E6RZ5TkxFwgudDQRIhAKvlM5yUqBNFSVflhGQ=; fh=OUpgHz8gu+EFyREjScBnwgXxe9p5hHef04jJGlkpTWE=; b=GZKGD/4doA4T1niJaQ/EiC9codsJU6dwU4OAQXbH5n/XlZjTudj8Z+Tv699BgqgHJb /17DmyxdaBmpzm5UR/0Ox8uyd5D+Mbr2jWSmNQes7ThPxzactr9b7rtCXajbZhE2QHzx L8FcJtCUmi6AFBXqtIqExexTOMUUhmUmUjNDGPaAfvD5F8c5SOzC1G8xxHXnV4Mg+gKM XNe+ACAI7ZJvu99C/U128VBiKRpWD4KrhNl54A0ATAoI3Hg/gIwhCbP4TiVbFYTY8I0R 1hvgNl6xBDdei6o3BEsRc/+XlyVLx01G/e9VsZc4ttnHGtTRlDviW57jqy5qUyJ9oVnh 6Flw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rYl5lut8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-2267-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2267-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c124-20020a633582000000b005dc87163f09si11394519pga.392.2024.02.22.22.39.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 22:39:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2267-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rYl5lut8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-2267-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2267-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 60EAFB22511 for ; Fri, 23 Feb 2024 06:39:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BA7B12B6E; Fri, 23 Feb 2024 06:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rYl5lut8" 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 EF703125D9 for ; Fri, 23 Feb 2024 06:39:10 +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=1708670351; cv=none; b=BLasAhZT7omYxo1MZjO/ZVMnCPw7+lJZo3sIdHsEY+4UQRF31xBABQfdbvsMv4NTejlnAWGGzGfGb4cfY9zhfxIuusXl/7tdQ4UdLwuiH3JBw9QGJaeCoILfwIFtzqEL+MuDwWQvwqd3LGvtsNRQR5zpVFclWLJW4MUe4Ri+g4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708670351; c=relaxed/simple; bh=Ido/ALlExhvBWSYHLfwgDWpBxJbj/7ThOxFMW+Z0z7Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kKWoOQDirpkGLRbcGp1OR7JOVQYFii76dgUTjDMTe4FYoBHNfppK9mQprOwg6wQy/xpecyy6YjC9w7jC5C6ulIf3XNmmmnBU8PJ4GsFKEF56MUngBiM+gNFhp8cqBvtJh46oElWyqK+OT23KRFwrRhBiLi6eFFiD7sq0yM4m6cw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rYl5lut8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3426C43390; Fri, 23 Feb 2024 06:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708670350; bh=Ido/ALlExhvBWSYHLfwgDWpBxJbj/7ThOxFMW+Z0z7Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rYl5lut8AsgV4b2ITDnuecaqJ4KjWM4B2ZlLViMGFVt1IkigSa/YsOmHzhH4C5Pgx 6vnBtR83cpyIFYHLSpfYsmuiT7VDEY0Xm0CG356gXpzqovgxppUno9ypoN90PxgZPz YayV9jl7LRU2fXdtfEmgixJF60jAy40M+O8VS90+O0qc+tbFaKVeqxa9ZR52O8z1zw /gB690eFR2rIbC3GdL/QpvY9C9Fmfz3aSej87r+oQJvfmGAZDUeKPDv8vAbUyE9o6Q 0F3QA0kWtNsRPP247Je3mr29UmpDyLvaXRh3q+sHK5VFJbxfHghEQlWqnZlkHZmt62 4Zm1FZLGQgVHQ== Date: Thu, 22 Feb 2024 22:39:09 -0800 From: Eric Biggers To: Herbert Xu Cc: Linux Crypto Mailing List Subject: Re: [PATCH 00/15] crypto: Add twopass lskcipher for adiantum Message-ID: <20240223063909.GI25631@sol.localdomain> References: <20240214233517.GD1638@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 04:20:34PM +0800, Herbert Xu wrote: > On Wed, Feb 14, 2024 at 03:35:17PM -0800, Eric Biggers wrote: > > > > Thanks. Can you include an explanation of the high-level context and goals for > > this work? It's still not clear to me. I'm guessing that the main goal is to > > get rid of the vaddr => scatterlist => vaddr round trip for software > > encryption/decryption, which hopefully will improve performance and make the API > > easier to use? And to do that, all software algorithms need to be converted to > > The main goal is to remove the legacy cipher type, and replacing > it with lskcipher. What is the benefit of that change? This series also goes way beyond that, so it seems like there's more going on here. I do like the support for vaddr; the scatterlist-based APIs have always been one of the main pain points with the crypto API. But you're claiming that fixing that isn't actually the goal. So I'm confused. > > "lskcipher"? Will skcipher API users actually be able to convert to lskcipher, > > or will they be blocked by people expecting to be able to use hardware crypto > > accelerators? Would you accept lskcipher being used alongside skcipher? > > That's a question for each user to decide. > > > Previously you had said you don't want shash being used alongside ahash. > > In general, if the amount of data being processed is large, then > I would expect the use of hardware accelerators to be a possibility > and therefore choose the SG-based interface. > > I wouldn't consider 4K to be large though. So it's really when you > feed hundreds of kilobytes of data through the algorithm when I would > recommend against using shash. dm-verity usually hashes 4K at a time, but that was enough for people to want it to support hardware accelerators, so it had to be switched to ahash. But, you objected to my patch that added shash support to dm-verity alongside ahash (https://lore.kernel.org/dm-devel/20231030023351.6041-1-ebiggers@kernel.org). That suggests that adding lskcipher support to dm-crypt and fscrypt alongside skcipher would similarly not be "allowed". Most users don't use off-CPU hardware accelerators with those, but some do. I did get away with (so far) switching fs/verity/ to shash. I'm not sure I could similarly get away with switching fs/crypto/ to lskcipher. There are people using the CAAM AES-CBC hardware accelerator with fscrypt. Before we go through a big effort to convert all these algorithms to lskcipher, or (more likely based on history) leave everything in a half-finished state, I'd like to get a good sense that lskcipher will be useful. - Eric