From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DECA3C28CC0 for ; Thu, 30 May 2019 02:34:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC835218D1 for ; Thu, 30 May 2019 02:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727339AbfE3CeL (ORCPT ); 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B920DC28CC0 for ; Thu, 30 May 2019 02:34:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F1F8218D1 for ; Thu, 30 May 2019 02:34:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iVdJZQCg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F1F8218D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gondor.apana.org.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pU5BFIjZcX38h6cGpth20zRXOO4qcXcS6sbkBzpX8qw=; b=iVdJZQCghZ7f9s IjCirnv128TgZnTxBlgRvbj7BBFidXmkD6l7mvYRLYdA5Rm+lWVHShFvx0oEZq9hYh10yFhhJezGY k5olzZJ6Nl9KwwsgKfH3RznufIUfGn/kLkcOt2BuXuNa2ALoOr9rPOigyDIysrnsC9bZbrteFZjb3 q2VY2TGFLM3Ovhe5VIFg0GcUCS0bMM0bI0fnTEaQpgw7HFuPx4Dhptec5jz78V9F73IFRFcYum1oc CX5xhUOjDOR1QFiE1ha0gOq9uHSNPEzamIKBLznJekOT+BTETahZLoW21U09mYYOTw/i499juZPx6 3UIZl22NZLJE3KdrJGyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hWAtQ-0001nu-6r; Thu, 30 May 2019 02:34:12 +0000 Received: from helcar.hmeau.com ([216.24.177.18] helo=deadmen.hmeau.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hWAtL-0001nX-N7 for linux-arm-kernel@lists.infradead.org; Thu, 30 May 2019 02:34:10 +0000 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 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-Disposition: inline In-Reply-To: <20190529224844.25203-1-richard@nod.at> User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190529_193407_897336_CA7CADC2 X-CRM114-Status: GOOD ( 10.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: david@sigma-star.at, shawnguo@kernel.org, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel