From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A20EDC369D1 for ; Sun, 27 Apr 2025 12:56:41 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Zlmmm0JcRz2yr4; Sun, 27 Apr 2025 22:56:40 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1745758599; cv=none; b=BmblUb1ffRcY9jVnhFSg5nVRSTjWLhukYWuvzboqKpyP+aDUYLSORU1BM9WteW/KUWY/4yTXVQn6oqoviuIPluss9xEPa+EV0kjKrfCw+njoNoAjE4csJEH4zM6TzoapkEzbNHS8GazcqjYKJLnlZiHyWSJdUJnz2I3PYYeNCqcTcuytPQ/2yQuAZVGXZSsXsBwuXBhsuVTgXBQdxDyPXf4x2hJjSVJoUl4w6wrmz1gfZAS8tg7J4kY5W61MnC+1hSj3VBlWYo78DhWnriNF8BERGnXsut/llweP+QYYm6X2B19yzA5RU5a0BPMx+LtyXe7G40fxRGEfrvWzcnRfow== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1745758599; c=relaxed/relaxed; bh=rHSpiOueUoNTIkl27VuQyXCY6OcM3JqCwXOu2CmkJ+I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QC7CyG6Xi3rBp2vGSLPvUDEC6Dsjt5sRRd/gCpdhbWLSje1y47A+oVed1mLGRxN2/Q9Z3oq38GtjYE55T0TT3vLXGi0SbRn/uB8kVlIcrGMcfCqGLdKXBPuNNZiUmzTgWZuyIcz+b0a/g4KVlyc4jIX4dDTwwEYzXQEm2ITGjzHmWtOfloguzJnDrlkvEc7pKmrv1bdaS3xUSZgeH+lk/oiqrkA9qgAKFCx/khN7CCXU9FeV8vi2GTlbD5kJAC39mPuZt4KZNkx19b0zhB0jajl6kNdnml0PAwjoT9fxhXB9QRw3Ki4jEHlSOlwbOxK2xMAxSsfjncl53P52fcQNyw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qV/qYJtt; dkim-atps=neutral; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=ebiggers@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qV/qYJtt; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=ebiggers@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Zlmml2Bdbz2yr0 for ; Sun, 27 Apr 2025 22:56:39 +1000 (AEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id CFCA544F7A; Sun, 27 Apr 2025 12:56:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BD42C4CEE3; Sun, 27 Apr 2025 12:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745758596; bh=AgqV1hMsSjVwY25pYZciWVxf7VAWpBvP9JfqHyR35EI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qV/qYJttnMqF/e8OqPLChbglT+OXe0BUI3C3XJkFZdTZhhNyHpOmlW5bb+1pxLyao gwGGLC+l03/YlzGd5+J56KHsYr0ohKSxDi747S0hGoCacZJ2qaaZmYUqJ2US3FnkyK Tu/o38Ex6SQrwWRr+GMMtqdU70l2SZNmFzlAG7PYaH28iELmPY1EI0osYVw1sYYhyG uGzqeuOneXyF0+JHSk9mnATjjGPRJIaqEHig6iKUkyyMDrwIc+ilmnaGMs99Mvxqgv 8h/Ac2RS79Wo+V7nYuNH9MBFb5lhQYMARyeMIsV0ibobHTJbQn5pg36EgAkKZDDFP6 PxMIuzZeFmMsQ== Date: Sun, 27 Apr 2025 05:56:41 -0700 From: Eric Biggers To: Herbert Xu Cc: Linux Crypto Mailing List , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, sparclinux@vger.kernel.org, linux-s390@vger.kernel.org, x86@kernel.org, Ard Biesheuvel , "Jason A . Donenfeld " , Linus Torvalds Subject: Re: [v2 PATCH 00/13] Architecture-optimized SHA-256 library API Message-ID: <20250427125641.GB1161@quark> References: <20250427123514.GA1161@quark> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Apr 27, 2025 at 08:41:38PM +0800, Herbert Xu wrote: > On Sun, Apr 27, 2025 at 05:35:14AM -0700, Eric Biggers wrote: > > > > Well, barely a day and you've already ruined my patch series. Now instead of a > > clean design where the crypto_shash API is built on top of the normal library > > API (sha256_update() etc.), there's now a special low-level API > > "sha256_choose_blocks()" just for shash that it's built on top of instead, for > > no good reason. You're also still pushing your broken BLOCK_HASH_UPDATE_BLOCKS > > macro that doesn't work with size_t, and putting my name on your broken code > > that uses it. > > Your design is unacceptable because you're forcing the partial block > handling on shash where it's not needed, Excuse me? It's the other way around. In my version the partial block handling is only in the library, not shash. In your version you've forced it into the shash layer, even though the library does it already. I understand that you've added support for partial block handling to crypto/shash.c and you want to feel like your work is useful, but in this case it's not, since the libray has to handle arbitrary-length inputs anyway. > just as you're forcing the hardirq support on everything. If you want crypto_shash to warn on hardirq usage you should just put a WARN_ON(in_hardirq()) in crypto_shash_*(), which will actually achieve that. Not add a shash-specific non-hardirq-safe low-level API to the library that can silently corrupt random tasks' SIMD registers on production systems. - Eric