Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5818548imm; Wed, 12 Sep 2018 11:35:16 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaTbQ241a7ou5BF0dEVo+jG1UbeVlsR6rvF0eUOA8ClyLqDGb8I9b3KPUay4/UzEKDEL9IW X-Received: by 2002:a63:fb07:: with SMTP id o7-v6mr3705185pgh.333.1536777316206; Wed, 12 Sep 2018 11:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536777316; cv=none; d=google.com; s=arc-20160816; b=pCCtWfB/kWtAM03ZJBUBh/55BHrcQGjJQqnU2wpeZ1Jfx41HAcCIfTnpsD0Zh6Cvp6 893kVr3Bidt9qTryQ0Xc430aEKYyPnqFK5/so1eanBAEJ0PsRXIoNDqwtzm/xPzig/s8 qCRqtbyZp+W/HDozrPv3Znh3LbpmXqCDkry8bnC6BbxwL0Xu3ElfBMif7TTvhoefEU1F OW8j93CDdijEx2yo+Mh60XUHwEgUeyHMwMYUe4+knENpAUjBo4U0G/rD00mISELsD/SL yykuXtSGbP5tfB6m4n8vsrAgmnbWioa1vor+aMjAqiawMy38LhkqkZ26JxMjdsOK+N7E MSsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5nfxBanhf4GhYU+u153Icvr2qOtbZnzH16AW5dc+QEk=; b=WiXtXmSNPgnqKslhRWf2YQxaU3o6CU/erFKrSoKrDvHkZvC4DPIoS3cB7LMD0bxRRm g7ztS2qaQtCbJ/mjXT76AQBs7nvTY63We3yVzV3KxZH+ttYT4v4fKz41dJUy+1PBIP5n FQo9b/iA0pfGG9kLhlYD/VrmRBqwMnoaBGKknIG6TATv4RsQYV+SvJ1pBYspwtb5qXFi qRETqFqK1OjVd9W/2Q9ARkakhFBcPg/gbEnAFDDwwkGgXlpUwdHumbsXl/AVLIkr1ig8 zNtS8EmJAmAl3IWRbN6ngWDxYD8/YJ1S96NnL0UJ8tkBuc/waug3RVmQ/OSWGJ7LD8Te c8eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DF2XliIx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 c10-v6si1766859pgb.638.2018.09.12.11.35.01; Wed, 12 Sep 2018 11:35:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=DF2XliIx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1728018AbeILXkc (ORCPT + 99 others); Wed, 12 Sep 2018 19:40:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:42876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727651AbeILXkc (ORCPT ); Wed, 12 Sep 2018 19:40:32 -0400 Received: from gmail.com (unknown [104.132.51.88]) (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 3DDD820854; Wed, 12 Sep 2018 18:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536777286; bh=pge98TJPPolDJ8DTUt2rNC12zELDyGW2I7GUqcQLE+o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DF2XliIx58Chsn1zS+fgGom+9KfqXXDOtZzgm/9hAxBo2ReIq+2ogcYcJBpgawARF 2Tz+i7+b+8NPlAHsJQRJGHP8HWJFkIoYiAf1nQgT545N2l7iFHO/M6Cc1VkcREI4C+ uztEwKe1Prc6A7lEWmtsIy8/oU60s0SRJ/avaMw8= Date: Wed, 12 Sep 2018 11:34:44 -0700 From: Eric Biggers To: Ard Biesheuvel Cc: "Jason A. Donenfeld" , LKML , Netdev , David Miller , Greg Kroah-Hartman , Andrew Lutomirski , Samuel Neves , Jean-Philippe Aumasson , Linux Crypto Mailing List Subject: Re: [PATCH net-next v3 02/17] zinc: introduce minimal cryptography library Message-ID: <20180912183444.GB222557@gmail.com> References: <20180911010838.8818-1-Jason@zx2c4.com> <20180911010838.8818-3-Jason@zx2c4.com> <20180911220849.GC81235@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 12, 2018 at 08:19:21PM +0200, Ard Biesheuvel wrote: > On 12 September 2018 at 20:16, Jason A. Donenfeld wrote: > > Hi Eric, > > > > On Wed, Sep 12, 2018 at 12:08 AM Eric Biggers wrote: > >> I'd strongly prefer the assembly to be readable too. Jason, I'm not sure if > >> you've actually read through the asm from the OpenSSL implementations, but the > >> generated .S files actually do lose a lot of semantic information that was in > >> the original .pl scripts. > > > > The thing to keep in mind is that the .S was not directly and blindly > > generated from the .pl. We started with the output of the .pl, and > > then, particularly in the case of x86_64, worked with it a lot, and > > now it's something a bit different. We've definitely spent a lot of > > time reading that assembly. > > > > Can we please have those changes as a separate patch? Preferably to > the .pl file rather than the .S file, so we can easily distinguish the > code from upstream from the code that you modified. > > > I'll see if I can improve the readability with some register name > > remapping on ARM. No guarantees, but I'll play a bit and see if I can > > make it a bit better. > > > > Jason FWIW, yesterday I made a modified version of poly1305-armv4.pl that generates an asm file that works in kernel mode. The changes are actually pretty small, and I think we can get them upstream into OpenSSL like they were for sha256-armv4.pl and sha512-armv4.pl. I'll start a thread with Andy Polyakov and you two. But I don't have time to help with all the many OpenSSL asm files Jason is proposing, just maybe poly1305-armv4 and chacha-armv4 for now. - Eric