Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp199900ybi; Wed, 29 May 2019 19:35:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQFH5/OksKLRWbOH21a7HKC/S+b+yLc55qRDqvyE2CXtemFp3yNGr1gyrFnEL24ZZIZ1pc X-Received: by 2002:a63:490a:: with SMTP id w10mr1427859pga.6.1559183706153; Wed, 29 May 2019 19:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559183706; cv=none; d=google.com; s=arc-20160816; b=b+9ih3JRHEIfXMbYb7VrZrrjV5SEpDwiVjRU2qcsd8F67vRPyjf957tEVBJndGN6eD moZfLXoarROB8yrQw7siWDA6S0rOAYV5dU0yENaBiuctaSgkdnBls9LHY7fldQMW+6Hv Bwf9gc1vCyuqLZdW2WDtg0q5c0cByX7MXQyU+uD9LF243k9kg2jElMD3Toby+ANfdZ5G 9zTNUDpMz7HlFuFR0zLSFTmVvblSKRbPfPb7zTV9mNREbC70S0s/vf59K0aZ4DPGDOF7 XaPqHymP5GaLZ9ON5+KgUyAxLzSGDStaH1Iqs7KoPc+YIpuNWYVYutiiPZqd/p/vu9i+ W0ng== 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=j/R1HIZdPHjBRy97PHv/YJqUKTniljLglfmMHFo2kCY=; b=xDfPPEWpCExJUy0dfUSjq+/LMKAYNmVKFWMfYmrwdAzYl/4ZV1r4jj7KVLlTupMSfU GAvNU85OGgd74xYukkmlquqET+tznOY9rpBrizAk66Oup7YdT75CSSuwgh8vxcgFT4qI fYVGrpIJkktT2SQs+rOlEehrqOh1E7v71+eu0rB+dfkMfyvGjn7GHTkO/MFQ6XxbcXuh n8ZMGeto2Ix1R6ND+SVr0LQ17qZ6D+OBCs6BxfenhS92oPcGFbj0qXt4vxzD29ZpIywg 3aysvf4yBolkxqiifz/5DPr0BFcbapRWkClf4bbck7jZIfz25orAztZ7nrIX4CRlmBWv XyjA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si163672pld.432.2019.05.29.19.34.40; Wed, 29 May 2019 19:35:06 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727339AbfE3CeL (ORCPT + 99 others); Wed, 29 May 2019 22:34:11 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:59044 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726483AbfE3CeL (ORCPT ); Wed, 29 May 2019 22:34:11 -0400 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 1hWAtH-0000Lt-Ia; Thu, 30 May 2019 10:34:03 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hWAtB-00059j-7J; Thu, 30 May 2019 10:33:57 +0800 Date: Thu, 30 May 2019 10:33:57 +0800 From: Herbert Xu To: Richard Weinberger Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, festevam@gmail.com, kernel@pengutronix.de, s.hauer@pengutronix.de, shawnguo@kernel.org, davem@davemloft.net, david@sigma-star.at Subject: Re: [RFC PATCH 1/2] crypto: Allow working with key references Message-ID: <20190530023357.2mrjtslnka4i6dbl@gondor.apana.org.au> References: <20190529224844.25203-1-richard@nod.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190529224844.25203-1-richard@nod.at> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, May 30, 2019 at 12:48:43AM +0200, Richard Weinberger wrote: > Some crypto accelerators allow working with secure or hidden keys. > This keys are not exposed to Linux nor main memory. To use them > for a crypto operation they are referenced with a device specific id. > > This patch adds a new flag, CRYPTO_TFM_REQ_REF_KEY. > If this flag is set, crypto drivers should tread the key as > specified via setkey as reference and not as regular key. > Since we reuse the key data structure such a reference is limited > by the key size of the chiper and is chip specific. > > TODO: If the cipher implementation or the driver does not > support reference keys, we need a way to detect this an fail > upon setkey. > How should the driver indicate that it supports this feature? > > Signed-off-by: Richard Weinberger We already have existing drivers doing this. Please have a look at how they're doing it and use the same paradigm. You can grep for paes under drivers/crypto. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt