Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp684320rdb; Tue, 31 Oct 2023 21:53:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7pqOHNNGdNLmRyY0BHhOlk6KIKz6jQFmYr5He+RGoS9csK9wEU0vO+bGu0r+tCfnuOw/x X-Received: by 2002:a67:c00f:0:b0:452:bf74:bcec with SMTP id v15-20020a67c00f000000b00452bf74bcecmr13701815vsi.10.1698814408312; Tue, 31 Oct 2023 21:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698814408; cv=none; d=google.com; s=arc-20160816; b=mKcUGwVr6qrVCy77xTUya3vZI7S6sVrzwSRV4zRtMXSMi1yvae7cX+Ri/Y6ykBBZh5 VUkfeKsqJsGBtEq2mLMrzBiDa4lWKRddsCay/DiE7X7nVe4tMiP3Zo5Krn5du+LHMTIW g4P+4EXanSlPWzMrN3CIqP1y7DcSGQn1iIAFKqVoxFs8AdoKH5Nkf6FTQ/jkGC3SgW/p F5DLhVS9oRRwA/nMbVaFpnSMJzxY6PKCU10ICZkoZZ2HBZX4nViofhMHlaV7YXSGS+7K JMRv0XkcW//bjNwivccuhxdbRZo+OPJdx5ZEn4jkeJRt8rXjKbeuzhSdisJ5W3EQS+me 4Qkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=VLlvnkfr+COpfzcKOyX01t4Wu4UjZXdbjSm6dbvLeqo=; fh=ALAf64wWtr5chlw3NrvZyxqSFiqHZK9jJ3Ru4Mbb2I4=; b=ctYEqWyU44tHQm70WhWWv1eCDTiXx4z4luPqcNuYsuBIAMktOvf205qspI4a1hmYAV 8fdgo79GPdT7khZWMcxJ7aDFlCb3MlLg4ypoXWQ0RAfJykzP17xbRCjHMEuVdjCrecVc Judedi+s33P8DjqFmK9Xlxa5JoMlM11kHXcrk7FAlJFiUVziIm2nxCDXgazmTk7RL+LM U0j8rznpEYyu3R9rzpsemdhSscu51aJO9t9zzptqcyyPwS37pu12nzzEh2o9xHYYsFwb m3LR/D728PItkaG8noW2VJorznMQrj/gn6Q9FnZZSfhE6vAuLsSJWEiaKcMeEF3ooA/w pMNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 192-20020a6302c9000000b005b915369810si2183451pgc.590.2023.10.31.21.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 21:53:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 45FE280C2547; Tue, 31 Oct 2023 21:52:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346905AbjKAEvf (ORCPT + 99 others); Wed, 1 Nov 2023 00:51:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345092AbjKAEve (ORCPT ); Wed, 1 Nov 2023 00:51:34 -0400 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A59101 for ; Tue, 31 Oct 2023 21:51:27 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qy3C9-00D9Tv-4j; Wed, 01 Nov 2023 12:51:10 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Wed, 01 Nov 2023 12:51:15 +0800 Date: Wed, 1 Nov 2023 12:51:15 +0800 From: Herbert Xu To: Eric Biggers Cc: agk@redhat.com, snitzer@kernel.org, dm-devel@lists.linux.dev, linux-crypto@vger.kernel.org, gilad@benyossef.com, samitolvanen@google.com Subject: Re: [PATCH] dm-verity: hash blocks with shash import+finup when possible Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231030023351.6041-1-ebiggers@kernel.org> X-Newsgroups: apana.lists.os.linux.cryptoapi X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 31 Oct 2023 21:52:14 -0700 (PDT) Eric Biggers wrote: > > + driver_name = crypto_ahash_driver_name(ahash); > + if (v->version >= 1 /* salt prepended, not appended? */ && > + 1 << v->data_dev_block_bits <= PAGE_SIZE) { > + shash = crypto_alloc_shash(alg_name, 0, 0); I'm sorry but this is disgusting. Can't we do the same optimisation for the ahash import+finup path? On a side note, if we're going to use shash for bulk data then we should reintroduce the can/cannot sleep flag. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt