Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp421713ybi; Thu, 30 May 2019 00:23:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0ehs4qircw8tzE94ocB+hWHMAZT+YSOsbnai0cwpTBgYBMu+muuj1voG7a+mfYmm/KAB5 X-Received: by 2002:a17:90a:35c:: with SMTP id 28mr2096288pjf.110.1559201037724; Thu, 30 May 2019 00:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559201037; cv=none; d=google.com; s=arc-20160816; b=szSckSsDNVoOW7B2Dpg09Jh/l7RIe3BFsPD+x2RfKWC1fbOIk3tUVdheyd/mCXEv02 S1953Xf/n3vowe7LNT1ZS13uopMcnyHiEQwdMUWU4pKXF1JjJYnzcyGU3NjucGAf1LXB pSetDQvDfNtqnqX8VBi7RyL+q0vZwjjulgxk3QMZJ7WqEFsFnCnrTbRoSrw5lHZwv8oW jhbT0+LItbHNeFI2tuC8qgASCtRLI3OF7J3tgJCiKbsKygGe9o0/CtHdmF6aSfaI9At4 0b41PYW1Rgh8zujQc6IUjsvVCYMyJBJwpW3w53TcjIAFxbtzp2JFpAx9etEUyZBBw85u OaxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=pBdbkO7CXcvMU8rtr8TTY70mA1Kyy3pjaA8tGGPZLEA=; b=o78cpsIFsLSfqRxpJfJXXw/Iiru7q+s28vUA4hoJwn8cSP9NreVNidQtWyHiYuM3jC xOy8oka2l7HfVro/3JQWEqwjWfl3b0wkN57IybMzIOLdjqlY4AlAx0uD1w6EqpQzcRed CB3suoa80ihF9N4xGOd6dVPU6lRfesa+Adr9bk/jO6YSHa1ypwfXBOyBOHk3fDSfF4sS xmQCFBNU5F3AmiFq26XW1wY5AsfEEZVRGt9MktXG4KsBSLZMEKFrhynHO7gkFwScXdsf DzIHdszTwSBemQX5/AxKfvzg7QBgk3v6nzCpNLtMlviGLVDlt2YWJNh90CeK7DnqGPDr xNhQ== 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 d65si2385447pgc.330.2019.05.30.00.23.42; Thu, 30 May 2019 00:23:57 -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 S1726376AbfE3HXl convert rfc822-to-8bit (ORCPT + 99 others); Thu, 30 May 2019 03:23:41 -0400 Received: from lithops.sigma-star.at ([195.201.40.130]:58606 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbfE3HXk (ORCPT ); Thu, 30 May 2019 03:23:40 -0400 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 4B4156074CC1; Thu, 30 May 2019 09:23:38 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7gYQFNzHwAQ9; Thu, 30 May 2019 09:23:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 7DEF36074CC0; Thu, 30 May 2019 09:23:36 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SYWKd5C5gmcb; Thu, 30 May 2019 09:23:36 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 397BB6074CC1; Thu, 30 May 2019 09:23:36 +0200 (CEST) Date: Thu, 30 May 2019 09:23:36 +0200 (CEST) From: Richard Weinberger To: Herbert Xu Cc: Linux Crypto Mailing List , linux-arm-kernel@lists.infradead.org, linux-kernel , linux-imx@nxp.com, festevam@gmail.com, kernel , Sascha Hauer , shawnguo@kernel.org, davem@davemloft.net, david Message-ID: <2084969721.73871.1559201016164.JavaMail.zimbra@nod.at> In-Reply-To: <20190530023357.2mrjtslnka4i6dbl@gondor.apana.org.au> References: <20190529224844.25203-1-richard@nod.at> <20190530023357.2mrjtslnka4i6dbl@gondor.apana.org.au> Subject: Re: [RFC PATCH 1/2] crypto: Allow working with key references MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.8_GA_3025 (ZimbraWebClient - FF60 (Linux)/8.8.8_GA_1703) Thread-Topic: crypto: Allow working with key references Thread-Index: 6TFlo+ksej+abko/FbMI4LB7xy79pA== Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org ----- Ursprüngliche Mail ----- > Von: "Herbert Xu" > An: "richard" > CC: "Linux Crypto Mailing List" , linux-arm-kernel@lists.infradead.org, "linux-kernel" > , linux-imx@nxp.com, festevam@gmail.com, "kernel" , "Sascha Hauer" > , shawnguo@kernel.org, davem@davemloft.net, "david" > Gesendet: Donnerstag, 30. Mai 2019 04:33:57 > Betreff: Re: [RFC PATCH 1/2] crypto: Allow working with key references > 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. Thanks for the pointer. So the preferred way is defining a new crypto algorithm prefixed with "p" and reusing setkey to provide the key reference. Thanks, //richard