Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1076153imm; Fri, 14 Sep 2018 10:46:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZkAFjK93dV1WFqgbqUMZSsNzodiWSax4vSqYFHRZgXLCNiCss0rqaLzuyMuFwJHYzcWc+M X-Received: by 2002:a62:1605:: with SMTP id 5-v6mr13674066pfw.11.1536947181781; Fri, 14 Sep 2018 10:46:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536947181; cv=none; d=google.com; s=arc-20160816; b=UMQ2CPn4RRZ88UL0PehaJpiJVNFoh/C5N/SwwTBhY93qJ4tCzV6dI3g2/I42Aqop76 w8+t1x9i2tL5hqzMofhZojtiAra7VSo1zzZHbIJoHbeDC3Lm22s9j+f6h0iKyWfvnlUy 19qjNlU/FcY6BDMvV32I6qIYdyZsudJRbpGDdz2eCFQ2OUeWC4s1QstvsmotJ3FrD0qV JUcU/vV/hgHlDBSe5fma0vYwCw2rh0pVX8SdBBw+BgpkQjv+i8flCRC+JFqmSerNxzBz o2F0IttgucAUCMzHYaCLY8s6jeO/e8ceAhIgng5m7XULrbyN1WZ2JTsm8gBeRKDnvHYV cq5w== 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=J0aMKNVbin88mmt/SMWWhKoebjUWD9rcIUiDFecqqOU=; b=chtgKXWd1x752l9hjjLD39TwDMW5J5zl9ttmEZQoPsbdivs9PXe+4mRV0ZaC1MB5RD yNr+98TS0n97RA3FBGE0tx0FXbK5SVXleGqsHqnnZ5OGdd9jsL4eYDGaROei0wXfso4x lQ9hnieBldPFG5WRYm6NcoVn7SfCTnJPC+KlocBA5h251Oe6zEJjUPNRWeFSrskHhh18 j4xkCtDA86JzComtNI0tV8Dk4nqmUiwoujlgr8KTdr4vzbpmZrhszC8RsDngKIcex5qq UJtK0jjZpirho19hQwGKcfCDsNi4bfJ0T2BSsWlcsEm9zOCrD/dqutyt/qvx2L7o3+uD 14Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=F8IzLuYR; 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=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4-v6si7724411pfb.52.2018.09.14.10.46.07; Fri, 14 Sep 2018 10:46:21 -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=@zx2c4.com header.s=mail header.b=F8IzLuYR; 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=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728216AbeINXBV (ORCPT + 99 others); Fri, 14 Sep 2018 19:01:21 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:35031 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727029AbeINXBU (ORCPT ); Fri, 14 Sep 2018 19:01:20 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 97cec5e7; Fri, 14 Sep 2018 17:28:42 +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=F4od+g2uUE7skfneZs4SE6ivRPs=; b=F8IzLu YRanBYzdzvA4+RvZwXGL/dhaC701TDg4jlekLIVD9va6ErM29UT6m08rGivcli0O y7+RR7wnfflcG7+a6Y6vR96iTi3AD3yLmMUzeKG5kRJ62V7+qsXfl30Qhpp5zUv7 eAMjNqHWGW/PKukT2ZsPZ6KGOzR/666datYTf3N/0BqLex+rsgm7s7B0fMtLOysk 1A+r/KS1m6+akegXNrkA3sJVhdzDc/o8S46YpSabBJIicktbWiYHbjX2RM0ki7hC a0w2T46iEMbpiSOTzcrFl7N4/lzSi1sJwEPsYbqqXI9s9NJODaThcbsjBUXiM3F/ kht1RLnqF/FGK1Ew== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 5db300ab (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128:NO); Fri, 14 Sep 2018 17:28:41 +0000 (UTC) Received: by mail-ot1-f52.google.com with SMTP id a19-v6so5369903otl.12; Fri, 14 Sep 2018 10:45:45 -0700 (PDT) X-Gm-Message-State: APzg51Ae/uCXuU0cLnkYpWNaKDJaNSMKrRCwN0WKGtn4FGnsdH6nYSHn dQQ9Upys2YHmh/drGAueUeRguum8OocA3u1OL8U= X-Received: by 2002:a9d:2dc8:: with SMTP id g66-v6mr4953890otb.311.1536947144119; Fri, 14 Sep 2018 10:45:44 -0700 (PDT) MIME-Version: 1.0 References: <20180914162240.7925-1-Jason@zx2c4.com> <20180914162240.7925-9-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Fri, 14 Sep 2018 19:45:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next v4 08/20] zinc: Poly1305 ARM and ARM64 implementations To: Ard Biesheuvel Cc: LKML , Netdev , Linux Crypto Mailing List , David Miller , Greg Kroah-Hartman , Samuel Neves , Andrew Lutomirski , Jean-Philippe Aumasson , Andy Polyakov , Russell King - ARM Linux , linux-arm-kernel@lists.infradead.org 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 Hi Ard, On Fri, Sep 14, 2018 at 7:27 PM Ard Biesheuvel wrote: > As I asked in response to v3, could we please have this as a separate > patch on top? The diff below is corrupted. I had played with that originally, but thought it made things actually harder to review, whereas here you have the changes presented pretty straight forwardly, and I'd appreciate your review of them. If you and Eric both prefer I split this into two commits, with the first one just plopping down the CRYPTOGAMS code as is and the second one bringing it up to kernel-snuff, I can do that. > Also, both Andy and Eric have offered to get involved in upstreaming > these changes to OpenSSL, so there is no delta to begin with. Yes, I think this is probably a good long-term plan, which we can act on sometime after Zinc is merged. > I still don't like the GCC -includes, especially because these .h > files contain function and variable definitions so they are not > actually header files to begin with. I very very strongly disagree with you here. I think doing it via -include is significantly cleaner than any of the alternatives, and allows the code to be cleanly expressed as conditionals that the optimizer trivially compiles out in the case of stub functions returning false and branch optimizes when the stub functions return true. It is extremely important that these compile together as one compilation unit. Yes, this is a different design than the crypto API's approach, but I believe the approach presented here poses significant improvements and is a lot cleaner. > Also, you mentioned in the commit log that you got rid of defines and > made the code more modular, but as far as I can tell, libzinc is still > a single monolithic binary that is essentially always builtin once we > move random.c to it. Yes, it's still monolithic, but it's now trivial to split up when the time comes to do that. If you and AndyL think that it should be split into multiple modules _now_, then I can go ahead and do that for v5. But if it's not essential, it seems simpler to keep it as is. I'll wait for word from you two on this. Jason