Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5239095ybp; Mon, 7 Oct 2019 22:59:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJnhVvGbEfb1HUFd19GAkn3a7tqoP3mctQFIaHRXvYeBv879NUZj0mFZ/yhZz0V9FgiIXG X-Received: by 2002:a17:906:853:: with SMTP id f19mr1389289ejd.266.1570514388196; Mon, 07 Oct 2019 22:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570514388; cv=none; d=google.com; s=arc-20160816; b=NHLnxPGvvJ6nSldTUW9WNhG7VeoraetKmZf2b3AXpGQSWKpVReCk7KzIMVUVA70Xsn ZDxPPVtkw8md7OKgWf0DzKjdiKZYGzcsSife4SQea4RRAdqKf1cwkfrwP9lDIpF76jfx 04TN8UGuuv0hSq110yH6qlCg6SAbKkEC9Feby2RPYGbyy1cSJpS44jl95YYuqNlhYcHh H2vupg5tvjSk2HqubUv9txEfKYJiutJDYmu0wg+1HqSqXBAcsG7V4Gf6i97NCJ+J74nM T9+2wH709UpKftqa+MzGG3VPl8qaOg6zDYFkDwpH7IuX+zZzGjRX2bJXuav9iRQHYAqc e2mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=CyhBbLmeK5xzDBgrxXVgEMsiGq2PjuzaKHLJnIcb92w=; b=eTlXVGj6XGQG6pSVHhlX1x7KwCOhAszAhs5cin9ptLKyj9r6klCwBfDHgDm7hsp1bK 3GN4T2CbmQ72aotkbp1PlWupddZzswuC7b3kv05N9Q7njgo6N8Clksi8JxioLqur7QAk s2bVeNIB0mMK5wZYhpXpGzfyLQtMtbbh0q8OrbnNul2/F9XU7k0MGXZ4CO9qFxCsM1T5 RNrekKeNNEk4x8oZJo3q60zSsuQ+KeuzSS6Li0CGDCHxr8dRfcL7n22JaPkYtfhcFcKH 7Z4lxE4ATjsU47N90MZqzwStZzS+mssz3A+Q9oxM2swWi5HWEZA+Or9TdiBvmk30r5Hk XOMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="GV/YRLgn"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h26si8322791ejx.177.2019.10.07.22.59.14; Mon, 07 Oct 2019 22:59:48 -0700 (PDT) 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=@linaro.org header.s=google header.b="GV/YRLgn"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729836AbfJHF4O (ORCPT + 99 others); Tue, 8 Oct 2019 01:56:14 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34462 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729375AbfJHF4O (ORCPT ); Tue, 8 Oct 2019 01:56:14 -0400 Received: by mail-wr1-f65.google.com with SMTP id j11so12012146wrp.1 for ; Mon, 07 Oct 2019 22:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=CyhBbLmeK5xzDBgrxXVgEMsiGq2PjuzaKHLJnIcb92w=; b=GV/YRLgngCmpXVyQGuufwjJShaTqtiVomDfYfWmPfFAnm3ZcgRBQcLxlU/EsIGpHra 1W9fbLcuQfKn8wZwmYqxWlHhUkkt7qoFLsidtApAI6gGOu+SutoIV0drDMHIycDyatHm A6ktypX/9sSHU9Si6x6/PmLH70zkGL3sCZTNKM6rrpp0h6DOOO6l9iYJ/h6bUNKRhfm9 7cPdPehnw5mu0NIKp1saVLOYRo3c5b/SGWP3W41deSlTUAfjjt+Rocw3YQtuFY0qDrwc /sCn3jT3bc0H4JBjiguYlj0DGLgoJOKAs9tz0KQ62jjVN4AwQZ1QRjVcRuReTVpxYqxs 6vrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=CyhBbLmeK5xzDBgrxXVgEMsiGq2PjuzaKHLJnIcb92w=; b=eu5hVDCUNCtBUcHV9MXpDaTjzqfpUxs/XYOAJLcm3QGNyzj5zkPTANgAgiQvFTy9x7 DGEn3Imr6gr+iFsWrqGw+lrmQxSwAJDm+Fs2VKwl9ivE1svjqpaGfMH0AiWV3lGhM18U 2NMgruDjhX4y5rdKO45yekUQ07suQnuJ1gYmE60tvVFs5gdQ00rxpfFCILckK34VYto4 uTbqOkfFnwapZfS38ZlT0hA9D4WGq0pYMt7Vog5xnghZKgRWmGW0Eetfj4cXlYGpE62e lxNz8nnXHE306R89za3IqK/Yp25ch2pSsbH5zgGBgLRpa2m03dpYB630NGvhRNaB1xbA y8zQ== X-Gm-Message-State: APjAAAVAilgVoCcp02qnvYXsipjmmWHq2prSnNrLrLTLyuKNRQOKuQ1X w1PwGTpj8bua/LdFeYEi0htI52LswjypteooY86CVQ== X-Received: by 2002:adf:e5cb:: with SMTP id a11mr24800509wrn.200.1570514170913; Mon, 07 Oct 2019 22:56:10 -0700 (PDT) MIME-Version: 1.0 References: <20191007164610.6881-1-ard.biesheuvel@linaro.org> <20191007164610.6881-20-ard.biesheuvel@linaro.org> <20191007210242.Horde.FiSEhRSAuhKHgFx9ROLFIco@www.vdorst.com> In-Reply-To: <20191007210242.Horde.FiSEhRSAuhKHgFx9ROLFIco@www.vdorst.com> From: Ard Biesheuvel Date: Tue, 8 Oct 2019 07:55:58 +0200 Message-ID: Subject: Re: [PATCH v3 19/29] crypto: mips/poly1305 - incorporate OpenSSL/CRYPTOGAMS optimized implementation To: =?UTF-8?Q?Ren=C3=A9_van_Dorst?= Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Herbert Xu , David Miller , "Jason A . Donenfeld" , Samuel Neves , Arnd Bergmann , Eric Biggers , Andy Lutomirski , Martin Willi , Andy Polyakov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, 7 Oct 2019 at 23:02, Ren=C3=A9 van Dorst wr= ote: > > Quoting Ard Biesheuvel : > > > This is a straight import of the OpenSSL/CRYPTOGAMS Poly1305 implementa= tion > > for MIPS authored by Andy Polyakov, and contributed by him to the OpenS= SL > > project. The file 'poly1305-mips.pl' is taken straight from this upstre= am > > GitHub repository [0] at commit 57c3a63be70b4f68b9eec1b043164ea790db649= 9, > > and already contains all the changes required to build it as part of a > > Linux kernel module. > > > > [0] https://github.com/dot-asm/cryptogams > > > > Co-developed-by: Andy Polyakov > > Signed-off-by: Andy Polyakov > > Signed-off-by: Ard Biesheuvel > > --- > > arch/mips/crypto/Makefile | 14 + > > arch/mips/crypto/poly1305-glue.c | 203 ++++ > > arch/mips/crypto/poly1305-mips.pl | 1246 ++++++++++++++++++++ > > crypto/Kconfig | 6 + > > 4 files changed, 1469 insertions(+) > > > > > > Hi Ard, > > Is it also an option to include my mip32r2 optimized poly1305 version? > > Below the results which shows a good improvement over the Andy > Polyakov version. > I swapped the poly1305 assembly file and rename the function to > _mips > Full WireGuard source with the changes [0] > > bytes | RvD | openssl | delta | delta / openssl > 0 | 155 | 168 | -13 | -7,74% > 1 | 260 | 283 | -23 | -8,13% > 16 | 215 | 236 | -21 | -8,90% > 64 | 321 | 373 | -52 | -13,94% > 576 | 1440 | 1813 | -373 | -20,57% > 1280 | 2987 | 3801 | -814 | -21,42% > 1408 | 3268 | 4161 | -893 | -21,46% > 1420 | 3362 | 4267 | -905 | -21,21% > 1440 | 3337 | 4250 | -913 | -21,48% > 1536 | 3545 | 4531 | -986 | -21,76% > 4096 | 9160 | 11755 | -2595 | -22,08% > Hi Ren=C3=A9, I agree that, given these numbers, we should definitely switch to your code when building for 32r2 specifically. I'll incorporate that for the next revision.