Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7476537rwp; Tue, 18 Jul 2023 16:23:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlEmRJofo3JBsfRn4UzEQKF9Tczrnx6FWtIGCQ1ppp0K/2PC7rlbknFs1fseE4qRg29dqDbb X-Received: by 2002:a17:903:1cf:b0:1b8:ae11:bf5b with SMTP id e15-20020a17090301cf00b001b8ae11bf5bmr20293027plh.62.1689722595236; Tue, 18 Jul 2023 16:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689722595; cv=none; d=google.com; s=arc-20160816; b=nyb6IH/kUiBQ6AORX+o/cL8zTPCMWkU0FRc8F5DzyCFG/XL33UfnExYad+g5bZ4MxV XIluof8S5xIj+4oL0lvlFHIyo6XJfEYO9NDsu//6MkrCSbhGSEiNAbiO+oq+ZjaeNfMr Q2w+vntSJmuL7/7vhyKh9cEGf23hfLECjtHv/jpLd0pvQe3U+6+m1kqA/vxB/aJqZlQK Exi+FY5khZxBL+FUR08DJ924Bwj5RWwK3E6MEdhzB6ZCngP60M8stgGuC0ryK4QRS3az qV61EV3B/Y9WzLK+kOOWiDfwn+Zz0kP/q3VWBPp3Gv3AjQs3AI+ORnsTfOjywd8Q7cea 44EA== 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=eTL/TCTWAlbYr0Elj5mhsej8bo/B/cWKjNRqDEv/FGA=; fh=1bpFwyOsB1q8L2F+8oE0TCo5PaYZR3xAGKO0+SCqPdo=; b=R8tDervs3AqS89jeFouBFruCwLEoZRcB53CR4SfbHV5bCaz20+V0cJR3vHZvSWldNg URMRCdGcgU3djuexiUyyhAvUbYmJpALFPDtdi/5J/1taaklKrewHm3ig7Id/V5O14kvC FyoLjcjWJzNHdrHczHtbgVnx2/48Ixns1fcP5MmCh5UVnGMqKmmBz/7Das/Rjtozxwb1 9+DmMOVYoH0egg4r7gQGaWXRrLi7OQJ7sLRZIs+UPwE9lEmgTqEq3LgUBliV+7998mB4 E49EYaI/spX9DrNn8eQau5g/X9jvu8INF1tFfXL5WypPLQfCPaUoqHHcNSJqpJLVJ0EE d7OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rbODd0eC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a170902e84200b001bb324569efsi2496173plg.364.2023.07.18.16.22.59; Tue, 18 Jul 2023 16:23:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rbODd0eC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231222AbjGRXHM (ORCPT + 99 others); Tue, 18 Jul 2023 19:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231208AbjGRXHJ (ORCPT ); Tue, 18 Jul 2023 19:07:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C633A1; Tue, 18 Jul 2023 16:07:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B53E661372; Tue, 18 Jul 2023 23:07:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22736C433AB; Tue, 18 Jul 2023 23:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689721627; bh=+Pd8n6b3Bgde2sfLuTMJEdG3inSaboDgyN2R66pO+Cc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rbODd0eCkMojMdEsT2JG+DPQ5FfVcqjO+7TpaLSAITlHBKbP8U5e58LV5FWFBRUVd WfqtFLFPPQLBI+WPyuMGATfmm8+J0uFQJTLKlLbH9TiCN9639o12nq+YJVNSQMYjF3 FGmaUehU1XG17oDii9iC9SAEy4rTkasUr+Y04Pcv/VZ+0YArgAhZB99N8buGKADRBJ LYRHsl2hQRSIsn8KC+LLc8NDcS7nrGUW9UGRFo1Q8ScX1Afl7wGan1l3BVCFlU6WkM vGsLFim7pfqlnxvDigXrfzxNxmdbDg2Bt/X2KpPLyeaCtSy8DvI3aGq9xkLL6VVsa3 nN1xZb5T64iiQ== Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2b70bfc8db5so96446021fa.2; Tue, 18 Jul 2023 16:07:07 -0700 (PDT) X-Gm-Message-State: ABy/qLYTqMOKKDuXbXPae+TkVvIBHii04NLL6oWZ3NaBL/5Qi+7Br2Fg c5nvwOCmp+hymOSvFXr6KDal+Fhmc/vR2DtYc2E= X-Received: by 2002:a2e:968c:0:b0:2b5:8f85:bf67 with SMTP id q12-20020a2e968c000000b002b58f85bf67mr476772lji.53.1689721624966; Tue, 18 Jul 2023 16:07:04 -0700 (PDT) MIME-Version: 1.0 References: <20230718125847.3869700-1-ardb@kernel.org> <20230718125847.3869700-2-ardb@kernel.org> <20230718223239.GB1005@sol.localdomain> <20230718225450.GD1005@sol.localdomain> In-Reply-To: <20230718225450.GD1005@sol.localdomain> From: Ard Biesheuvel Date: Wed, 19 Jul 2023 01:06:53 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 01/21] crypto: scomp - Revert "add support for deflate rfc1950 (zlib)" To: Eric Biggers Cc: linux-crypto@vger.kernel.org, Herbert Xu , Kees Cook , Haren Myneni , Nick Terrell , Minchan Kim , Sergey Senozhatsky , Jens Axboe , Giovanni Cabiddu , Richard Weinberger , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, qat-linux@intel.com, linuxppc-dev@lists.ozlabs.org, linux-mtd@lists.infradead.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, 19 Jul 2023 at 00:54, Eric Biggers wrote: > > On Tue, Jul 18, 2023 at 03:32:39PM -0700, Eric Biggers wrote: > > On Tue, Jul 18, 2023 at 02:58:27PM +0200, Ard Biesheuvel wrote: > > > This reverts commit a368f43d6e3a001e684e9191a27df384fbff12f5. > > > > > > "zlib-deflate" was introduced 6 years ago, but it does not have any > > > users. So let's remove the generic implementation and the test vectors, > > > but retain the "zlib-deflate" entry in the testmgr code to avoid > > > introducing warning messages on systems that implement zlib-deflate in > > > hardware. > > > > > > Note that RFC 1950 which forms the basis of this algorithm dates back to > > > 1996, and predates RFC 1951, on which the existing IPcomp is based and > > > which we have supported in the kernel since 2003. So it seems rather > > > unlikely that we will ever grow the need to support zlib-deflate. > > > > > > Signed-off-by: Ard Biesheuvel > > > --- > > > crypto/deflate.c | 61 +++++----------- > > > crypto/testmgr.c | 8 +-- > > > crypto/testmgr.h | 75 -------------------- > > > 3 files changed, 18 insertions(+), 126 deletions(-) > > > > So if this is really unused, it's probably fair to remove it on that basis. > > However, it's not correct to claim that DEFLATE is obsoleted by zlib (the data > > format). zlib is just DEFLATE plus a checksum, as is gzip. > > > > Many users of zlib or gzip use an external checksum and therefore would be > > better served by DEFLATE, avoiding a redundant builtin checksum. Typically, > > people have chosen zlib or gzip simply because their compression library > > defaulted to it, they didn't understand the difference, and they overlooked that > > they're paying the price for a redundant builtin checksum. > > > > An example of someone doing it right is EROFS, which is working on adding > > DEFLATE support (not zlib or gzip!): > > https://lore.kernel.org/r/20230713001441.30462-1-hsiangkao@linux.alibaba.com > > > > Of course, they are using the library API instead of the clumsy crypto API. > > > > Ah, I misread this patch, sorry. It's actually removing support for zlib (the > data format) from the scomp API, leaving just DEFLATE. That's fine too; again, > it ultimately just depends on what is actually being used via the scomp API. > But similarly you can't really claim that zlib is obsoleted by DEFLATE just > because of the RFC dates. As I mentioned, many people do use zlib (the data > format), often just because it's the default of zlib (the library) and they > didn't know any better. For example, btrfs compression supports zlib. > I am not suggesting either is obsolete. I am merely pointing out that zlib-deflate is as old as plain deflate, and so we could have implemented both at the same time when IPcomp support was added, but we never bothered.