Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp834978lqh; Thu, 28 Mar 2024 19:46:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULTmMWT4Gk/iOQHNo67FRFow6F/DQrXFxttcwR3/8ziqzZJVE0M2bpeb98Pj4CaPa0bzAqkvxp6EoIrazt7xsjSyEhDqwJ1Rg5ucPegA== X-Google-Smtp-Source: AGHT+IEotrFxmjh/Mazc5xQWqNqMFdaH8VFqPppWV8/DV0YfipAIIL+TCZG7CNDRvY5Dh+1h4VNO X-Received: by 2002:ad4:4e2b:0:b0:696:b009:a9cc with SMTP id dm11-20020ad44e2b000000b00696b009a9ccmr892437qvb.6.1711680415509; Thu, 28 Mar 2024 19:46:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711680415; cv=pass; d=google.com; s=arc-20160816; b=UxsNqjHiAy18/xravSD+EWLobJfSg9Nbr0inwzdlLD6Ty9bcte3nZYP3lHpPPUu32q acFQe4cC/GR2zcMjgN7Y4d9hSQ6ZBQPWwoMQlfBGuHjq4awhutdwuy6r2QhICSVYJbjH wU+ZWnDATMvcrei6KG2HHswdI/QfwMTICPYOPGC9Bu+Ud4MWQDOGqorJ71SnqXUts4yp ADoOelAVgZSXM+oNPSC4Kse7XXlAjsz8DOGJfWbnXgyRAxOzYie1t3bFHSztuOiBDc8g u6Jj54Qa+Oo9Tbif4WrbXHy+djTZFKk5kLEZqD2Wv+R3hzsgyZ9QveyOaCf+XS4bjBxS QYdg== 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=h4lwZLanJufD7i86juldVvYZP25N+SkrSIdD+pi9KGc=; fh=OP3FBvGVAfZqXAAn6B+uGPYPZLtpHbSr707rvKyPmVs=; b=ePBjXYyae5ocsUe6KKoHjYs/s1SzT93LKnBu+Ebs2M1A8RB/wT3TjW4p6QIpZ0wjv+ 8paTF4tGzuGqs8euEZ8OI8IHT3Bo+rq/3D40rA51OxDPTy7Xxj0m23G52VQwPUjblcVT iW3qNw0x4JHZYZu7c8rkSubzwrUc8ViYxtH5xIX7DM6C4hPzyyp1KylvY0jyUM1bqjN8 GpAGi8rTpgPH7ZYZtdNJlXhJMc+2USObWSIDLDHZvwbPEDEXqX2Mh7KKJSfBcuOpIHD6 FqBx7GSuuc5YxDITgpP3ex3GYgDAjtlATHHAbiMCfgWnscMJZ5QqEuJyL1pnLAJvaqsR GPXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vu08IIB1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3053-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3053-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. [147.75.199.223]) by mx.google.com with ESMTPS id d5-20020a0cea85000000b00696711dfdaesi2805611qvp.579.2024.03.28.19.46.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 19:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3053-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vu08IIB1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3053-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3053-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 F0A9D1C22960 for ; Fri, 29 Mar 2024 02:46:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A817133CCD; Fri, 29 Mar 2024 02:46:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Vu08IIB1" 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 65A911946F; Fri, 29 Mar 2024 02:46:50 +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=1711680410; cv=none; b=YJQzL2Pp63LNFxqd2F62h/sMakzJIej2NeNrsCF6LwSrp99wiHFRIg0Jaj+8YS3iaXcI9tAeA9RcCWG36Efug+bQozjH/3M0NCKAgNb5XHDoywhTODMFgoBmvg0n3UfjLngNnapSiW8Xhz1vfXYEeIMnNIvNUsjdBLrnnnj5J0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711680410; c=relaxed/simple; bh=VYWzIkb5ccN/HVEU/KawfKWrlsv1UWoHi5Ddv2Y4THw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ka+9SUKEUkdSevSNTZ1+bEE06oHIKOXMTXCbKUJZC/tvvKMXbmltUklTtACE/8yvBpU81bNtWa3VCPC/a7Bma1BB6p+/bGy1v7e2P0QckL9pRM3J1hibsLWKDqjeqUa9C/1Q1mhnacacu7slM2si733GPtXhe2zWZvBiTs6cBGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Vu08IIB1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9364AC433C7; Fri, 29 Mar 2024 02:46:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711680409; bh=VYWzIkb5ccN/HVEU/KawfKWrlsv1UWoHi5Ddv2Y4THw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Vu08IIB1appIVitbAvoiBg68A5hWj4QkyNdnTv5j4qGdzFr/I1/r5F8zt6pzVSkkL lHBNKyjKY1xMRpSZxOVJ6T8JBF3Z8YXiQwqJHYFtlRfT4xBOHY2MlElkZtW3fGll6m Nf5mygZz1LwVQN6z1693gOnLz9wQUXtEYWJtxjkZTr15R0x+aBZafhbgltNjXjJ1Oc kW9NbrVbhrwXYJjQPnDVE7SkJgtfa03Xv7PAE+J5mhga3Pbf4mAkAgtebFyYgM33K2 zz9WzeiIlnO7ZNrQFN0hcJC5K6IgNlYBPa5s5XbD3+DPTBxmpcX21EumBd8+ieLlMz kpYV/XCVVPtYg== Date: Thu, 28 Mar 2024 19:46:47 -0700 From: Eric Biggers To: Andre Glover Cc: tom.zanussi@linux.intel.com, herbert@gondor.apana.org.au, davem@davemloft.net, dave.jiang@intel.com, fenghua.yu@intel.com, wajdi.k.feghali@intel.com, james.guilford@intel.com, vinodh.gopal@intel.com, tony.luck@intel.com, linux-crypto@vger.kernel.org, dmaengine@vger.kernel.org Subject: Re: [PATCH 0/4] crypto: Add new compression modes for zlib and IAA Message-ID: <20240329024647.GA20263@sol.localdomain> References: 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, Mar 28, 2024 at 10:44:41AM -0700, Andre Glover wrote: > The 'canned' compression mode implements a compression scheme that > uses a statically defined set of Huffman tables, but where the Deflate > Block Header is implied rather than stored with the compressed data. This already exists in standard DEFLATE; it's called fixed mode. See section 3.2.6 of RFC1951 (https://datatracker.ietf.org/doc/html/rfc1951#page-12). I think that what's going on is that you've implemented a custom variant of DEFLATE where you set the fixed Huffman codes to something different from the ones defined in the standard. Is that correct, or are there other differences? Actually, looking at your zlib_tr_flush_block(), it looks instead of using the reserved block type value (3) or redefining the meaning of the fixed block type value (1), you actually deleted the BTYPE and BFINAL fields from the data stream entirely. So the stream no longer stores the type of block or the flag that indicates whether the block is the final one or not. That has the property that there cannot be any standard blocks, even uncompressed blocks, included in the data stream anymore. Is that intentional? Maybe this is why you're using the name "canned", instead of going with something more consistent with the existing "fixed" name, like "custom-fixed"? I wonder what the plan is for when the next hardware vendor tries to do this and chooses their own Huffman codes, different from yours. Or what if Intel decides the Huffman codes they chose aren't the best ones anymore and releases new hardware that uses different codes. Will we perhaps be getting a tinned mode too? Is your customization described in any sort of publicly available document that could hint at some way to name it properly? - Eric