Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp384354imm; Thu, 13 Sep 2018 23:21:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbiRay47SVAMXJagHGHXA9TpJXpx8mpuYhWRJRe1kBR8ld4/cayTs1EKmL377BDae3Vx4mH X-Received: by 2002:a17:902:4601:: with SMTP id o1-v6mr10612843pld.202.1536906094146; Thu, 13 Sep 2018 23:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536906094; cv=none; d=google.com; s=arc-20160816; b=R6rGiRm1LShJ0N97ne27BAQgexreb4TYCqRJFHFOgvecjhcf8KFUJAmcsdDWEV2km1 dHVaF0nXRprgnJ2ZrAMCu/yjAMQSRmKlYkA8HBxe6TCna7rYsailJleV72InU0g9lU8O cRNAQdkij/TldlfZFFJLUJyet/0KXPPZzrsRnFwATrjuuekxJdIHCedFqHkirJBZiret X+sPY9M2iHcFnggvP2R3aufddFvbjKL7yf4EESZ+37fIba1Ar8KSTe8KfmKUm5mbF3kv F9rEqux+sXBxdJ/Mx4GTlP7xAvwFy/rVkGjZCX0kkYQaOYNB6XwnO/UfVs00r4i1yIQO Ei1Q== 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 :references:in-reply-to:mime-version:dkim-signature; bh=bsaNGShqKwnDmcxYHCBBuGqkfRN2UcewSbRQtNuwMd4=; b=GOG0mLrJKzGW6FLKPbCJHxKdy52g77771HleXRmPzB2eWlOnmB7vvDbcmkTun4RIr3 bNU5XAS74WZsBBYoUc/DtEg+aaIrGwRzkZzHZRMdSVmTk3H509nbQvkHReyXOdW2JB2B ccxCdAhuB7uqG6PGb9vdNlwwZnieVOIk+w8jtOifWytH3qTVC8hTjBoIvMcFWrLLTwZM m/KmA2EvN8Pi5qhvzzE9XWrMRoXOLTy/O/lIZeqF6kVoliyeCGbHnSJTfjYIjuCl4CxC XG1zm9ZXESAm9lEnOqfUqm0nHQndvPWYxxPZCAfAirKNSMXqqmS7CD4vhZ+0wuP46MY8 hw9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DqCUDt0I; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14-v6si5812278pfh.92.2018.09.13.23.21.18; Thu, 13 Sep 2018 23:21:34 -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=@linaro.org header.s=google header.b=DqCUDt0I; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727770AbeINLd7 (ORCPT + 99 others); Fri, 14 Sep 2018 07:33:59 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:52344 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbeINLd7 (ORCPT ); Fri, 14 Sep 2018 07:33:59 -0400 Received: by mail-it0-f66.google.com with SMTP id h3-v6so1179256ita.2 for ; Thu, 13 Sep 2018 23:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bsaNGShqKwnDmcxYHCBBuGqkfRN2UcewSbRQtNuwMd4=; b=DqCUDt0IMsX20P+haK+JDUw7F8UoMswquaFjPylvBlOMLxIQoBSSg34aUWVhCkLGqt SqZN+Y6cmZ2dof8zFAywvi1F56279DiO6VzcbV/r+Clt0O9ojgDy2g4uwuusHFdeHZCt mKwjHyulag7bMQR4VmEDeGecMC3EMehkJBxXE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bsaNGShqKwnDmcxYHCBBuGqkfRN2UcewSbRQtNuwMd4=; b=oHUXyRfnAtrFv2BNgNDEMIkBkJH7eJl40RpbSQT1xTuEfx4114ooKZD/vGrRI3tyLm 85MH4BM9nQisLpaP6MPZv92DJ4Mp8iieqcms6cXZ6uY1hNHm138p6LyRxy324WjTRXfG em5+GIYYBn0jr7tMox/tq1iGRwX78jRvDe9gMr1XrzfbbhPobQJ6feblrpk9xduXSMQo X34Pxpc3oLpzT1MabVAhUtC8i7TUmhEYP3clokK4Zv2e+KfM1ROK3Jl/MVL54+eXM1OQ sOKjcXIQ4UGu3PZwFfm9yJ0lElpUcz3yhGh+RVc6F4hPBLSGRCLJZyoM9GJkJRQUsxkE A+nA== X-Gm-Message-State: APzg51AVR/g0ui2EM9iTgyAXrdSWxG5htmXWrxbrXQ9sMx58oJv9Nxc/ q7xC9eepzQFYi0RbCVzPLMyqAcCNwC2ZScXYgEdtFw== X-Received: by 2002:a24:8309:: with SMTP id d9-v6mr1105211ite.123.1536906062043; Thu, 13 Sep 2018 23:21:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:2848:0:0:0:0:0 with HTTP; Thu, 13 Sep 2018 23:21:00 -0700 (PDT) In-Reply-To: <20180912183444.GB222557@gmail.com> References: <20180911010838.8818-1-Jason@zx2c4.com> <20180911010838.8818-3-Jason@zx2c4.com> <20180911220849.GC81235@gmail.com> <20180912183444.GB222557@gmail.com> From: Ard Biesheuvel Date: Fri, 14 Sep 2018 08:21:00 +0200 Message-ID: Subject: Re: [PATCH net-next v3 02/17] zinc: introduce minimal cryptography library To: Eric Biggers Cc: "Jason A. Donenfeld" , LKML , Netdev , David Miller , Greg Kroah-Hartman , Andrew Lutomirski , Samuel Neves , Jean-Philippe Aumasson , Linux Crypto Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12 September 2018 at 20:34, Eric Biggers wrote: > 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. > Thanks Eric. I reached out to Andy Polyakov off line, and he is happy to work with us again on this, although he did point out that our experiences on ARM may not extrapolate to x86_64, given the fact that the perl sources there also contain parameterization for the calling convention differences between Windows and SysV.