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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D700FC433DB for ; Tue, 22 Dec 2020 08:56:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 959DA2076B for ; Tue, 22 Dec 2020 08:56:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 959DA2076B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OfSA2ICLq144OWac4ksWly7uyCstHe/zZkPq3XjUcK8=; b=m4pp2R/UTZ2pRH5hlHql8RFLW lG0wQLTqp7xDF7bQL+n1Ml+OQbF9rnAP3yOrniwrYeqGcYwpLgS4vMR1K6q7TR+YI0JOCTSvDI0Tv s5p1tIjz22l6UDV4jbLfer9fVG6nyLJe6ezNwuvQZala1a4P7pw9UIwWeEfuZhuvz1igxun58doUu qp/D1UCdGZelWg/nGpIrfTQICMZcEVKexB87SeqIWXjqbsIcIwRNoiF8cGdrc3kNPIxuaMUlKpdB+ o+rkabkTKh+K+s3LFLZbDpOu8DFIo856BMit9IIW0e0lpwzefjciO3TLWqpT1asKJFINRMUil0YWD RW09lwHIA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krdSK-0005HG-Aa; Tue, 22 Dec 2020 08:55:44 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krdSH-0005Gk-Sl for linux-arm-kernel@lists.infradead.org; Tue, 22 Dec 2020 08:55:42 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id E46B72076B; Tue, 22 Dec 2020 08:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608627341; bh=6+Q/aDQwfEeRbIfrJ72Rui8B2j9KbWtqX+1S2Ruz6eY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DPyem3X7Zyksrg4ItyQ4SoSrhselzzPihS/MRL6bjClLOhNUpCQI1T/Eds5JddM63 OWH0qyF5BxZzL9z2ZyJJGyP5emUQjWyxa7KP9wA5e+DGMsR5Wf734pqzZr+PxGBjTQ N4CXX0Iine//+kO1JI92UFMW8QQIqMEPhvr5SjuMvdBl6nBb+kmyCtzizB3jnm+jnn Lxw6O5S2ZIE7ELe+o3L0Z6Bok/BGTLonEgNSUlURauhPJsZEh6GaTCd7V0C+WighMG OnoK5EqLwwDEdVseIwrnE9Ua/E79GM5Rb7SMlYaUWNTSbEmfkeawYva0PR4uHQ2wxv bJ+ffnNyULZ2Q== Date: Tue, 22 Dec 2020 00:55:39 -0800 From: Eric Biggers To: "Jason A. Donenfeld" Subject: Re: [PATCH v2 09/11] crypto: blake2s - share the "shash" API boilerplate code Message-ID: References: <20201217222138.170526-1-ebiggers@kernel.org> <20201217222138.170526-10-ebiggers@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201222_035542_029161_05C4D835 X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Herbert Xu , Linux Crypto Mailing List , David Sterba , Ard Biesheuvel , linux-arm-kernel , Paul Crowley Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Dec 19, 2020 at 01:01:53AM +0100, Jason A. Donenfeld wrote: > Hey Eric, > > The solution you've proposed at the end of your email is actually kind > of similar to what we do with curve25519. Check out > include/crypto/curve25519.h. The critical difference between that and > the blake proposal is that it's in the header for curve25519, so the > indirection disappears. > > Could we do that with headers for blake? > That doesn't look too similar, since most of include/crypto/curve25519.h is just for the library API. curve25519_generate_secret() is shared, but it's only a few lines of code and there's no function pointer argument. Either way, it would be possible to add __blake2s_update() and __blake2s_final() (taking a blake2s_compress_t argument) to include/crypto/internal/blake2s.h, and make these used by (and inlined into) both the library and shash functions. Note, that's mostly separate from the question of whether blake2s_helpers.ko should exist, since that depends on whether we want the functions in it to get inlined into every shash implementation or not. I don't really have a strong preference. They did seem long enough to make them out-of-line; however, indirect calls are bad too. If we go with inlining, then the shash helper functions (crypto_blake2s_{setkey,init,update,final}()) would just be inline functions in include/crypto/internal/blake2s.h too, similar to sha256_base.h, and they would get compiled into both blake2s_generic.ko and blake2s-${arch}.ko. - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel