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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E407C4332F for ; Wed, 12 Jan 2022 18:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356546AbiALSvb (ORCPT ); Wed, 12 Jan 2022 13:51:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356574AbiALSvX (ORCPT ); Wed, 12 Jan 2022 13:51:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9122EC061751; Wed, 12 Jan 2022 10:51:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0CB54B8203C; Wed, 12 Jan 2022 18:51:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3423BC36AEC; Wed, 12 Jan 2022 18:51:13 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="SVlUKGNc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1642013471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xreHySqXLyhKUk0VW0GwsU6XUHgnG+4/Jk0kao9Oifc=; b=SVlUKGNcrSDoPZWC+klO14Zqk7l7Uf8MtIAFKt+cC6HwyJsLy+SLzVJX2qkW5yifFG74U1 jkNoAR9iWafix2H1JjlgdtWawKfLApWQRctYnBS5dtnsQG3gAwp6/5nfj5vg0rGFBqRHvP Qe+YhFBRbUX0+Y9zskJZr0tLh1hhtZk= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id f42311d7 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Wed, 12 Jan 2022 18:51:11 +0000 (UTC) Received: by mail-yb1-f173.google.com with SMTP id v186so8318237ybg.1; Wed, 12 Jan 2022 10:51:09 -0800 (PST) X-Gm-Message-State: AOAM53047xidX8tulzJ90ryBsqKoJ+CfaIZY8T7ByCp0MK/55c6dtvyc RcSYh/gspnMn6X7NUUWUGqYn3iVNsvcYaxsJ4Xo= X-Google-Smtp-Source: ABdhPJyNAIEcTXisld7XC7bhz4PalaSX6tHDm9+bpvRZLfdVf/6oPJbATFqmhRaXycqh4DhrWUXcosqQSbDYw9Ipoz0= X-Received: by 2002:a25:854f:: with SMTP id f15mr1311046ybn.121.1642013469238; Wed, 12 Jan 2022 10:51:09 -0800 (PST) MIME-Version: 1.0 References: <20220111134934.324663-1-Jason@zx2c4.com> <20220111134934.324663-2-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Wed, 12 Jan 2022 19:50:58 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH crypto 1/2] lib/crypto: blake2s-generic: reduce code size on small systems To: Eric Biggers Cc: Linux Crypto Mailing List , Netdev , WireGuard mailing list , LKML , bpf , Geert Uytterhoeven , "Theodore Ts'o" , Greg Kroah-Hartman , Jean-Philippe Aumasson , Ard Biesheuvel , Herbert Xu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 12, 2022 at 7:32 PM Eric Biggers wrote: > How about unrolling the inner loop but not the outer one? Wouldn't that give > most of the benefit, without hurting performance as much? > > If you stay with this approach and don't unroll either loop, can you use 'r' and > 'i' instead of 'i' and 'j', to match the naming in G()? All this might work, sure. But as mentioned earlier, I've abandoned this entirely, as I don't think this patch is necessary. See the v3 patchset instead: https://lore.kernel.org/linux-crypto/20220111220506.742067-1-Jason@zx2c4.com/