Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1469035pxu; Thu, 17 Dec 2020 10:37:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJygUfrE0aSqrzj4utqtHP7oRERRFYpkbXl8ckNOnPhoq4SGM6eE+kv1pILwKD7Mk9czDIdH X-Received: by 2002:a17:906:7a18:: with SMTP id d24mr360774ejo.324.1608230260760; Thu, 17 Dec 2020 10:37:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608230260; cv=none; d=google.com; s=arc-20160816; b=OZxZucJjOugG8ozqRyywRxC84LEtaq+wjyXAQysxQtZpYZ5vATTWT89zdRdlFU+dgE ZIs2vX0scWI5TTsPEE6UJFFkMdJkibbASpcwhpTIQgoAC9D+UUpQg9PiLUM7Ftm39CZ4 a9nO8lKz88sW3KLq7XN4GJMgLMI0Qhz7uctqL26SQ+nTqM7tAfPqHlI/2ItUsayTCbnr j1WsIbszY+dW7G2+eYAxkZ5uT9sP1fx9eq5Ywka0D/2Vr/0u4Z0ENKUdDvI357d2JoOt NawfC3lGCRHH2hJ0eettrTqSZuqHZOhwL7F3NXqt0pKXfDdTx9uZ0m4e8g/SRLqJPH84 OSjA== 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 :references:message-id:subject:to:from:dkim-signature:date; bh=UQAUT6pOi6QHUHFNRFmYoJSA07i2xSU0jy8QlkHOfvg=; b=1FANluZCOjI9fd/OjDrewbi2ulYTEN7+w/u64EFB7R1rcgTNNvUn7UnujRBX0yl2Zg TD2ZeiSU1jwsRDV/BoLRW2feEXPIZAiUS2FmKl/1We113DGMkLSz6tQjgUpM4guhnZYM 0T2N7L2XTOiJcL2z+tGSaJ+JwWYCYuyoQlJzVxOM4D7KKplbMzM0ZekkfA12jcwg3Y9P djwMzN3qzwT5KP+yOLOQz5WDyMnYBmli2d7OLqygMghk+6/T+OK27UWWOyse3usQLIDe z1JPltIjSpa8nnh0EvPntYQJNogc56n+Nh+HDLQPnzxQ5RBCOGxbE5ibad0TgDm+AkiX cERQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VeO38e7B; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dj28si4787384edb.352.2020.12.17.10.37.20; Thu, 17 Dec 2020 10:37:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VeO38e7B; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 S1730006AbgLQSgO (ORCPT + 99 others); Thu, 17 Dec 2020 13:36:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:39468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728704AbgLQSgO (ORCPT ); Thu, 17 Dec 2020 13:36:14 -0500 Date: Thu, 17 Dec 2020 10:35:32 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608230134; bh=bsgEVksB18d9gZCVq8tL2GRU8y8mcH/PO5uuLzrab3w=; h=From:To:Subject:References:In-Reply-To:From; b=VeO38e7BGfZhrMCm7wp1pPgiZh/eXur5evzt+1zMgD9+gcV0g+0RLmtH1v3JbhMcw DQHnAU6OErubQKTHeYhhyQ7F+/wizFaymnRy4y6lJo5c4FCKWDNzDS4iVnz7Ldqkvi GgRt/ZxgJaHkHC+EEnb4DaJMaMEuD8DdJoFL1VPyOUfV895+kOWaNWCOfFwOwc126v HozPi8anfaA2PiAxFYjP06t/w6/ug3ZKDgsL+bfx5voK12rBOfpnKYvgTeb46BR/gM eIvbMt7NofefKPltRxtV7CRzg0JQj5ABZldw84B8Ca4dgtgcbH6n4zc/rEtVx/X7yO xBi0I4M3lil2w== From: Eric Biggers To: dsterba@suse.cz, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Herbert Xu , David Sterba , "Jason A . Donenfeld" , Paul Crowley Subject: Re: [PATCH 2/5] crypto: blake2b - define shash_alg structs using macros Message-ID: References: <20201215234708.105527-1-ebiggers@kernel.org> <20201215234708.105527-3-ebiggers@kernel.org> <20201217171517.GT6430@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201217171517.GT6430@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Dec 17, 2020 at 06:15:17PM +0100, David Sterba wrote: > On Tue, Dec 15, 2020 at 03:47:05PM -0800, Eric Biggers wrote: > > From: Eric Biggers > > > > The shash_alg structs for the four variants of BLAKE2b are identical > > except for the algorithm name, driver name, and digest size. So, avoid > > code duplication by using a macro to define these structs. > > > > Signed-off-by: Eric Biggers > > Reviewed-by: David Sterba > > > +static struct shash_alg blake2b_algs[] = { > > + BLAKE2B_ALG("blake2b-160", "blake2b-160-generic", > > + BLAKE2B_160_HASH_SIZE), > > Spelling out the algo names as string is better as it is greppable and > matches the module name, compared to using the #stringify macro > operator. > Yes, I considered trying to make it so that BLAKE2B_ALG(n) would generate the names and constant for blake2b-$n, but it seemed better to keep it greppable. - Eric