Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3440517rdh; Mon, 27 Nov 2023 14:35:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcg0b7Ewb/MeYzJU9IIvWGCHo/3fNAxGyCmO+WO5M1fhYLSiECIi/7taT10X7PI35vSk5D X-Received: by 2002:a17:90b:384c:b0:285:c0db:8024 with SMTP id nl12-20020a17090b384c00b00285c0db8024mr6031522pjb.16.1701124505746; Mon, 27 Nov 2023 14:35:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701124505; cv=none; d=google.com; s=arc-20160816; b=Y36WmI0QRDxcBFotRdlSNgzui8BUdegjw9duRxeMj2qitZlYEhGaf3N/+BovK2s0aU 1M4xCk3jKlFP5Gvn2G++n/y5PcfdUQmaToeQUs8CVTvtUZ89dj1XAGfWKEQx0tLDCsGk 4rzXRPrvNDQ3I92IUi4YwCy3oh8G+NaMhzB6Rpegeb+rIirlHqm4iZN0wEPR+d5lQgjf HvDNccb/xq+XG/cjmOcSIis7lk8DjDLWzOioPO3ZMRTcwhV/87e8zk1UkGIVN2kyPDNW bKWLM8KxCwdSgs7cAo+6Kluo27gNhjnM3U+mRkkJAihCJPeZlQ9Hz3mIR9vB3HWKi90K hn8Q== ARC-Message-Signature: i=1; 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=QA10VksLUgfU4WoABI24ao8YWW3WFzzCW1yuY1D2wn4=; fh=UDWDhAO7lJRReNZvubywdGsu9mvQhvlekph1HTPfwkE=; b=AT6N7XEFsmuRHupvD1f/vEPyew+9cIV+Km8oczIr6/uTeZ81eVZnJJiPPFItqCNY15 vOvbWf2U/eKw2V3Ow+r+imkLJSLfi8MCHTlWoySNUazMaGbdaPaFUERSpPSeYZl9yM0w EeV/nQJC07P1sjtupfnjxhU3xmC9XcBKt3W5TSrhl/pIg9Vhb4IkDyEfbJiHZa12XBcF 8n19nzwmsgAz5Q451OWXa0HiInioZl3JksIQAFN3KV1B1N24PeJJcxXJl9YC8Ka9wWfi ppFSYAfVkgq76waEV0/EXslee79fhi/qQRV9KHBKYUQEXDHyKnsBtjyP4y6btI9GKEnU f5Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pWl0OOlw; spf=pass (google.com: domain of linux-crypto+bounces-340-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-340-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 e13-20020a17090a9a8d00b00285aaf2d6aesi5630258pjp.116.2023.11.27.14.35.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 14:35:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-340-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=pWl0OOlw; spf=pass (google.com: domain of linux-crypto+bounces-340-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-340-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 A719EB20F69 for ; Mon, 27 Nov 2023 22:35:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DE7C495CB for ; Mon, 27 Nov 2023 22:35:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pWl0OOlw" 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 170FE4596F for ; Mon, 27 Nov 2023 22:28:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82473C433C8; Mon, 27 Nov 2023 22:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701124085; bh=u3wptG9C5pjDjwFDcqfsdteC2XdMmOmC1WMcl2WUcsA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pWl0OOlwLAv0La6VIjdwRkSm7X7r850jN4FzpjqO5M4ekv0ayEDW/pBAY9lygjGWm TrrqxX0+vqKAAIzGTAuNNdFNNNf81Fzm0UP/HftuJH2AJTK2bZ+TxEv535tptfZUgd N3C2gkqpjphjWBsSGiDGBafLEeHWzvVaz13/enJOIxyZk5HBL3nLpzZ1mdYXF8OR4l 5ZQ/RfT2++1siRkAnqFPqeHKCEuX0cKhvYzJHwFSzugqqqI6/WxaoDO3q/RlcOxwe+ I9kQI2MQqoChHc9STzi4CgwVCMy5flOKGZ+LR6RBcRGh+p10hPRD3Cwtk0G2zbfYvP +AkQ0hyOGKmwQ== Date: Mon, 27 Nov 2023 14:28:03 -0800 From: Eric Biggers To: Herbert Xu Cc: Linux Crypto Mailing List , Ard Biesheuvel Subject: Re: [PATCH 4/8] crypto: skcipher - Add lskcipher Message-ID: <20231127222803.GC1463@sol.localdomain> References: <20230914082828.895403-1-herbert@gondor.apana.org.au> <20230914082828.895403-5-herbert@gondor.apana.org.au> <20230920062551.GB2739@sol.localdomain> <20230922031030.GB935@sol.localdomain> <20231117054231.GC972@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 Fri, Nov 24, 2023 at 06:27:25PM +0800, Herbert Xu wrote: > On Fri, Nov 17, 2023 at 05:07:22PM +0800, Herbert Xu wrote: > > On Thu, Nov 16, 2023 at 09:42:31PM -0800, Eric Biggers wrote: > > . > > > crypto_lskcipher_crypt_sg() assumes that a single en/decryption operation can be > > > broken up into multiple ones. I think you're arguing that since there's no > > OK I see where some of the confusion is coming from. The current > skcipher interface assumes that the underlying algorithm can be > chained. > > So the implementation of chacha is actually wrong as it stands > and it will produce incorrect results when used through if_alg. > As far as I can tell, currently "chaining" is only implemented by CBC and CTR. So this really seems like an issue in AF_ALG, not the skcipher API per se. AF_ALG should not support splitting up encryption/decryption operations on algorithms that don't support it. - Eric