Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp263154imu; Mon, 19 Nov 2018 22:06:06 -0800 (PST) X-Google-Smtp-Source: AFSGD/XgerwS6eEDYGXYY7tP/RO5Y2zIHSQMvZKd+Xni+zRyjApHxiQQr3KL5LytsJllLC+0Qv8a X-Received: by 2002:a63:f111:: with SMTP id f17mr752144pgi.236.1542693966657; Mon, 19 Nov 2018 22:06:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542693966; cv=none; d=google.com; s=arc-20160816; b=0jn9m2dIYYVi08az05B2mnPcbL7tyZ4juWdFBbcHU6eb8CFWnjSwWNV06WDgcRqfCI EhmpN5EjzVtvtXDt5woNE8mtMDlsTj+kA2t7Z8RH7qItZbU4MC/UssmVhQNpu9o/98Lt ICNfDJdujAMrnnqvyHjley9k+GUraDqhzcPJO+vTX7Pz6gBTqO+NQgvjVedhfl5GoqB7 7TeMvadWpe5ub3KN0VhaVXjeyAtzNewWIQnGzUlldhHy4x/y4RPUvDCfowmtdUMhZ+pN e580Zpdpvj/xhKzdQWna2UyMQ+EBBB1MSdrvW0CMA8ARN0YwJ9p417lSY9WU67URpK7V /S6g== 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; bh=LSqtr07HoeZGTWJKHyvdP65NtZcdz14X3d4DmPyaYfQ=; b=S1crEPXV88k09R5vj+yYa9/auf9mXhRCXpzqqd3eO0/HLjejWX9KLJSpgzgd8C8mSG Yn0CQntb0IYKfslqAFzgzzz3mrjIZxYKKs1ObVaLVow4I3EG7ONvvnUJAwLllhdCeg3T Ab2Gs6xROf8bBJxfveawzYUYV3GJvK92b6DBgN7gRP8a6SUOGwmCpRoLGcADRdN+viDt wooeL6IxA0KqVRbwLzKuGThgUZ3PZrTDxT57L0ddtjOYy3yNw6+tn8VPFtEMUuQ964+g yFJb/rvzTtRSTUXo2Om20EhXAT/Mk2LHQIvUyxVi5Zutn1E9MKeC0Sg/4LBkYPIx8Me7 TBTA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g83si19138377pfb.278.2018.11.19.22.05.51; Mon, 19 Nov 2018 22:06:06 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732348AbeKTQ3y (ORCPT + 99 others); Tue, 20 Nov 2018 11:29:54 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:45356 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732199AbeKTQ3y (ORCPT ); Tue, 20 Nov 2018 11:29:54 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1gOz7B-0000Ca-SE; Tue, 20 Nov 2018 14:02:26 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1gOz73-00065g-AM; Tue, 20 Nov 2018 14:02:17 +0800 Date: Tue, 20 Nov 2018 14:02:17 +0800 From: Herbert Xu To: "Jason A. Donenfeld" Cc: Eric Biggers , Ard Biesheuvel , Linux Crypto Mailing List , linux-fscrypt@vger.kernel.org, linux-arm-kernel@lists.infradead.org, LKML , Paul Crowley , Greg Kaiser , Samuel Neves , Tomer Ashur , Martin Willi Subject: [RFC PATCH v2 0/4] Exporting existing crypto API code through zinc Message-ID: <20181120060217.t4nccaqpwnxkl4tx@gondor.apana.org.au> References: <20181105232526.173947-1-ebiggers@kernel.org> <20181105232526.173947-11-ebiggers@kernel.org> <20181112185816.GA8663@gmail.com> <20181116060227.hwu4igi6bp26ddpi@gondor.apana.org.au> <20181117001718.GA175522@gmail.com> <20181119052451.qttzfgcm4hvbdc4u@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181119052451.qttzfgcm4hvbdc4u@gondor.apana.org.au> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 19, 2018 at 01:24:51PM +0800, Herbert Xu wrote: > > In response to Martin's patch-set which I merged last week, I think > here is quick way out for the zinc interface. > > Going through the past zinc discussions it would appear that > everybody is quite happy with the zinc interface per se. The > most contentious areas are in fact the algorithm implementations > under zinc, as well as the conversion of the crypto API algorithms > over to using the zinc interface (e.g., you can no longer access > specific implementations). > > My proposal is to merge the zinc interface as is, but to invert > how we place the algorithm implementations. IOW the implementations > should stay where they are now, with in the crypto API. However, > we will provide direct access to them for zinc without going through > the crypto API. IOW we'll just export the functions directly. > > Here is a proof of concept patch to do it for chacha20-generic. > It basically replaces patch 3 in the October zinc patch series. > Actually this patch also exports the arm/x86 chacha20 functions > too so they are ready for use by zinc. > > If everyone is happy with this then we can immediately add the > zinc interface and expose the existing crypto API algorithms > through it. This would allow wireguard to be merged right away. > > In parallel, the discussions over replacing the implementations > underneath can carry on without stalling the whole project. > > PS This patch is totally untested :) Here is an updated version demonstrating how we could access the accelerated versions of chacha20. It also includes a final patch to deposit the new zinc version of x86-64 chacha20 into arch/x86/crypto where it can be used by both the crypto API as well as zinc. The key differences between this and the last zinc patch series: 1. The crypto API algorithms remain individually accessible, this is crucial as these algorithm names are exported to user-space so changing the names to foo-zinc is not going to work. 2. The arch-specific algorithm code lives in their own module rather than in a monolithic module. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt