Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp965594ybl; Thu, 12 Dec 2019 07:39:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwel92cNycDvXLQmGQrlCga2sg7q5digBgUF6A/rL8btuF3hcjPTZJ7I+aEnDKNnR7Z0sHY X-Received: by 2002:a05:6808:30d:: with SMTP id i13mr5108204oie.144.1576165197192; Thu, 12 Dec 2019 07:39:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576165197; cv=none; d=google.com; s=arc-20160816; b=Oqi/Xc4pJG8nM3MwU/IEy1vgU85FLzM21P0M6OvLRwvNYqMZ7KKJs8PKxGR+njsqSW SiybCuccNUeF4QE6WoRy09ftqL3ZHXxjxfDg3zn9101RvC8z908oVIth2gdyvOm+s5Qi pSCHAcd/vSoxMiY4MltxL1FfBP5tUiT9NG68ycMh+aPsXleu8QpOBigwWU90fBkaUm9M UCk110r9L4WutGivsqZJrC9UPA+sH74a/+JtG3VETdnbdpIhMQAk41LwkuAejm9wfAOX b5xFithHo+QCO7KIyIHlB7U+bUxyb+k1Yb0JpL8vNkCNPEvHpCzMoqSnGW7w9IEwS/QX KX6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=K4XC0xBFvGDnZK3ZAodRXQZqNLqdi7Vd+wpl4CYiaIY=; b=NOouxAxSrOJDsFyYX3wEYNRD/cBuis4ithPSt5IwS9wh6uR2Jn8tS/Ui6Atp1d6ylU 32YQij+GX/AkjjOqyQdHAVpMYX9aKE0xBzjT8W+4UrVa+j7HWzFUrxpep4g4PLnVkV5/ n2H0Mes8sSXMOqlmSIP0yq2hTlDGglEIN3ZW97/tyIL6BDGXCd7SPS/NwoeICwlnSas6 ym4XgsMY+SMx4EMPQQs/Wn/Hb5iRnLYzzZK1XXH8muFsh37vzNPgQc6cLm7VH93OB6t2 mSCAsgvnlwdnevnv4EZSvTeHSpQ/CTUrY3BUqakfhftMr4gt1zyKGHLU2y0PU4QmYXD1 /q3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=ypcPLXip; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z203si3156628oia.124.2019.12.12.07.39.42; Thu, 12 Dec 2019 07:39:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=ypcPLXip; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729247AbfLLPjl (ORCPT + 99 others); Thu, 12 Dec 2019 10:39:41 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:46893 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729097AbfLLPjl (ORCPT ); Thu, 12 Dec 2019 10:39:41 -0500 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 83fadd44 for ; Thu, 12 Dec 2019 14:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=mail; bh=ECa0uhCehXyjyzPZCUPxPZw+zZo=; b=ypcPLX ipHBsjcKjqTNHBnw3JXmvx9FqhnkMkdJPor23oDgHvbXiv+j9xF4mW4DM/Y+5wHS Hpws7RIU839RAPktWcF6D9UbInqQ5MBaOlbcQxlpIk8VBKPyfi9EALLdF/8QrGKE V8bNfFcKpo4X9H4fzw/L4snZIK6UnyHAR1DGbHQlO520FRjMkECSY+RblJb7g165 W7GvGhYNL+EZd8RFZWJ3iC9aSFTgOVtZZz2KIPqe0Y3AI49GtswgUdDktW6aIQVL qZ35v1yF8EtE1P9DUP1e1an8kpV0AgPOtvTcxTQ7M5wQ3GYDofzpL7eWTpekwUgQ ZlEhIuSUBXwTMJcg== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 0a5c969a (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Thu, 12 Dec 2019 14:43:51 +0000 (UTC) Received: by mail-ot1-f45.google.com with SMTP id i4so2419507otr.3 for ; Thu, 12 Dec 2019 07:39:39 -0800 (PST) X-Gm-Message-State: APjAAAV9eWSnEKiug04Mxs1bbTGOnWSMmntIJowEISxlhn6clet/VK1i 3e0585fCKWpEE8wvNwOZy96g4G9UkzKJXC3JlD0= X-Received: by 2002:a9d:4f0f:: with SMTP id d15mr8984016otl.179.1576165179198; Thu, 12 Dec 2019 07:39:39 -0800 (PST) MIME-Version: 1.0 References: <20191211170936.385572-1-Jason@zx2c4.com> <20191212093008.217086-1-Jason@zx2c4.com> <20191212093008.217086-2-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Thu, 12 Dec 2019 16:39:27 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH crypto-next v2 2/3] crypto: x86_64/poly1305 - add faster implementations To: Martin Willi Cc: Linux Crypto Mailing List , Eric Biggers , Samuel Neves , Andy Polyakov Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Martin, On Thu, Dec 12, 2019 at 4:34 PM Martin Willi wrote: > As the author of the removed code, I'm certainly biased, so I won't > hinder the adaption of the new code. Thanks. > * It removes the existing SSE2 code path. Most likely not that much of > an issue due to the new AVX variant. It's not clear that that sse2 code is even faster than the x86_64 scalar code in the new implementation, actually. Either way, regardless of that, in spite of the previous sentence, I don't think it really matters, based on the chips we care about targeting. > * I certainly would favor gradual improvement, and I think the code > would allow it. But as said, not my pick. You saw this code well over a year ago and seemed okay with it at the time. Meanwhile you were inspired to fix your ChaCha implementation to narrow the gap, but no progress with your Poly1305 one. And I'd like to avoid adding a NEW implementation to audit for bugs and vulnerabilities and stuff. On the contrary, this code here is in widespread use and has been highly scrutinized. So please, don't waste time doing such a thing. I'd nack it on the grounds of it being an unnecessary risk. > * Those 4000+ lines perl/asm are a lot Ard just added the same for the new Poly1305 implementations on ARM, ARM64, MIPS, and MIPS64. This is code that's seen the most possible eyeballs of code in this category. And now we're finally converging on a complete set for that, with x86_64 being the last holdout. Please don't hinder its adoption. Your old code is slow and hasn't received much scrutiny. This new code is fast and has received a lot of scrutiny. Jason