Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp344765ybl; Thu, 12 Dec 2019 19:41:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxApo3TgSsH9Ga/n4Z1V5BX7pS40EB3LhCSczOfIBx6X1Lj21Bh9px/PzkyNRkKuQX2Pmzu X-Received: by 2002:a9d:1b4e:: with SMTP id l72mr12488332otl.345.1576208478345; Thu, 12 Dec 2019 19:41:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576208478; cv=none; d=google.com; s=arc-20160816; b=MYsycvfVzMq35yzceJuWtZJSKbzVk8wYEmZ9ghgxzDYQYJno+xAYsT1AhXrch19EgP DlLXUPF1OH5lMeo/IOuObQRmRqWXNv+5dQJY9TB4GN5SM2TxDQV3xEhPxVhDctaZZBea lp7vlsjuDLLeAFR5TUIaXAg6c4Yx8k1THMblM2wy+S+MEWOzkaS6Jj1RBX+cWpCscp0s V6z0i0D8G4HsD64x8z4n6WpCCctJeKTT5gBqKIOs+XdRhuq1Cb+3xZp33X/x2FgoR5Bn hYTBQ36pCxnTJAdR+Xnzt4OqiF+TXuuX2uBs1aY0AW92semZ3xRtLc/NtJUF4nP569Xp qRhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=GGedxzLk7BfPKdo/eS7gjLlxItE2tW76pIuKX6oJpFY=; b=gXfjDsbCDDNWQwcGAxmJb7vc4/LLsV+gDNXV24KqpJrUKOwvYHJmyc0Cnu+apt7H6/ wkRJkZpt2hApSPu4bCSfyqj1mtBk7gtpsOrkEBRsNzsPVJe6V+KRcxG836WAhPPlOWq/ EjweRXlhbVh1Fmfq5Rx5ws6b2qfogJ1sy40iI6TGMQeu5BmKTzeQc3xDlmgaZqs+bKqt do9Ns1Fo/bzXzHnxMPvOWhH2c3jFRbHt9dM89ELrSJXZHkWa6UMrAVbw4DrGUAMoJ2AS Ly4/X7m4dEVWzxxfte5VhWSbewFUQrxl8uP7P8LpXCjEIwIdwYvpmGPZZoSeR6mTmLT5 fnHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D6yqxtKu; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q127si4538320oic.99.2019.12.12.19.40.52; Thu, 12 Dec 2019 19:41:18 -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=@kernel.org header.s=default header.b=D6yqxtKu; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731743AbfLMD2v (ORCPT + 99 others); Thu, 12 Dec 2019 22:28:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:58796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731631AbfLMD2v (ORCPT ); Thu, 12 Dec 2019 22:28:51 -0500 Received: from sol.localdomain (c-24-5-143-220.hsd1.ca.comcast.net [24.5.143.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B83E324656; Fri, 13 Dec 2019 03:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576207730; bh=/hDJVq7RsibwklbuOF/858jCKzciBNwHFxNj4hVkbmw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D6yqxtKuQRnEA/+hludQkuZ526lfGrCa5n6B9AyVmDKyMHNOOKZZa3TvpG2HzUYKI ojXcS4LssbOpIhI6WzT4lSskueSZ/944Cidm45l2v4FRAm9ZQEI0NDvwh5ea4WgQj3 0rKBTLtSHXRKvUXBS0uist1vKQ3zgjbWrrGRj1Ok= Date: Thu, 12 Dec 2019 19:28:49 -0800 From: Eric Biggers To: "Jason A. Donenfeld" Cc: Martin Willi , Ard Biesheuvel , Linux Crypto Mailing List Subject: Re: [PATCH crypto-next v2 1/3] crypto: poly1305 - add new 32 and 64-bit generic versions Message-ID: <20191213032849.GC1109@sol.localdomain> References: <20191211170936.385572-1-Jason@zx2c4.com> <20191212093008.217086-1-Jason@zx2c4.com> <7d30f7c912a5565b1c26729b438c1a95286fcf56.camel@strongswan.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Dec 12, 2019 at 04:35:04PM +0100, Jason A. Donenfeld wrote: > On Thu, Dec 12, 2019 at 4:30 PM Martin Willi wrote: > > > The principle advantage of this patchset is the 64x64 code > > > > If there are platforms / code paths where this code matters, all fine. > > It does matter. > > > > > But the 64-bit version adds a lot of complexity because of the > > different state representation and the conversion between these states. > > I just don't think the gain (?) justifies that added complexity. > > No, there's no conversion between the state representation, or any > complexity like that added. > > I think if anything, the way this patch works, we wind up with > something easier to audit and look at. You can examine > poly1305-donna32.c and poly1305-donna64.c side-by-side and compare > line-by-line, as clean and isolate implementations. And this is very > well-known code too. It's inherently more complex to have multiple alternate implementations, and it reduces testability because there's no obvious way to even test your 32-bit version on x86_64 (which most developers use), as it seems your 64-bit version always gets built instead. Now, it's possible that the performance gain outweighs this, and I too would like to have the C implementation of Poly1305 be faster. So if you'd like to argue for the performance gain, fine, and if there's a significant performance gain I don't have an objection. But I'm not sure why you're at the same time trying to argue that *adding* an extra implementation somehow makes the code easier to audit and doesn't add complexity... - Eric